Using btDbvt for dense mesh Ray intersection

avanindra
Posts: 2
Joined: Sun Jul 28, 2013 10:46 am

Using btDbvt for dense mesh Ray intersection

Post by avanindra »

Hi ,

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
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Using btDbvt for dense mesh Ray intersection

Post by Dirk Gregorius »

This sounds weird to me. Are you running in release?
avanindra
Posts: 2
Joined: Sun Jul 28, 2013 10:46 am

Re: Using btDbvt for dense mesh Ray intersection

Post by avanindra »

Yes I am using release mode build. I am using gnu c++ compiler on ubuntu.