From: Enlightenment S. <no-...@en...> - 2012-08-16 21:35:37
|
Log: EPhysics: fix old bug on velocity setter It should invert y component since evas y coords increase going down. Author: bdilly Date: 2012-08-16 14:35:31 -0700 (Thu, 16 Aug 2012) New Revision: 75337 Trac: http://trac.enlightenment.org/e/changeset/75337 Modified: trunk/ephysics/src/bin/test_no_gravity.c trunk/ephysics/src/lib/ephysics_body.cpp Modified: trunk/ephysics/src/bin/test_no_gravity.c =================================================================== --- trunk/ephysics/src/bin/test_no_gravity.c 2012-08-16 21:35:25 UTC (rev 75336) +++ trunk/ephysics/src/bin/test_no_gravity.c 2012-08-16 21:35:31 UTC (rev 75337) @@ -42,7 +42,7 @@ update_object_cb, sh1); ephysics_body_restitution_set(box_body1, 0.7); ephysics_body_friction_set(box_body1, 0); - ephysics_body_linear_velocity_set(box_body1, -30, -40); + ephysics_body_linear_velocity_set(box_body1, -30, 40); ephysics_body_sleeping_threshold_set(box_body1, 0.1, 0.1); test_data->bodies = eina_list_append(test_data->bodies, box_body1); @@ -68,7 +68,7 @@ update_object_cb, sh2); ephysics_body_restitution_set(box_body2, 0.7); ephysics_body_friction_set(box_body2, 0); - ephysics_body_linear_velocity_set(box_body2, 40, 30); + ephysics_body_linear_velocity_set(box_body2, 40, -30); ephysics_body_angular_velocity_set(box_body2, 36); ephysics_body_sleeping_threshold_set(box_body2, 0.1, 0.1); test_data->bodies = eina_list_append(test_data->bodies, box_body2); Modified: trunk/ephysics/src/lib/ephysics_body.cpp =================================================================== --- trunk/ephysics/src/lib/ephysics_body.cpp 2012-08-16 21:35:25 UTC (rev 75336) +++ trunk/ephysics/src/lib/ephysics_body.cpp 2012-08-16 21:35:31 UTC (rev 75337) @@ -36,7 +36,7 @@ static inline void _ephysics_body_linear_velocity_set(EPhysics_Body *body, double x, double y, double rate) { - body->rigid_body->setLinearVelocity(btVector3(x / rate, y / rate, 0)); + body->rigid_body->setLinearVelocity(btVector3(x / rate, -y / rate, 0)); } static void |