[Opal-commits] opal/src/ODE ODEJoint.cpp,1.31,1.32 ODESimulator.cpp,1.106,1.107 ODESolid.cpp,1.91,1.
Status: Inactive
Brought to you by:
tylerstreeter
|
From: Olex <ole...@us...> - 2005-11-19 18:09:09
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24953/src/ODE Modified Files: ODEJoint.cpp ODESimulator.cpp ODESolid.cpp Log Message: Fixed some warnings in ODE implementation and tinyxml. Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** ODESimulator.cpp 6 Aug 2005 05:58:24 -0000 1.106 --- ODESimulator.cpp 19 Nov 2005 18:09:01 -0000 1.107 *************** *** 471,481 **** e.thisSolid = solid0; e.otherSolid = solid1; ! e.pos[0] = contactArray[0].pos[0]; ! e.pos[1] = contactArray[0].pos[1]; ! e.pos[2] = contactArray[0].pos[2]; ! e.normal[0] = contactArray[0].normal[0]; ! e.normal[1] = contactArray[0].normal[1]; ! e.normal[2] = contactArray[0].normal[2]; ! e.depth = contactArray[0].depth; if (handler0) --- 471,481 ---- e.thisSolid = solid0; e.otherSolid = solid1; ! e.pos[0] = (real)contactArray[0].pos[0]; ! e.pos[1] = (real)contactArray[0].pos[1]; ! e.pos[2] = (real)contactArray[0].pos[2]; ! e.normal[0] = (real)contactArray[0].normal[0]; ! e.normal[1] = (real)contactArray[0].normal[1]; ! e.normal[2] = (real)contactArray[0].normal[2]; ! e.depth = (real)contactArray[0].depth; if (handler0) *************** *** 926,944 **** // other is the ray. ! Point3r intersection(contactArray[0].pos[0], ! contactArray[0].pos[1], contactArray[0].pos[2]); ! Vec3r normal(contactArray[0].normal[0], ! contactArray[0].normal[1], ! contactArray[0].normal[2]); if(geomData0) { sim->internal_setRaycastResult(geomData0->solid, ! intersection, normal, contactArray[0].depth); } else { sim->internal_setRaycastResult(geomData1->solid, ! intersection, normal, contactArray[0].depth); } } --- 926,945 ---- // other is the ray. ! Point3r intersection((real)contactArray[0].pos[0], ! (real)contactArray[0].pos[1], ! (real)contactArray[0].pos[2]); ! Vec3r normal((real)contactArray[0].normal[0], ! (real)contactArray[0].normal[1], ! (real)contactArray[0].normal[2]); if(geomData0) { sim->internal_setRaycastResult(geomData0->solid, ! intersection, normal, (real)contactArray[0].depth); } else { sim->internal_setRaycastResult(geomData1->solid, ! intersection, normal, (real)contactArray[0].depth); } } *************** *** 1084,1088 **** dVector3 g; dWorldGetGravity(mWorldID, g); ! Vec3r gravity(g[0], g[1], g[2]); return gravity; } --- 1085,1089 ---- dVector3 g; dWorldGetGravity(mWorldID, g); ! Vec3r gravity((real)g[0], (real)g[1], (real)g[2]); return gravity; } Index: ODESolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.cpp,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** ODESolid.cpp 6 Nov 2005 03:20:01 -0000 1.91 --- ODESolid.cpp 19 Nov 2005 18:09:01 -0000 1.92 *************** *** 28,31 **** --- 28,32 ---- #include "ODESolid.h" #include "ODESpace.h" + #include "ODETools.h" #include "../BoxShapeData.h" #include "../SphereShapeData.h" *************** *** 714,718 **** dVector3 localVel; dBodyVectorFromWorld(mBodyID, vel[0], vel[1], vel[2], localVel); ! return Vec3r(localVel[0], localVel[1], localVel[2]); } else --- 715,719 ---- dVector3 localVel; dBodyVectorFromWorld(mBodyID, vel[0], vel[1], vel[2], localVel); ! return toVec3r( localVel ); } else *************** *** 733,737 **** dBodyVectorFromWorld(mBodyID, result[0], result[1], result[2], result); ! return Vec3r(result[0], result[1], result[2]); } else --- 734,738 ---- dBodyVectorFromWorld(mBodyID, result[0], result[1], result[2], result); ! return toVec3r( result ); } else *************** *** 747,752 **** dVector3 worldVel; dBodyVectorToWorld(mBodyID, vel[0], vel[1], vel[2], worldVel); ! Vec3r velRad(degToRad(worldVel[0]), degToRad(worldVel[1]), ! degToRad(worldVel[2])); dBodySetAngularVel(mBodyID, velRad[0], velRad[1], velRad[2]); --- 748,752 ---- dVector3 worldVel; dBodyVectorToWorld(mBodyID, vel[0], vel[1], vel[2], worldVel); ! Vec3r velRad = toVec3r_DegToRad( worldVel ); dBodySetAngularVel(mBodyID, velRad[0], velRad[1], velRad[2]); *************** *** 765,770 **** dVector3 localVel; dBodyVectorFromWorld(mBodyID, vel[0], vel[1], vel[2], localVel); ! return Vec3r(radToDeg(localVel[0]), radToDeg(localVel[1]), ! radToDeg(localVel[2])); } else --- 765,769 ---- dVector3 localVel; dBodyVectorFromWorld(mBodyID, vel[0], vel[1], vel[2], localVel); ! return toVec3r_RadToDeg( localVel ); } else *************** *** 790,794 **** { const dReal* vel = dBodyGetLinearVel(mBodyID); ! return Vec3r(vel[0], vel[1], vel[2]); } else --- 789,793 ---- { const dReal* vel = dBodyGetLinearVel(mBodyID); ! return toVec3r( vel ); } else *************** *** 805,809 **** dVector3 result; dBodyGetRelPointVel(mBodyID, p[0], p[1], p[2], result); ! return Vec3r(result[0], result[1], result[2]); } else --- 804,808 ---- dVector3 result; dBodyGetRelPointVel(mBodyID, p[0], p[1], p[2], result); ! return toVec3r( result ); } else *************** *** 830,834 **** { const dReal* vel = dBodyGetAngularVel(mBodyID); ! return Vec3r(radToDeg(vel[0]), radToDeg(vel[1]), radToDeg(vel[2])); } else --- 829,833 ---- { const dReal* vel = dBodyGetAngularVel(mBodyID); ! return toVec3r_RadToDeg( vel ); } else *************** *** 934,940 **** 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); --- 933,939 ---- dBodyGetMass(mBodyID, &mass); m.set( ! (real)mass.I[0], (real)mass.I[1], (real)mass.I[2], 0, ! (real)mass.I[4], (real)mass.I[5], (real)mass.I[6], 0, ! (real)mass.I[8], (real)mass.I[9], (real)mass.I[10], 0, 0, 0, 0, 1); *************** *** 1121,1126 **** bool ODESolid::isInertiaNonSymmetric(const dMass& mass)const { ! if (!areEqual(mass.I[0], mass.I[5]) ! || !areEqual(mass.I[5], mass.I[10])) { return true; --- 1120,1125 ---- bool ODESolid::isInertiaNonSymmetric(const dMass& mass)const { ! if (!areEqual((real)mass.I[0], (real)mass.I[5]) ! || !areEqual((real)mass.I[5], (real)mass.I[10])) { return true; Index: ODEJoint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODEJoint.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ODEJoint.cpp 27 Aug 2005 18:09:19 -0000 1.31 --- ODEJoint.cpp 19 Nov 2005 18:09:01 -0000 1.32 *************** *** 27,30 **** --- 27,31 ---- #include "ODEJoint.h" + //#include "ODETools.h" namespace opal *************** *** 498,502 **** // All data in this JointAxis is valid except for the direction // vector. ! axis.direction.set(direction[0], direction[1], direction[2]); return axis; --- 499,505 ---- // All data in this JointAxis is valid except for the direction // vector. ! axis.direction.set((real)direction[0], ! (real)direction[1], ! (real)direction[2]); return axis; *************** *** 533,537 **** } ! return Point3r(anchor[0], anchor[1], anchor[2]); } --- 536,540 ---- } ! return Point3r((real)anchor[0], (real)anchor[1], (real)anchor[2]); } *************** *** 961,968 **** { dJointFeedback* jf = dJointGetFeedback(mJointID); ! Vec3r f1(jf->f1[0], jf->f1[1], jf->f1[2]); ! Vec3r t1(jf->t1[0], jf->t1[1], jf->t1[2]); ! Vec3r f2(jf->f2[0], jf->f2[1], jf->f2[2]); ! Vec3r t2(jf->t2[0], jf->t2[1], jf->t2[2]); f1 -= f2; --- 964,971 ---- { dJointFeedback* jf = dJointGetFeedback(mJointID); ! Vec3r f1((real)jf->f1[0], (real)jf->f1[1], (real)jf->f1[2]); ! Vec3r t1((real)jf->t1[0], (real)jf->t1[1], (real)jf->t1[2]); ! Vec3r f2((real)jf->f2[0], (real)jf->f2[1], (real)jf->f2[2]); ! Vec3r t2((real)jf->t2[0], (real)jf->t2[1], (real)jf->t2[2]); f1 -= f2; |