I am trying to use a ghost object to determine whether or not I can move a dynamic rigid body to the chosen location without coming into contact with other dynamic rigid bodies. I have done the following:
Code: Select all
ghostObject = new btGhostObject();
ghostObject->setCollisionShape(boxShape);
ghostObject->setCollisionFlags(btCollisionObject::CF_NO_CONTACT_RESPONSE);
sDynamicsWorld->addCollisionObject(ghostObject,btBroadphaseProxy::SensorTrigger,btBroadphaseProxy::AllFilter & ~btBroadphaseProxy::SensorTrigger);
// set the new location
ghostObject->setWorldTransform(transform);
int num = ghostObject->getNumOverlappingObjects();
Also, I would like to use btPairCachingGhostObject for real object collision rather than AABBs. Do these only get calculated after stepSimulation? I'd like to move the ghost object and look for collisions without any physics steps. Is this possible?
Thanks