From 335912df94bf532b801883864faee2edd59ce6fb Mon Sep 17 00:00:00 2001 From: Bruno Dilly Date: Mon, 20 Aug 2012 22:18:14 +0000 Subject: [PATCH] EPhysics: fix y component convertion on forces and impulses SVN revision: 75480 --- legacy/ephysics/src/lib/ephysics_body.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/legacy/ephysics/src/lib/ephysics_body.cpp b/legacy/ephysics/src/lib/ephysics_body.cpp index 57ba19c..e84f649 100644 --- a/legacy/ephysics/src/lib/ephysics_body.cpp +++ b/legacy/ephysics/src/lib/ephysics_body.cpp @@ -1253,7 +1253,7 @@ ephysics_body_central_impulse_apply(EPhysics_Body *body, double x, double y) rate = ephysics_world_rate_get(body->world); body->rigid_body->activate(1); - body->rigid_body->applyCentralImpulse(btVector3(x / rate, y / rate, 0)); + body->rigid_body->applyCentralImpulse(btVector3(x / rate, - y / rate, 0)); } EAPI void @@ -1270,7 +1270,7 @@ ephysics_body_impulse_apply(EPhysics_Body *body, double x, double y, Evas_Coord rate = ephysics_world_rate_get(body->world); body->rigid_body->activate(1); - body->rigid_body->applyImpulse(btVector3(x / rate, y / rate, 0), + body->rigid_body->applyImpulse(btVector3(x / rate, - y / rate, 0), btVector3((double) pos_x / rate, (double) pos_y / rate, 0)); } @@ -1418,7 +1418,7 @@ ephysics_body_central_force_apply(EPhysics_Body *body, double x, double y) rate = ephysics_world_rate_get(body->world); ephysics_body_forces_apply(body); - body->rigid_body->applyCentralForce(btVector3(x / rate, y / rate, 0)); + body->rigid_body->applyCentralForce(btVector3(x / rate, - y / rate, 0)); _ephysics_body_forces_update(body); } @@ -1435,7 +1435,7 @@ ephysics_body_force_apply(EPhysics_Body *body, double x, double y, Evas_Coord po rate = ephysics_world_rate_get(body->world); ephysics_body_forces_apply(body); - body->rigid_body->applyForce(btVector3(x / rate, y / rate, 0), + body->rigid_body->applyForce(btVector3(x / rate, - y / rate, 0), btVector3((double) pos_x / rate, (double) pos_y / rate, 0)); _ephysics_body_forces_update(body); @@ -1473,7 +1473,7 @@ ephysics_body_forces_get(const EPhysics_Body *body, double *x, double *y, double ephysics_world_gravity_get(body->world, &gx, &gy); if (x) *x = body->force.x * rate + gx; - if (y) *y = body->force.y * rate + gy; + if (y) *y = -body->force.y * rate + gy; if (torque) *torque = -body->force.torque; } -- 2.7.4