EPhysics: fix old bug on velocity setter

It should invert y component since evas y coords increase
going down.



SVN revision: 75337
This commit is contained in:
Bruno Dilly 2012-08-16 21:35:31 +00:00
parent b007921b94
commit b5221d0705
2 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ _world_populate(Test_Data *test_data)
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 @@ _world_populate(Test_Data *test_data)
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);

View File

@ -36,7 +36,7 @@ _ephysics_body_sleeping_threshold_set(EPhysics_Body *body, double linear_thresho
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