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

void btCollisionWorld::rayTest ( const btVector3 &  rayFromWorld,
const btVector3 &  rayToWorld,
RayResultCallback resultCallback 
) const [inherited]

rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.

use the broadphase to accelerate the search for objects, based on their aabb and for each object with ray-aabb overlap, perform an exact ray test

Definition at line 698 of file btCollisionWorld.cpp.

References btBroadphaseInterface::rayTest().

{
      BT_PROFILE("rayTest");
      /// use the broadphase to accelerate the search for objects, based on their aabb
      /// and for each object with ray-aabb overlap, perform an exact ray test
      btSingleRayCallback rayCB(rayFromWorld,rayToWorld,this,resultCallback);

#ifndef USE_BRUTEFORCE_RAYBROADPHASE
      m_broadphasePairCache->rayTest(rayFromWorld,rayToWorld,rayCB);
#else
      for (int i=0;i<this->getNumCollisionObjects();i++)
      {
            rayCB.process(m_collisionObjects[i]->getBroadphaseHandle());
      }     
#endif //USE_BRUTEFORCE_RAYBROADPHASE

}


Generated by  Doxygen 1.6.0   Back to index