[Opal-commits] opal/src/ODE ODESolid.cpp,1.75,1.76 ODESolid.h,1.64,1.65
Status: Inactive
Brought to you by:
tylerstreeter
|
From: Andres R. <ar...@us...> - 2005-03-10 21:11:19
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3414/src/ODE Modified Files: ODESolid.cpp ODESolid.h Log Message: added clearShapes function to solid Index: ODESolid.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.h,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** ODESolid.h 4 Mar 2005 23:26:54 -0000 1.64 --- ODESolid.h 10 Mar 2005 21:11:05 -0000 1.65 *************** *** 85,88 **** --- 85,90 ---- virtual void OPAL_CALL setStatic(bool s); + virtual void OPAL_CALL clearShapes(); + virtual void OPAL_CALL addShape(const ShapeData& data); Index: ODESolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.cpp,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** ODESolid.cpp 5 Mar 2005 21:26:24 -0000 1.75 --- ODESolid.cpp 10 Mar 2005 21:11:05 -0000 1.76 *************** *** 68,102 **** } void ODESolid::destroyGeoms() { ! while (!mGeomDataList.empty()) { ! // Note: do not delete the Solid pointer. It will get deleted ! // elsewhere. ! ! if (0 != mGeomDataList.back()->transformID) { ! // This geom uses a transform geom. Destroy it. ! dGeomDestroy(mGeomDataList.back()->transformID); } ! #ifdef OPAL_USE_MESH ! if (0 != mGeomDataList.back()->trimeshDataID) { // This geom uses a trimesh. Destroy it. (This does NOT // touch the user's mesh data, just internal ODE trimesh // data.) ! dGeomTriMeshDataDestroy(mGeomDataList.back()->trimeshDataID); } #endif - // Destroy the ODE geom. ! dGeomDestroy(mGeomDataList.back()->geomID); // Delete the geom data object. ! delete mGeomDataList.back(); mGeomDataList.pop_back(); } } --- 68,103 ---- } + void ODESolid::clearShapes() + { + destroyGeoms(); + } + void ODESolid::destroyGeoms() { ! for( size_t i = 0; i<mGeomDataList.size(); ++i ) { ! if( 0 != mGeomDataList[i]->transformID ) { ! dGeomDestroy(mGeomDataList[i]->transformID); } ! #ifdef OPAL_USE_MESH ! if (0 != mGeomDataList[i]->trimeshDataID) { // This geom uses a trimesh. Destroy it. (This does NOT // touch the user's mesh data, just internal ODE trimesh // data.) ! dGeomTriMeshDataDestroy(mGeomDataList[i]->trimeshDataID); } #endif // Destroy the ODE geom. ! dGeomDestroy(mGeomDataList[i]->geomID); // Delete the geom data object. ! delete mGeomDataList[i]; mGeomDataList.pop_back(); } + mGeomDataList.clear(); } |