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
Choosing the best CollisionShape for objects
Re: Choosing the best CollisionShape for objects
I can tell you that, yes, you do need to register the GImpact collision Algorithm to get GImpactShapes to work.
I can also tell you that yes, you can use dynamic bodies with GImpactMeshShape.
There is a performance penalty using GImpactMeshShape.. and a slight stability impact (simulation stability, conservation of energy, etc).
I suggest you use GImpactMeshShape only in places where the shape cannot be approximated by other means.
I can also tell you that yes, you can use dynamic bodies with GImpactMeshShape.
There is a performance penalty using GImpactMeshShape.. and a slight stability impact (simulation stability, conservation of energy, etc).
I suggest you use GImpactMeshShape only in places where the shape cannot be approximated by other means.
Re: Choosing the best CollisionShape for objects
Ok, I've chosen btConvexHullShape and it approximates the meshes.
thanx !
thanx !