some questions, btTriangleMeshShape/btBvhTriangleMeshShape

vexator
Posts: 10
Joined: Thu Nov 01, 2007 11:12 am

some questions, btTriangleMeshShape/btBvhTriangleMeshShape

Post by vexator »

- my game world is setup with an octree, each node containing static geometry. in ode i could create a separate space for every octree node to speed up simulation. is there a simular way in bullet? so far i just add each mesh to the world itself.

- i use btTriangleMesh/btTriangleMeshShape to create meshes from static world geometry. is there a more efficient way?

- what are those btBvh* classes? couldn't find any information on that in the manual/api.

- what's the best way to perform collision tests for very fast moving bodies, like pistol bullets? should i cast a ray to check intersections with the world? or are there special classes/settings to handle this?

thanks! great library btw :D
noisy
Posts: 10
Joined: Thu May 24, 2007 7:57 pm

Re: some questions

Post by noisy »

vexator wrote:- my game world is setup with an octree, each node containing static geometry. in ode i could create a separate space for every octree node to speed up simulation. is there a simular way in bullet? so far i just add each mesh to the world itself.
I was wondering about this too, when I switched to bullet. But the bullet broadphase (axis sweep) seems to be more efficient when adding this all into one world than the ODE seperate spaces model.
vexator wrote: - i use btTriangleMesh/btTriangleMeshShape to create meshes from static world geometry. is there a more efficient way?
- what are those btBvh* classes? couldn't find any information on that in the manual/api.
the btBvhTriangleMeshShape classes is the optimized version of btTriangleMeshShape (look at the UserCollisionAlgorithm demo for its usage)
vexator wrote: - what's the best way to perform collision tests for very fast moving bodies, like pistol bullets? should i cast a ray to check intersections with the world? or are there special classes/settings to handle this?
The raycast is as i know the best solution.

Cheers,
noisy
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: some questions, btTriangleMeshShape/btBvhTriangleMeshShape

Post by Erwin Coumans »

vexator wrote:- my game world is setup with an octree, each node containing static geometry. in ode i could create a separate space for every octree node to speed up simulation. is there a simular way in bullet? so far i just add each mesh to the world itself.

- i use btTriangleMesh/btTriangleMeshShape to create meshes from static world geometry. is there a more efficient way?
Please use btBvhTriangleMeshShape. You can probably add all triangles in a btBvhTriangleMeshShape. You should not use btTriangleMeshShape, it is totally un-optimized. It is more testing/comparison code, I should make that more clear. Same for btSimpleBroadphase and btSimpleDynamicsWorld, they are test/comparisons to validate the recommende btAxis3Sweep and btDiscreteDynamicsWorld.
- what are those btBvh* classes? couldn't find any information on that in the manual/api.
btBvhTriangleMeshShape is a triangle mesh with bounding volume hierarchy optimizations. This works even better then an octree. It is best to store more triangle in the btBvhTriangleMeshShape, rather then adding lots of very small btBvhTriangleMeshShapes into the broadphase.
- what's the best way to perform collision tests for very fast moving bodies, like pistol bullets? should i cast a ray to check intersections with the world? or are there special classes/settings to handle this?
You can use a raycast, see btCollisionWorld::rayTest. Another option is to use an object sweep, see btCollisionWorld::objectQuerySingle, but there are some loose ends that needs to be implemented.

Hope this helps,
Erwin
vexator
Posts: 10
Joined: Thu Nov 01, 2007 11:12 am

Re: some questions, btTriangleMeshShape/btBvhTriangleMeshShape

Post by vexator »

ok thanks, i'll do that!

btw: it'd be nice if world and rigidbody had default constructors, so that one could easily derive from them. atm you have to provide a lot of information that just might not be available at the time of creation.
vexator
Posts: 10
Joined: Thu Nov 01, 2007 11:12 am

Re: some questions, btTriangleMeshShape/btBvhTriangleMeshShape

Post by vexator »

oh and another question: should i add my static geometry as separate btBvhTriangleMeshShape's or one single btBvhTriangleMeshShape containing all?