After hours and hours of debugging and profiling, I've found that what is causing the slow down in DevO torus demo is not GIMPACT 0.2, nor its tree algorithms, nor GJK.
There is something suspicious in your test demo:
Code: Select all
/// Create Torus Shape
{
m_indexVertexArrays = new btTriangleIndexVertexArray
(NUM_TRIANGLES,
&gIndices[0][0],
3*sizeof(int),
NUM_VERTICES,
(Real*) &gVertices[0],sizeof(Real)*3);
btGImpactMeshShape * trimesh = new btGImpactMeshShape(m_indexVertexArrays);
trimesh->setLocalScaling(btVector3(1.f,1.f,1.f));
trimesh->updateBound();
trimesh->setMargin(0.05f); ///?????
m_trimeshShape = trimesh;
}
At first you should alter all mesh parameters, like scaling or margin, and then you must call updateBound().
The function updateBound() builds and updates the bounding tree successfully, and it must be called every time when changing the mesh (F.E:Deformable meshes ).
However, I have good news !!
I'll release a new version of GIMPACT, version 0.3, which will comes with more optimizations, quantization, and convex descomposition (better for that torus chain). Also its code will be more readable (no templates).
Thanks DevO for your demo, its helps me improving GImpact and it gives me excelent tools for profiling its performance.
Thanks, and have a nice day.
Att : Francisco