[Opal-commits] opal/src/ODE ODESimulator.cpp,1.78,1.79 ODESimulator.h,1.54,1.55 ODESolid.cpp,1.69,1.
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-02-23 06:35:55
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19126/src/ODE Modified Files: ODESimulator.cpp ODESimulator.h ODESolid.cpp Log Message: minor fixes Index: ODESimulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.h,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** ODESimulator.h 22 Feb 2005 01:25:56 -0000 1.54 --- ODESimulator.h 23 Feb 2005 06:35:46 -0000 1.55 *************** *** 79,88 **** //convenience ray casting function ! virtual void OPAL_CALL shootRay(const Point3r& origin, ! const Vec3r& dir, real length, RayHit& rayHit); virtual void OPAL_CALL setGravity(const Vec3r& gravity); ! virtual void OPAL_CALL getGravity(Vec3r& gravity)const; virtual void OPAL_CALL setSleepiness(real value); --- 79,88 ---- //convenience ray casting function ! virtual RayHit OPAL_CALL shootRay(const Point3r& origin, ! const Vec3r& dir, real length); virtual void OPAL_CALL setGravity(const Vec3r& gravity); ! virtual Vec3r OPAL_CALL getGravity()const; virtual void OPAL_CALL setSleepiness(real value); Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** ODESimulator.cpp 22 Feb 2005 01:25:56 -0000 1.78 --- ODESimulator.cpp 23 Feb 2005 06:35:46 -0000 1.79 *************** *** 738,743 **** } ! void ODESimulator::shootRay(const Point3r& origin, const Vec3r& dir, ! real length, RayHit& rayHit) { mRayHit.solid = NULL; --- 738,743 ---- } ! RayHit ODESimulator::shootRay(const Point3r& origin, const Vec3r& dir, ! real length) { mRayHit.solid = NULL; *************** *** 754,757 **** --- 754,758 ---- &ode_hidden::internal_rayCastingCollisionCallback); + RayHit rayHit; rayHit.solid = mRayHit.solid; //note that this may remain NULL rayHit.intersection = mRayHit.intersection; *************** *** 761,764 **** --- 762,767 ---- // finished with ray, so destroy it dGeomDestroy(rayGeomID); + + return rayHit; } *************** *** 768,775 **** } ! void ODESimulator::getGravity(Vec3r& gravity)const { ! dReal vec[3] = {gravity[0], gravity[1], gravity[2]}; ! dWorldGetGravity(mWorldID, vec); } --- 771,780 ---- } ! Vec3r ODESimulator::getGravity()const { ! dVector3 g; ! dWorldGetGravity(mWorldID, g); ! Vec3r gravity(g[0], g[1], g[2]); ! return gravity; } Index: ODESolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** ODESolid.cpp 23 Feb 2005 04:56:49 -0000 1.69 --- ODESolid.cpp 23 Feb 2005 06:35:46 -0000 1.70 *************** *** 103,111 **** { // Destroy the old Shapes. ! while (!mData.shapes.empty()) ! { ! delete mData.shapes.back(); ! mData.shapes.pop_back(); ! } // Destroy the old ODE geoms. --- 103,107 ---- { // Destroy the old Shapes. ! mData.destroyShapes(); // Destroy the old ODE geoms. *************** *** 119,125 **** // Add the new Shapes. ! for (unsigned int i=0; i<data.shapes.size(); ++i) { ! addShape(*(data.shapes[i])); } --- 115,121 ---- // Add the new Shapes. ! for (int i=0; i<data.getNumShapes(); ++i) { ! addShape(*(data.getShapeData(i))); } *************** *** 425,429 **** dSpaceID spaceID = NULL; dMass newMass; - ShapeData* newShape = NULL; if(Matrix44r() == data.offset) --- 421,424 ---- *************** *** 460,464 **** (dReal)boxData.dimensions[1], (dReal)boxData.dimensions[2]); - newShape = new BoxShapeData(boxData); break; } --- 455,458 ---- *************** *** 470,474 **** dMassSetSphere(&newMass, (dReal)data.material.density, (dReal)sphereData.radius); - newShape = new SphereShapeData(sphereData); break; } --- 464,467 ---- *************** *** 486,490 **** dMassSetCappedCylinder(&newMass, (dReal)data.material.density, 3, (dReal)capsuleData.radius, (dReal)capsuleData.length); - newShape = new CapsuleShapeData(capsuleData); break; } --- 479,482 ---- *************** *** 519,523 **** // Solids with planes are the only "placeable" Solids. mIsPlaceable = false; - newShape = new PlaneShapeData(planeData); break; } --- 511,514 ---- *************** *** 533,537 **** (dReal)dir[2]); // Note: rays don't have mass. - newShape = new RayShapeData(rayData); break; } --- 524,527 ---- *************** *** 553,558 **** // or just enforce that all mesh must be static. dMassSetSphere(&newMass, (dReal)data.material.density, 1); - - newShape = new MeshShapeData(meshData); break; } --- 543,546 ---- *************** *** 565,573 **** // Store new Shape. ! mData.shapes.push_back(newShape); // Setup GeomData. newGeomData->solid = this; ! newGeomData->shape = newShape; newGeomData->geomID = newGeomID; newGeomData->transformID = newTransformID; --- 553,561 ---- // Store new Shape. ! mData.addShape(data); // Setup GeomData. newGeomData->solid = this; ! newGeomData->shape = mData.getShapeData(mData.getNumShapes() - 1); newGeomData->geomID = newGeomID; newGeomData->transformID = newTransformID; |