Logo Search packages:      
Sourcecode: blender version File versions  Download package

void btContinuousDynamicsWorld::calculateTimeOfImpacts ( btScalar  timeStep  )  [virtual]

these should be 'temporal' aabbs!

'toi' is the global smallest time of impact. However, we just calculate the time of impact for each object individually. so we handle the case moving versus static properly, and we cheat for moving versus moving

calculate time of impact for overlapping pairs

Definition at line 102 of file btContinuousDynamicsWorld.cpp.

References btDispatcher::dispatchAllCollisionPairs(), and btBroadphaseInterface::getOverlappingPairCache().

Referenced by internalSingleStepSimulation().

{
            ///these should be 'temporal' aabbs!
            updateTemporalAabbs(timeStep);
            
            ///'toi' is the global smallest time of impact. However, we just calculate the time of impact for each object individually.
            ///so we handle the case moving versus static properly, and we cheat for moving versus moving
            btScalar toi = 1.f;
            
      
            btDispatcherInfo& dispatchInfo = getDispatchInfo();
            dispatchInfo.m_timeStep = timeStep;
            dispatchInfo.m_timeOfImpact = 1.f;
            dispatchInfo.m_stepCount = 0;
            dispatchInfo.m_dispatchFunc = btDispatcherInfo::DISPATCH_CONTINUOUS;

            ///calculate time of impact for overlapping pairs


            btDispatcher* dispatcher = getDispatcher();
            if (dispatcher)
                  dispatcher->dispatchAllCollisionPairs(m_broadphasePairCache->getOverlappingPairCache(),dispatchInfo,m_dispatcher1);

            toi = dispatchInfo.m_timeOfImpact;

            dispatchInfo.m_dispatchFunc = btDispatcherInfo::DISPATCH_DISCRETE;

}


Generated by  Doxygen 1.6.0   Back to index