I'm using a static btBvhTriangleMeshShape as my ground/terrain and today attempted to add smarter collision callbacks to my game entities (boxes, spheres, cylinders, etc) and I found very quickly that the manifolds seem to be generated for the AABB of the btBvhTriangleMeshShape and not against the individual triangles! Basically anytime the dynamic shape entered the AABB of the level, a manifold would be in the dispatcher. Is this how it's supposed to work? How do I find out if the shape is actually contacting a triangle of the btBvhTriangleMeshShape?
I'm using a fairly vanilla setup:
m_collisionConfiguration = new btDefaultCollisionConfiguration();
m_dispatcher = new btCollisionDispatcher(m_collisionConfiguration);
m_broadphase = new btDbvtBroadphase();
sol = new btSequentialImpulseConstraintSolver;
groundMesh = new btTriangleMesh(true, false);
// ... triangles added to groundMesh ...
shape = new btBvhTriangleMeshShape(groundMesh, false, true);
btDefaultMotionState* myMotionState = new btDefaultMotionState(groundTransform);
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,shape,localInertia);
body = new btRigidBody(rbInfo);
The simulation itself works correctly. All dynamic objects respond correctly to the btBvhTriangleMeshShape, but it's the contact manifolds I'm having the issues with.
Any help is appreciated!
Thanks!
[Solved] Contact Manifold issue with btBvhTriangleMeshShape
-
- Posts: 12
- Joined: Wed Aug 24, 2011 6:16 am
[Solved] Contact Manifold issue with btBvhTriangleMeshShape
Last edited by rbgrn on Fri Aug 26, 2011 5:30 pm, edited 1 time in total.
-
- Posts: 12
- Joined: Wed Aug 24, 2011 6:16 am
Re: Contact Manifold issue with btBvhTriangleMeshShape
Solved:
http://www.bulletphysics.org/Bullet/php ... 257#p12684
I didn't realize that manifolds would be delivered with 0 points... Easy fix!
Now I have a new problem, though. As I slide a shape around on the convex triangle mesh, the gravity applied makes the Z value jitter just enough (.001) to cause frames where they are no longer touching and I'm not getting any collision points in the manifold. Is there something I can do to smooth this out, perhaps a small slop setting that assumes they are colliding if within that distance?
Thanks!
http://www.bulletphysics.org/Bullet/php ... 257#p12684
I didn't realize that manifolds would be delivered with 0 points... Easy fix!
Now I have a new problem, though. As I slide a shape around on the convex triangle mesh, the gravity applied makes the Z value jitter just enough (.001) to cause frames where they are no longer touching and I'm not getting any collision points in the manifold. Is there something I can do to smooth this out, perhaps a small slop setting that assumes they are colliding if within that distance?
Thanks!