I'm looking into the serialization code. I see this code in the samples:
Code: Select all
if (import.loadFile("myShape.bullet"))
{
int numBvh = import.getNumBvhs();
if (numBvh)
{
btOptimizedBvh* bvh = import.getBvhByIndex(0);
btVector3 aabbMin(-1000,-1000,-1000),aabbMax(1000,1000,1000);
trimeshShape = new btBvhTriangleMeshShape(m_indexVertexArrays,useQuantizedAabbCompression,aabbMin,aabbMax,false);
trimeshShape->setOptimizedBvh(bvh);
//trimeshShape = new btBvhTriangleMeshShape(m_indexVertexArrays,useQuantizedAabbCompression,aabbMin,aabbMax);
//trimeshShape->setOptimizedBvh(bvh);
}
int numShape = import.getNumCollisionShapes();
if (numShape)
{
trimeshShape = (btBvhTriangleMeshShape*)import.getCollisionShapeByIndex(0);
//if you know the name, you can also try to get the shape by name:
const char* meshName = import.getNameForPointer(trimeshShape);
if (meshName)
trimeshShape = (btBvhTriangleMeshShape*)import.getCollisionShapeByName(meshName);
}
}
Why is it doing that? I'm guessing that I should only use one method, but really I have no idea. Is there any documentation for this?