SO3Engine
|
general raycast More...
#include <OgreNewt_RayCast.h>
Public Member Functions | |
Raycast () | |
constructor | |
virtual | ~Raycast () |
destuctor. | |
void | go (const OgreNewt::World *world, const Ogre::Vector3 &startpt, const Ogre::Vector3 &endpt) |
performs the raycast. | |
virtual bool | userPreFilterCallback (OgreNewt::Body *body) |
user callback pre-filter function. | |
virtual bool | userCallback (OgreNewt::Body *body, Ogre::Real distance, const Ogre::Vector3 &normal, dLong collisionID)=0 |
user callback filter function | |
Protected Attributes | |
OgreNewt::Body * | m_treecollisioncallback_lastbody |
save the last OgreNewt::Body from the newtonRaycastPreFilter to use this for example the TreeCollisionRayCallback | |
bool | m_treecollisioncallback_bodyalreadyadded |
save if this body was already added by RayCastCallback from TreeCollision | |
Friends | |
dFloat | CollisionPrimitives::TreeCollision::newtonRayCastCallback (const NewtonBody *const body, const NewtonCollision *const treeCollision, dFloat distance, dFloat *normal, int faceId, void *userData) |
general raycast
General class representing a raycast query in the Newton world. this class should be inherited to create specific raycast behavior.
Definition at line 29 of file OgreNewt_RayCast.h.
OgreNewt::Raycast::Raycast | ( | ) |
constructor
Definition at line 12 of file OgreNewt_RayCast.cpp.
|
virtual |
destuctor.
Definition at line 13 of file OgreNewt_RayCast.cpp.
void OgreNewt::Raycast::go | ( | const OgreNewt::World * | world, |
const Ogre::Vector3 & | startpt, | ||
const Ogre::Vector3 & | endpt | ||
) |
performs the raycast.
call after creating the object.
world | pointer to the OgreNewt::World |
startpt | starting point of ray in global space |
endpt | ending point of ray in global space |
Definition at line 16 of file OgreNewt_RayCast.cpp.
|
pure virtual |
user callback filter function
user callback function.
This function must be implemented by the user. Newton calls this function for each body intersected by the ray. however it doesn't necessarily go perfect cloest-to-farthest order. return true and the callback will only be called for bodies closer to the start point than the current body. return false and the callback will call for any other bodies, even those farther than the current one.
Implemented in OgreNewt::BasicRaycast.
|
inlinevirtual |
user callback pre-filter function.
This function is an optional pre-filter to completely ignore specific bodies during the raycast. return false from this function to ignore this body, return true (default) to accept it.
Definition at line 54 of file OgreNewt_RayCast.h.
|
friend |
|
protected |
save if this body was already added by RayCastCallback from TreeCollision
Definition at line 74 of file OgreNewt_RayCast.h.
|
protected |
save the last OgreNewt::Body from the newtonRaycastPreFilter to use this for example the TreeCollisionRayCallback
Definition at line 71 of file OgreNewt_RayCast.h.