make btHashMap data protected (not private) for easier serialization

move btTriangleInfoMap.h into its own header, into the BulletCollision/CollisionShapes folder
add btTriangleInfoMap pointer to btBvhTriangleMeshShape, so we don't need to use the 'userpointer' anymore
preparation for serialization of btTriangleInfoMap.

See also http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=4603&start=30
This commit is contained in:
erwin.coumans
2010-02-23 09:52:39 +00:00
parent 2a2c82b7ce
commit 621eddb769
10 changed files with 171 additions and 73 deletions

View File

@@ -315,10 +315,10 @@ struct btConnectivityProcessor : public btTriangleCallback
void btGenerateInternalEdgeInfo (btBvhTriangleMeshShape*trimeshShape, btTriangleInfoMap* triangleInfoMap)
{
//the user pointer shouldn't already be used for other purposes, we intend to store connectivity info there!
if (trimeshShape->getUserPointer())
if (trimeshShape->getTriangleInfoMap())
return;
trimeshShape->setUserPointer(triangleInfoMap);
trimeshShape->setTriangleInfoMap(triangleInfoMap);
btStridingMeshInterface* meshInterface = trimeshShape->getMeshInterface();
const btVector3& meshScaling = meshInterface->getScaling();
@@ -456,7 +456,8 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObject*
if (colObj0->getCollisionShape()->getShapeType() != TRIANGLE_SHAPE_PROXYTYPE)
return;
btTriangleInfoMap* triangleInfoMapPtr = (btTriangleInfoMap*) colObj0->getRootCollisionShape()->getUserPointer();
btBvhTriangleMeshShape* trimesh = (btBvhTriangleMeshShape*)colObj0->getRootCollisionShape();
btTriangleInfoMap* triangleInfoMapPtr = (btTriangleInfoMap*) trimesh->getTriangleInfoMap();
if (!triangleInfoMapPtr)
return;