[Opal-commits] opal/src/ODE ODEJoint.cpp,1.23,1.24 ODEJoint.h,1.27,1.28 ODESolid.cpp,1.67,1.68 ODESo
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-02-23 03:58:38
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10148/src/ODE Modified Files: ODEJoint.cpp ODEJoint.h ODESolid.cpp ODESolid.h Log Message: added MotorData and JointData classes Index: ODEJoint.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODEJoint.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ODEJoint.h 22 Feb 2005 01:25:56 -0000 1.27 --- ODEJoint.h 23 Feb 2005 03:58:23 -0000 1.28 *************** *** 47,51 **** /// data should be stored in JointData. However, there is /// currently no easy way to get this data. ! virtual void OPAL_CALL init(const JointData& jd); virtual real OPAL_CALL getState(int axisNum)const; --- 47,51 ---- /// data should be stored in JointData. However, there is /// currently no easy way to get this data. ! virtual void OPAL_CALL init(const JointData& data); virtual real OPAL_CALL getState(int axisNum)const; Index: ODESolid.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.h,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** ODESolid.h 22 Feb 2005 01:25:57 -0000 1.60 --- ODESolid.h 23 Feb 2005 03:58:23 -0000 1.61 *************** *** 77,81 **** virtual void OPAL_CALL setStatic(bool s); ! virtual void OPAL_CALL addShape(const ShapeData& sd); //virtual void OPAL_CALL addBox(const Vec3r& dimensions, --- 77,81 ---- virtual void OPAL_CALL setStatic(bool s); ! virtual void OPAL_CALL addShape(const ShapeData& data); //virtual void OPAL_CALL addBox(const Vec3r& dimensions, Index: ODESolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** ODESolid.cpp 22 Feb 2005 19:46:40 -0000 1.67 --- ODESolid.cpp 23 Feb 2005 03:58:23 -0000 1.68 *************** *** 372,376 **** } ! void ODESolid::addShape(const ShapeData& sd) { dGeomID newGeomID = NULL; --- 372,376 ---- } ! void ODESolid::addShape(const ShapeData& data) { dGeomID newGeomID = NULL; *************** *** 381,385 **** ShapeData* newShape = NULL; ! if(Matrix44r() == sd.offset) { // No offset transform. --- 381,385 ---- ShapeData* newShape = NULL; ! if(Matrix44r() == data.offset) { // No offset transform. *************** *** 401,414 **** GeomData* newGeomData = new GeomData; ! switch(sd.getType()) { case BOX_SHAPE: { ! BoxShapeData& boxData = (BoxShapeData&)sd; newGeomID = dCreateBox(spaceID, (dReal)boxData.dimensions[0], (dReal)boxData.dimensions[1], (dReal)boxData.dimensions[2]); ! dMassSetBox(&newMass, (dReal)sd.material.density, (dReal)boxData.dimensions[0], (dReal)boxData.dimensions[1], --- 401,414 ---- GeomData* newGeomData = new GeomData; ! switch(data.getType()) { case BOX_SHAPE: { ! BoxShapeData& boxData = (BoxShapeData&)data; newGeomID = dCreateBox(spaceID, (dReal)boxData.dimensions[0], (dReal)boxData.dimensions[1], (dReal)boxData.dimensions[2]); ! dMassSetBox(&newMass, (dReal)data.material.density, (dReal)boxData.dimensions[0], (dReal)boxData.dimensions[1], *************** *** 419,426 **** case SPHERE_SHAPE: { ! SphereShapeData& sphereData = (SphereShapeData&)sd; newGeomID = dCreateSphere(spaceID, (dReal)sphereData.radius); ! dMassSetSphere(&newMass, (dReal)sd.material.density, (dReal)sphereData.radius); newShape = new SphereShapeData(sphereData); --- 419,426 ---- case SPHERE_SHAPE: { ! SphereShapeData& sphereData = (SphereShapeData&)data; newGeomID = dCreateSphere(spaceID, (dReal)sphereData.radius); ! dMassSetSphere(&newMass, (dReal)data.material.density, (dReal)sphereData.radius); newShape = new SphereShapeData(sphereData); *************** *** 429,433 **** case CAPSULE_SHAPE: { ! CapsuleShapeData& capsuleData = (CapsuleShapeData&)sd; newGeomID = dCreateCCylinder(spaceID, (dReal)capsuleData.radius, (dReal)capsuleData.length); --- 429,433 ---- case CAPSULE_SHAPE: { ! CapsuleShapeData& capsuleData = (CapsuleShapeData&)data; newGeomID = dCreateCCylinder(spaceID, (dReal)capsuleData.radius, (dReal)capsuleData.length); *************** *** 438,442 **** //Maybe have a default value in the Simulator that the user can //change. ! dMassSetCappedCylinder(&newMass, (dReal)sd.material.density, 3, (dReal)capsuleData.radius, (dReal)capsuleData.length); newShape = new CapsuleShapeData(capsuleData); --- 438,442 ---- //Maybe have a default value in the Simulator that the user can //change. ! dMassSetCappedCylinder(&newMass, (dReal)data.material.density, 3, (dReal)capsuleData.radius, (dReal)capsuleData.length); newShape = new CapsuleShapeData(capsuleData); *************** *** 445,449 **** case PLANE_SHAPE: { ! PlaneShapeData& planeData = (PlaneShapeData&)sd; if (!mData.isStatic) { --- 445,449 ---- case PLANE_SHAPE: { ! PlaneShapeData& planeData = (PlaneShapeData&)data; if (!mData.isStatic) { *************** *** 478,482 **** case RAY_SHAPE: { ! RayShapeData& rayData = (RayShapeData&)sd; newGeomID = dCreateRay(spaceID, (dReal)rayData.ray.getLength()); --- 478,482 ---- case RAY_SHAPE: { ! RayShapeData& rayData = (RayShapeData&)data; newGeomID = dCreateRay(spaceID, (dReal)rayData.ray.getLength()); *************** *** 492,496 **** case MESH_SHAPE: { ! MeshShapeData& meshData = (MeshShapeData&)sd; // Setup trimesh data pointer. It is critical that the --- 492,496 ---- case MESH_SHAPE: { ! MeshShapeData& meshData = (MeshShapeData&)data; // Setup trimesh data pointer. It is critical that the *************** *** 506,510 **** // TODO: either do more sophisticated mass calculations, // or just enforce that all mesh must be static. ! dMassSetSphere(&newMass, (dReal)sd.material.density, 1); newShape = new MeshShapeData(meshData); --- 506,510 ---- // TODO: either do more sophisticated mass calculations, // or just enforce that all mesh must be static. ! dMassSetSphere(&newMass, (dReal)data.material.density, 1); newShape = new MeshShapeData(meshData); *************** *** 516,520 **** // This will do nothing if this is a static Solid. ! addMass(newMass, sd.offset); // Store new Shape. --- 516,520 ---- // This will do nothing if this is a static Solid. ! addMass(newMass, data.offset); // Store new Shape. Index: ODEJoint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODEJoint.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ODEJoint.cpp 22 Feb 2005 01:25:56 -0000 1.23 --- ODEJoint.cpp 23 Feb 2005 03:58:23 -0000 1.24 *************** *** 46,50 **** } ! void ODEJoint::init(const JointData& jd) { if (mInitCalled) --- 46,50 ---- } ! void ODEJoint::init(const JointData& data) { if (mInitCalled) *************** *** 62,69 **** } ! Joint::init(jd); mInitCalled = true; ! switch(jd.type) { case HINGE_JOINT: --- 62,69 ---- } ! Joint::init(data); mInitCalled = true; ! switch(data.getType()) { case HINGE_JOINT: *************** *** 173,179 **** // Note that this handles the cases when either both are being set // to NULL or both are the same Solid. ! if (jd.solid0 == jd.solid1 || ! (jd.solid0 && jd.solid0->isStatic()) || ! (jd.solid1 && jd.solid1->isStatic())) { Joint::setSolids(NULL, NULL); --- 173,179 ---- // Note that this handles the cases when either both are being set // to NULL or both are the same Solid. ! if (data.solid0 == data.solid1 || ! (data.solid0 && data.solid0->isStatic()) || ! (data.solid1 && data.solid1->isStatic())) { Joint::setSolids(NULL, NULL); *************** *** 182,186 **** else { ! Joint::setSolids(jd.solid0, jd.solid1); mData.enabled = true; } --- 182,186 ---- else { ! Joint::setSolids(data.solid0, data.solid1); mData.enabled = true; } *************** *** 190,199 **** // Setup the Joint's anchor. ! setAnchor(jd.anchor); // Setup the Joint's axes. ! setAxis(0, jd.axis[0]); ! setAxis(1, jd.axis[1]); ! setAxis(2, jd.axis[2]); } --- 190,199 ---- // Setup the Joint's anchor. ! setAnchor(data.anchor); // Setup the Joint's axes. ! setAxis(0, data.axis[0]); ! setAxis(1, data.axis[1]); ! setAxis(2, data.axis[2]); } *************** *** 204,208 **** real value = 0; ! switch(mData.type) { case HINGE_JOINT: --- 204,208 ---- real value = 0; ! switch(mData.getType()) { case HINGE_JOINT: *************** *** 257,261 **** real value = 0; ! switch(mData.type) { case HINGE_JOINT: --- 257,261 ---- real value = 0; ! switch(mData.getType()) { case HINGE_JOINT: *************** *** 343,347 **** // ODE's Hinge2 Joint also has a suspension parameter. Use axis 1 // for this since axis 1 doesn't use limits anyway. ! if (1 == axisNum && HINGE_2_JOINT == mData.type) { setJointParam(dParamSuspensionERP, value); --- 343,347 ---- // ODE's Hinge2 Joint also has a suspension parameter. Use axis 1 // for this since axis 1 doesn't use limits anyway. ! if (1 == axisNum && HINGE_2_JOINT == mData.getType()) { setJointParam(dParamSuspensionERP, value); *************** *** 448,452 **** // Set the ODE Joint axis direction vector. ! switch(mData.type) { case HINGE_JOINT: --- 448,452 ---- // Set the ODE Joint axis direction vector. ! switch(mData.getType()) { case HINGE_JOINT: *************** *** 529,533 **** (dReal)anchor[2]}; ! switch(mData.type) { case HINGE_JOINT: --- 529,533 ---- (dReal)anchor[2]}; ! switch(mData.getType()) { case HINGE_JOINT: *************** *** 726,730 **** void ODEJoint::setJointParam(int parameter, dReal value) { ! switch(mData.type) { case HINGE_JOINT: --- 726,730 ---- void ODEJoint::setJointParam(int parameter, dReal value) { ! switch(mData.getType()) { case HINGE_JOINT: *************** *** 845,849 **** // relationship between the Solids or between a Solid and the // static environment. ! if (FIXED_JOINT == mData.type) { dJointSetFixed(mJointID); --- 845,849 ---- // relationship between the Solids or between a Solid and the // static environment. ! if (FIXED_JOINT == mData.getType()) { dJointSetFixed(mJointID); |