SO3Engine
|
OgreNewt_RayCast.cpp
Go to the documentation of this file.
16 void Raycast::go(const OgreNewt::World* world, const Ogre::Vector3& startpt, const Ogre::Vector3& endpt )
26 NewtonWorldRayCast( world->getNewtonWorld(), (float*)&startpt, (float*)&endpt, OgreNewt::Raycast::newtonRaycastFilter, this, OgreNewt::Raycast::newtonRaycastPreFilter, 0);
32 float Raycast::newtonRaycastFilter(const NewtonBody* body, const NewtonCollision* const shapeHit, const dFloat* const hitContact, const dFloat* hitNormal, dLong collisionID, void* userData, dFloat intersectParam)
46 if( world->getDebugger().isRaycastRecording() && world->getDebugger().isRaycastRecordingHitBodies() )
59 unsigned Raycast::newtonRaycastPreFilter(const NewtonBody *body, const NewtonCollision *collision, void* userData)
76 if( world->getDebugger().isRaycastRecording() && world->getDebugger().isRaycastRecordingHitBodies() )
101 BasicRaycast::BasicRaycast(const OgreNewt::World* world, const Ogre::Vector3& startpt, const Ogre::Vector3& endpt, bool sorted)
108 void BasicRaycast::go(const OgreNewt::World* world, const Ogre::Vector3& startpt, const Ogre::Vector3& endpt, bool sorted)
162 bool BasicRaycast::userCallback( OgreNewt::Body* body, Ogre::Real distance, const Ogre::Vector3& normal, dLong collisionID )
simple class that represents a single raycast rigid body intersection.
Definition OgreNewt_RayCast.h:97
Ogre::Real mDistance
dist from point1 of the raycast, in range [0,1].
Definition OgreNewt_RayCast.h:108
~BasicRaycastInfo()
Definition OgreNewt_RayCast.cpp:95
dLong mCollisionID
collision ID of the primitive hit by the ray (for compound collision bodies)
Definition OgreNewt_RayCast.h:110
BasicRaycastInfo()
Definition OgreNewt_RayCast.cpp:88
bool userCallback(Body *body, Ogre::Real distance, const Ogre::Vector3 &normal, dLong collisionID)
the all-important custom callback function.
Definition OgreNewt_RayCast.cpp:162
BasicRaycastInfo getInfoAt(unsigned int hitnum) const
retrieve the raycast info for a specific hit.
Definition OgreNewt_RayCast.cpp:148
BasicRaycastInfo getFirstHit() const
get the closest body hit by the ray.
Definition OgreNewt_RayCast.cpp:126
void go(const OgreNewt::World *world, const Ogre::Vector3 &startpt, const Ogre::Vector3 &endpt, bool sorted)
perform a raycast
Definition OgreNewt_RayCast.cpp:108
OgreNewt::World *const getWorld() const
get a pointer to the OgreNewt::World this body belongs to.
Definition OgreNewt_Body.h:136
bool isRaycastRecording()
returns true, if currently recording raycasts
Definition OgreNewt_Debugger.cpp:324
bool isRaycastRecordingHitBodies()
returns true, if hit bodies are currently recording
Definition OgreNewt_Debugger.cpp:329
void addHitBody(const OgreNewt::Body *body)
this function is used internally
Definition OgreNewt_Debugger.cpp:474
void addDiscardedBody(const OgreNewt::Body *body)
this function is used internally
Definition OgreNewt_Debugger.cpp:446
void addRay(const Ogre::Vector3 &startpt, const Ogre::Vector3 &endpt)
this function is used internally
Definition OgreNewt_Debugger.cpp:367
bool m_treecollisioncallback_bodyalreadyadded
save if this body was already added by RayCastCallback from TreeCollision
Definition OgreNewt_RayCast.h:74
OgreNewt::Body * m_treecollisioncallback_lastbody
save the last OgreNewt::Body from the newtonRaycastPreFilter to use this for example the TreeCollisio...
Definition OgreNewt_RayCast.h:71
virtual bool userCallback(OgreNewt::Body *body, Ogre::Real distance, const Ogre::Vector3 &normal, dLong collisionID)=0
user callback filter function
void go(const OgreNewt::World *world, const Ogre::Vector3 &startpt, const Ogre::Vector3 &endpt)
performs the raycast.
Definition OgreNewt_RayCast.cpp:16
NewtonWorld * getNewtonWorld() const
retrieves a pointer to the NewtonWorld
Definition OgreNewt_World.h:284
Generated by 1.9.8