summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-11-09 18:53:38 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-11-09 18:53:38 +0000
commit77f193677bb71aa87e83953b425065ea4b288095 (patch)
tree3874189cc1ce5f16af81eb4c7163360b3da4d685 /legacy
parent06bf7b0761e73d0410fb99100b600bb5cde4f92f (diff)
ephysics: fix evas object rotation based on body
Inverts y component. SVN revision: 79048
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ephysics/src/lib/ephysics_body.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/legacy/ephysics/src/lib/ephysics_body.cpp b/legacy/ephysics/src/lib/ephysics_body.cpp
index a032cf410f..bfe864820a 100644
--- a/legacy/ephysics/src/lib/ephysics_body.cpp
+++ b/legacy/ephysics/src/lib/ephysics_body.cpp
@@ -1244,7 +1244,7 @@ _ephysics_box_face_objs_update(EPhysics_Body *body)
1244static void 1244static void
1245_ephysics_body_evas_object_default_update(EPhysics_Body *body) 1245_ephysics_body_evas_object_default_update(EPhysics_Body *body)
1246{ 1246{
1247 int x, y, z, w, h, wx, wy, wh, cx, cy; 1247 int bx, by, x, y, z, w, h, wx, wy, wh, cx, cy;
1248 EPhysics_Camera *camera; 1248 EPhysics_Camera *camera;
1249 btTransform trans; 1249 btTransform trans;
1250 btQuaternion quat; 1250 btQuaternion quat;
@@ -1277,8 +1277,10 @@ _ephysics_body_evas_object_default_update(EPhysics_Body *body)
1277 1277
1278 evas_object_geometry_get(body->evas_obj, NULL, NULL, &w, &h); 1278 evas_object_geometry_get(body->evas_obj, NULL, NULL, &w, &h);
1279 rate = ephysics_world_rate_get(body->world); 1279 rate = ephysics_world_rate_get(body->world);
1280 x = (int) (trans.getOrigin().getX() * rate) - w * body->cm.x - cx; 1280 bx = (int) (trans.getOrigin().getX() * rate) - cx;
1281 y = wh + wy - (int) (trans.getOrigin().getY() * rate) - h * body->cm.y - cy; 1281 by = wh + wy - (int) (trans.getOrigin().getY() * rate) - cy;
1282 x = bx - w * body->cm.x;
1283 y = by - h * body->cm.y;
1282 z = (int) (trans.getOrigin().getZ() * rate); 1284 z = (int) (trans.getOrigin().getZ() * rate);
1283 1285
1284 evas_object_move(body->evas_obj, x, y); 1286 evas_object_move(body->evas_obj, x, y);
@@ -1301,8 +1303,9 @@ _ephysics_body_evas_object_default_update(EPhysics_Body *body)
1301 1303
1302 quat = trans.getRotation(); 1304 quat = trans.getRotation();
1303 quat.normalize(); 1305 quat.normalize();
1304 evas_map_util_quat_rotate(map, quat.x(), quat.y(), quat.z(), -quat.w(), 1306 evas_map_util_quat_rotate(map, quat.x(), -quat.y(), quat.z(), -quat.w(),
1305 x + (w * body->cm.x), y + (h * body->cm.y), z); 1307 bx, by, z);
1308
1306 _ephysics_body_evas_obj_map_apply(body, map, body->evas_obj, 1309 _ephysics_body_evas_obj_map_apply(body, map, body->evas_obj,
1307 body->back_face_culling, EINA_TRUE); 1310 body->back_face_culling, EINA_TRUE);
1308} 1311}