summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-11-09 18:52:28 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-11-09 18:52:28 +0000
commitde06c6bc1867f3c52b214f517253c3123cf0c6a1 (patch)
tree457c74a57a63d2ef8b9620a0cb21abe6876cf6d9
parent560c3e6fa80d3bedde52d178b8f8e716391835bc (diff)
ephysics: fix body geometry initialization
Getting geometry from a recently created body was retuning zeros. SVN revision: 79039
-rw-r--r--legacy/ephysics/src/lib/ephysics_body.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/legacy/ephysics/src/lib/ephysics_body.cpp b/legacy/ephysics/src/lib/ephysics_body.cpp
index ba44cb8818..6f36cda951 100644
--- a/legacy/ephysics/src/lib/ephysics_body.cpp
+++ b/legacy/ephysics/src/lib/ephysics_body.cpp
@@ -618,6 +618,7 @@ static EPhysics_Body *
618_ephysics_body_new(EPhysics_World *world, btScalar mass, double cm_x, double cm_y, double cm_z) 618_ephysics_body_new(EPhysics_World *world, btScalar mass, double cm_x, double cm_y, double cm_z)
619{ 619{
620 EPhysics_Body *body; 620 EPhysics_Body *body;
621 double rate;
621 622
622 body = (EPhysics_Body *) calloc(1, sizeof(EPhysics_Body)); 623 body = (EPhysics_Body *) calloc(1, sizeof(EPhysics_Body));
623 if (!body) 624 if (!body)
@@ -626,7 +627,11 @@ _ephysics_body_new(EPhysics_World *world, btScalar mass, double cm_x, double cm_
626 return NULL; 627 return NULL;
627 } 628 }
628 629
630 rate = ephysics_world_rate_get(world);
629 body->scale = btVector3(1, 1, 1); 631 body->scale = btVector3(1, 1, 1);
632 body->size.w = rate;
633 body->size.h = rate;
634 body->size.d = rate;
630 body->mass = mass; 635 body->mass = mass;
631 body->world = world; 636 body->world = world;
632 body->cm.x = cm_x; 637 body->cm.x = cm_x;
@@ -898,6 +903,7 @@ _ephysics_body_resize(EPhysics_Body *body, Evas_Coord w, Evas_Coord h, Evas_Coor
898 body->size.w = w; 903 body->size.w = w;
899 body->size.h = h; 904 body->size.h = h;
900 body->size.d = d; 905 body->size.d = d;
906 body->scale = btVector3(sx, sy, sz);
901 907
902 ephysics_body_activate(body, EINA_TRUE); 908 ephysics_body_activate(body, EINA_TRUE);
903 909