[Opal-commits] opal/src/ODE ODESolid.cpp,1.80,1.81 ODESolid.h,1.66,1.67
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-04-04 13:09:51
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1854/src/ODE Modified Files: ODESolid.cpp ODESolid.h Log Message: made the SpringMotor depend on the Solid's mass and inertia tensor; fixed bugs in SpringMotor; added to playpen sample app Index: ODESolid.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.h,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** ODESolid.h 23 Mar 2005 07:54:35 -0000 1.66 --- ODESolid.h 4 Apr 2005 13:09:11 -0000 1.67 *************** *** 121,128 **** //virtual void OPAL_CALL setFastRotationAxis(Vec3r axis); - /// Returns the Solid's mass. This will return 0 if the Solid - /// is static. virtual real OPAL_CALL getMass()const; virtual void OPAL_CALL internal_updateOPALTransform(); --- 121,128 ---- //virtual void OPAL_CALL setFastRotationAxis(Vec3r axis); virtual real OPAL_CALL getMass()const; + virtual Matrix44r OPAL_CALL getInertiaTensor()const; + virtual void OPAL_CALL internal_updateOPALTransform(); Index: ODESolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.cpp,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** ODESolid.cpp 3 Apr 2005 00:11:42 -0000 1.80 --- ODESolid.cpp 4 Apr 2005 13:09:10 -0000 1.81 *************** *** 840,843 **** --- 840,865 ---- } + Matrix44r ODESolid::getInertiaTensor()const + { + Matrix44r m; + + if (mData.isStatic) + { + return m; + } + else + { + dMass mass; + dBodyGetMass(mBodyID, &mass); + m.set( + mass.I[0], mass.I[1], mass.I[2], 0, + mass.I[4], mass.I[5], mass.I[6], 0, + mass.I[8], mass.I[9], mass.I[10], 0, + 0, 0, 0, 1); + + return m; + } + } + void ODESolid::setupNewGeom(GeomData* newGeom) { |