SO3Engine
|
Basic implementation of the raycast. More...
#include <OgreNewt_RayCast.h>
Classes | |
class | BasicRaycastInfo |
simple class that represents a single raycast rigid body intersection. More... | |
Public Member Functions | |
BasicRaycast () | |
empty constructor | |
BasicRaycast (const OgreNewt::World *world, const Ogre::Vector3 &startpt, const Ogre::Vector3 &endpt, bool sorted) | |
constructor | |
void | go (const OgreNewt::World *world, const Ogre::Vector3 &startpt, const Ogre::Vector3 &endpt, bool sorted) |
perform a raycast | |
~BasicRaycast () | |
destuctor. | |
bool | userCallback (Body *body, Ogre::Real distance, const Ogre::Vector3 &normal, dLong collisionID) |
the all-important custom callback function. | |
int | getHitCount () const |
how many bodies did we hit? | |
BasicRaycastInfo | getInfoAt (unsigned int hitnum) const |
retrieve the raycast info for a specific hit. | |
BasicRaycastInfo | getFirstHit () const |
get the closest body hit by the ray. | |
Public Member Functions inherited from OgreNewt::Raycast | |
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. | |
Additional Inherited Members | |
Protected Attributes inherited from OgreNewt::Raycast | |
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 | |
Basic implementation of the raycast.
This class is provided for general raycast use. it returns information about all bodies hit by the ray.
Definition at line 92 of file OgreNewt_RayCast.h.
OgreNewt::BasicRaycast::BasicRaycast | ( | ) |
empty constructor
Definition at line 98 of file OgreNewt_RayCast.cpp.
OgreNewt::BasicRaycast::BasicRaycast | ( | const OgreNewt::World * | world, |
const Ogre::Vector3 & | startpt, | ||
const Ogre::Vector3 & | endpt, | ||
bool | sorted | ||
) |
constructor
performs a raycast, then the results can be queried from the object after creation.
world | pointer to the OgreNewt::World |
startpt | starting point of the ray in global space |
endpt | ending point of the ray in global space |
sorted | sort the results by distance |
Definition at line 101 of file OgreNewt_RayCast.cpp.
OgreNewt::BasicRaycast::~BasicRaycast | ( | ) |
destuctor.
Definition at line 120 of file OgreNewt_RayCast.cpp.
BasicRaycast::BasicRaycastInfo OgreNewt::BasicRaycast::getFirstHit | ( | ) | const |
get the closest body hit by the ray.
Definition at line 126 of file OgreNewt_RayCast.cpp.
int OgreNewt::BasicRaycast::getHitCount | ( | ) | const |
how many bodies did we hit?
Definition at line 123 of file OgreNewt_RayCast.cpp.
BasicRaycast::BasicRaycastInfo OgreNewt::BasicRaycast::getInfoAt | ( | unsigned int | hitnum | ) | const |
retrieve the raycast info for a specific hit.
Definition at line 148 of file OgreNewt_RayCast.cpp.
void OgreNewt::BasicRaycast::go | ( | const OgreNewt::World * | world, |
const Ogre::Vector3 & | startpt, | ||
const Ogre::Vector3 & | endpt, | ||
bool | sorted | ||
) |
perform a raycast
performs a raycast, then the results can be queried from the object after creation.
world | pointer to the OgreNewt::World |
startpt | starting point of the ray in global space |
endpt | ending point of the ray in global space |
sorted | sort the results by distance |
Definition at line 108 of file OgreNewt_RayCast.cpp.
|
virtual |
the all-important custom callback function.
Implements OgreNewt::Raycast.
Definition at line 162 of file OgreNewt_RayCast.cpp.