I am new to bullet. I am trying to use btDvt for intersecting ray with a dense mesh . Mesh is deformable , its shape changes with time , that's why I chose btDbvt as it was mentioned in documentation that it can easily update nodes.
Code: Select all
btDbvt *dynamic_aabb = new btDbvt();
FaceData *data = new FaceData[ numTriangles ];
for( int tt = 0; tt < numTriangles; tt++ )
{
btVector3 pt[ 3 ];
....
//populate pt
....
btDbvtVolume volume;
volume.FromPoints( pt , 3 );
data[ cc ].faceId = tt;
dynamic_aabb->insert( volume , ( void * )( &data[ tt ] ) );
}
The problem is , when I run this code , it takes very long time to enter even 5000 triangles ( 15 to 20 seconds ) . Can anyone please guide me , how to use this data structure , or is it even suitable for my purpose?...
Regards
Avanindra