1/ Is there any way to get/set the deepness of a AABB BVH computed ?
I've got complex environments containing "some" thousands, and all my intersection tests are going to be inside the AABB, so without a hierarchy bullet is going to test all the triangles
They are quite regularly disposed in the environment
with about 40 000 triangles (and even with 1 200 000) I tried this :
Code: Select all
m_indexVertexArrays = new btTriangleIndexVertexArray(totalTriangles,
this->gIndices,
indexStride,
totalVerts,(btScalar*) &this->gVertices[0].x(),vertStride);
bool useQuantizedAabbCompression = true;
trimeshShape = new btBvhTriangleMeshShape(m_indexVertexArrays,useQuantizedAabbCompression);
m_collisionShapes.push_back(trimeshShape);
btOptimizedBvh * myBVH = trimeshShape->getOptimizedBvh();
QuantizedNodeArray nodearray = myBVH->getLeafNodeArray();
cout << "nodearray size :" << nodearray.size() << endl;
3/ I'm doing rayTest on this, so with about 10 000 000 of rayTest on 12 000 triangles it takes me about 27 seconds, while my method take about 4 seconds.. so I think the rayTest is done on each triangle, is there some code I should look at ? or write it myself ?
Thanks,
Thomas