summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-08-16 21:35:31 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-08-16 21:35:31 +0000
commitb5221d07056ca9da715472c79efd5dc15d91f039 (patch)
tree243835602335e25efe6b5981054138347b8a7fb4 /legacy
parentb007921b94bcf7627771a1ce95a29e8bd297feff (diff)
EPhysics: fix old bug on velocity setter
It should invert y component since evas y coords increase going down. SVN revision: 75337
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ephysics/src/bin/test_no_gravity.c4
-rw-r--r--legacy/ephysics/src/lib/ephysics_body.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/legacy/ephysics/src/bin/test_no_gravity.c b/legacy/ephysics/src/bin/test_no_gravity.c
index 64b55665b9..5bf65fd892 100644
--- a/legacy/ephysics/src/bin/test_no_gravity.c
+++ b/legacy/ephysics/src/bin/test_no_gravity.c
@@ -42,7 +42,7 @@ _world_populate(Test_Data *test_data)
42 update_object_cb, sh1); 42 update_object_cb, sh1);
43 ephysics_body_restitution_set(box_body1, 0.7); 43 ephysics_body_restitution_set(box_body1, 0.7);
44 ephysics_body_friction_set(box_body1, 0); 44 ephysics_body_friction_set(box_body1, 0);
45 ephysics_body_linear_velocity_set(box_body1, -30, -40); 45 ephysics_body_linear_velocity_set(box_body1, -30, 40);
46 ephysics_body_sleeping_threshold_set(box_body1, 0.1, 0.1); 46 ephysics_body_sleeping_threshold_set(box_body1, 0.1, 0.1);
47 test_data->bodies = eina_list_append(test_data->bodies, box_body1); 47 test_data->bodies = eina_list_append(test_data->bodies, box_body1);
48 48
@@ -68,7 +68,7 @@ _world_populate(Test_Data *test_data)
68 update_object_cb, sh2); 68 update_object_cb, sh2);
69 ephysics_body_restitution_set(box_body2, 0.7); 69 ephysics_body_restitution_set(box_body2, 0.7);
70 ephysics_body_friction_set(box_body2, 0); 70 ephysics_body_friction_set(box_body2, 0);
71 ephysics_body_linear_velocity_set(box_body2, 40, 30); 71 ephysics_body_linear_velocity_set(box_body2, 40, -30);
72 ephysics_body_angular_velocity_set(box_body2, 36); 72 ephysics_body_angular_velocity_set(box_body2, 36);
73 ephysics_body_sleeping_threshold_set(box_body2, 0.1, 0.1); 73 ephysics_body_sleeping_threshold_set(box_body2, 0.1, 0.1);
74 test_data->bodies = eina_list_append(test_data->bodies, box_body2); 74 test_data->bodies = eina_list_append(test_data->bodies, box_body2);
diff --git a/legacy/ephysics/src/lib/ephysics_body.cpp b/legacy/ephysics/src/lib/ephysics_body.cpp
index 7677d5584e..828b2eb56c 100644
--- a/legacy/ephysics/src/lib/ephysics_body.cpp
+++ b/legacy/ephysics/src/lib/ephysics_body.cpp
@@ -36,7 +36,7 @@ _ephysics_body_sleeping_threshold_set(EPhysics_Body *body, double linear_thresho
36static inline void 36static inline void
37_ephysics_body_linear_velocity_set(EPhysics_Body *body, double x, double y, double rate) 37_ephysics_body_linear_velocity_set(EPhysics_Body *body, double x, double y, double rate)
38{ 38{
39 body->rigid_body->setLinearVelocity(btVector3(x / rate, y / rate, 0)); 39 body->rigid_body->setLinearVelocity(btVector3(x / rate, -y / rate, 0));
40} 40}
41 41
42static void 42static void