It appears that the world positions are not filled in when addContactPoint is called on a btManifoldResult.
I added the following lines to my btManifoldResult.cpp, just after the btManifoldPoint is constructed on line 72:
newPt.m_positionWorldOnA = pointA;
newPt.m_positionWorldOnB = pointInWorld;
Did I need to do this or is there a different place this is or should be filled in?
Thanks.
btManifoldResult contact point world positions not filled in
-
- Posts: 24
- Joined: Mon Mar 12, 2007 9:55 pm
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Bullet uses a persistent contact manifold, so the world positions of the contact points change over time. THerefore the world positions are re-calculated every frame, as new points come and invalid/old points get dropped.
For examples, see CollisionInterfaceDemo (if you only use Bullet's collision detection).
If you use both Bullet collision detection and dynamics, then it happens during constraint solver phase. See Bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
Code: Select all
contactManifold->refreshContactPoints(obA->getWorldTransform(),obB->getWorldTransform());
If you use both Bullet collision detection and dynamics, then it happens during constraint solver phase. See Bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
Code: Select all
void btSequentialImpulseConstraintSolver::prepareConstraints(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,btIDebugDraw* debugDrawer)
{
...
//only necessary to refresh the manifold once (first iteration). The integration is done outside the loop
{
manifoldPtr->refreshContactPoints(body0->getCenterOfMassTransform(),body1->getCenterOfMassTransform());
}
-
- Posts: 24
- Joined: Mon Mar 12, 2007 9:55 pm