Choosing the best CollisionShape for objects
Posted: Thu Oct 15, 2009 7:56 am
Hello,
General questions about CollisionShapes..
I want to generate CollisionShapes from Ogre Meshes (or Entities), and I'd like to handle this in the most generic way : what i'd like to avoid is to select "manually" in code the bullet CollisionShape that fits the Ogre mesh (a btSphereShape for a spherical mesh, a btBoxShape for a cube mesh, and so on...)
Actually, I use parts of code from OgreBullet wrapper to generate triangle lists from Ogre mesh, but I wonder which bullet CollisionShape is more suited to my needs.
From what I understood from Bullet :
btBvhTriangleMeshShape allows for nearly any kind of shape (even concave ones) but only for static objects;
btGImpactMeshShape allows for nearly any kind of shape (even concave ones), but one needs to register a coliision algorithm for using Gimpact.
I also guess that performance for convex/convex collision is better than for concave/concave collision.
the point is : if I know that the Ogre mesh is convex, should I use btConvexHullShape or btConvexTriangleMeshShape ?
is there any need to register collision algorithms as for btGImpactMeshShape ? Do those classes allow creation of dynamic bodies or only static ones ?
Thanks in advance
Nigul
General questions about CollisionShapes..
I want to generate CollisionShapes from Ogre Meshes (or Entities), and I'd like to handle this in the most generic way : what i'd like to avoid is to select "manually" in code the bullet CollisionShape that fits the Ogre mesh (a btSphereShape for a spherical mesh, a btBoxShape for a cube mesh, and so on...)
Actually, I use parts of code from OgreBullet wrapper to generate triangle lists from Ogre mesh, but I wonder which bullet CollisionShape is more suited to my needs.
From what I understood from Bullet :
btBvhTriangleMeshShape allows for nearly any kind of shape (even concave ones) but only for static objects;
btGImpactMeshShape allows for nearly any kind of shape (even concave ones), but one needs to register a coliision algorithm for using Gimpact.
I also guess that performance for convex/convex collision is better than for concave/concave collision.
the point is : if I know that the Ogre mesh is convex, should I use btConvexHullShape or btConvexTriangleMeshShape ?
is there any need to register collision algorithms as for btGImpactMeshShape ? Do those classes allow creation of dynamic bodies or only static ones ?
Thanks in advance
Nigul