Logo Search packages:      
Sourcecode: blender version File versions

void btBoxBoxCollisionAlgorithm::processCollision ( btCollisionObject *  body0,
btCollisionObject *  body1,
const btDispatcherInfo &  dispatchInfo,
btManifoldResult resultOut 
) [virtual]

report a contact. internally this will be kept persistent, and contact reduction is done

Implements btCollisionAlgorithm.

Definition at line 45 of file btBoxBoxCollisionAlgorithm.cpp.

References btBoxBoxDetector::getClosestPoints(), btManifoldResult::refreshContactPoints(), and btManifoldResult::setPersistentManifold().

{
      if (!m_manifoldPtr)
            return;

      btCollisionObject*      col0 = body0;
      btCollisionObject*      col1 = body1;
      btBoxShape* box0 = (btBoxShape*)col0->getCollisionShape();
      btBoxShape* box1 = (btBoxShape*)col1->getCollisionShape();



      /// report a contact. internally this will be kept persistent, and contact reduction is done
      resultOut->setPersistentManifold(m_manifoldPtr);
#ifndef USE_PERSISTENT_CONTACTS     
      m_manifoldPtr->clearManifold();
#endif //USE_PERSISTENT_CONTACTS

      btDiscreteCollisionDetectorInterface::ClosestPointInput input;
      input.m_maximumDistanceSquared = 1e30f;
      input.m_transformA = body0->getWorldTransform();
      input.m_transformB = body1->getWorldTransform();

      btBoxBoxDetector detector(box0,box1);
      detector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw);

#ifdef USE_PERSISTENT_CONTACTS
      //  refreshContactPoints is only necessary when using persistent contact points. otherwise all points are newly added
      if (m_ownManifold)
      {
            resultOut->refreshContactPoints();
      }
#endif //USE_PERSISTENT_CONTACTS

}


Generated by  Doxygen 1.6.0   Back to index