From: Enlightenment S. <no-...@en...> - 2012-07-27 14:47:33
|
Log: EPhysics: fix mass getter Author: bdilly Date: 2012-07-27 07:47:23 -0700 (Fri, 27 Jul 2012) New Revision: 74494 Trac: http://trac.enlightenment.org/e/changeset/74494 Modified: trunk/ephysics/src/lib/ephysics_body.cpp Modified: trunk/ephysics/src/lib/ephysics_body.cpp =================================================================== --- trunk/ephysics/src/lib/ephysics_body.cpp 2012-07-27 14:02:34 UTC (rev 74493) +++ trunk/ephysics/src/lib/ephysics_body.cpp 2012-07-27 14:47:23 UTC (rev 74494) @@ -27,6 +27,7 @@ Evas_Object *evas_obj; EPhysics_World *world; Eina_Inlist *callbacks; + double mass; Eina_Bool active:1; }; @@ -82,6 +83,7 @@ body->collision_shape = collision_shape; body->rigid_body = rigid_body; + body->mass = mass; body->world = world; body->rigid_body->setUserPointer(body); body->rigid_body->setLinearFactor(btVector3(1, 1, 0)); @@ -558,6 +560,7 @@ body->collision_shape->calculateLocalInertia(mass, inertia); body->rigid_body->setMassProps(mass, inertia); body->rigid_body->updateInertiaTensor(); + body->mass = mass; DBG("Body %p mass changed to %lf.", body, mass); } @@ -571,7 +574,7 @@ return 0; } - return 1 / body->rigid_body->getInvMass(); + return body->mass; } EAPI void |