diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-07-24 12:53:07 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-24 12:53:07 -0300 |
commit | 6b0a810970b76e54cbd874228db01e0b0a74504d (patch) | |
tree | f1d2c958ae9e2a2dfa877f4003c1ff31de347143 | |
parent | 62cdfeaf581e3c97f620ac6e58e5cec04f10899d (diff) | |
parent | 2182ee3270378d8e109d343efa06aced34e69f58 (diff) |
Merge pull request #5855 from Alex-doc/fix_velocity_at_pos
Fix #5854 (get_contact_collider_velocity_at_pos() strange behavior)
-rw-r--r-- | servers/physics/body_pair_sw.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/servers/physics/body_pair_sw.cpp b/servers/physics/body_pair_sw.cpp index 3202e52abb..43e52f26e8 100644 --- a/servers/physics/body_pair_sw.cpp +++ b/servers/physics/body_pair_sw.cpp @@ -323,13 +323,13 @@ bool BodyPairSW::setup(float p_step) { #endif if (A->can_report_contacts()) { - Vector3 crB = A->get_angular_velocity().cross( c.rA ) + A->get_linear_velocity(); - A->add_contact(global_A,-c.normal,depth,shape_A,global_B,shape_B,B->get_instance_id(),B->get_self(),crB); + Vector3 crA = A->get_angular_velocity().cross( c.rA ) + A->get_linear_velocity(); + A->add_contact(global_A,-c.normal,depth,shape_A,global_B,shape_B,B->get_instance_id(),B->get_self(),crA); } if (B->can_report_contacts()) { - Vector3 crA = A->get_angular_velocity().cross( c.rB ) + A->get_linear_velocity(); - B->add_contact(global_B,c.normal,depth,shape_B,global_A,shape_A,A->get_instance_id(),A->get_self(),crA); + Vector3 crB = B->get_angular_velocity().cross( c.rB ) + B->get_linear_velocity(); + B->add_contact(global_B,c.normal,depth,shape_B,global_A,shape_A,A->get_instance_id(),A->get_self(),crB); } if (A->is_shape_set_as_trigger(shape_A) || B->is_shape_set_as_trigger(shape_B) || (A->get_mode()<=PhysicsServer::BODY_MODE_KINEMATIC && B->get_mode()<=PhysicsServer::BODY_MODE_KINEMATIC)) { |