13#ifndef _INCLUDE_OGRENEWT_RAYCAST
14#define _INCLUDE_OGRENEWT_RAYCAST
46 void go(
const OgreNewt::World* world,
const Ogre::Vector3& startpt,
const Ogre::Vector3& endpt );
67 friend dFloat CollisionPrimitives::TreeCollision::newtonRayCastCallback(
const NewtonBody*
const body,
const NewtonCollision*
const treeCollision, dFloat distance, dFloat *normal,
int faceId,
void *userData);
79 static float newtonRaycastFilter(
const NewtonBody* body,
const NewtonCollision*
const shapeHit,
const dFloat*
const hitContact,
const dFloat* hitNormal, dLong collisionID,
void* userData, dFloat intersectParam);
82 static unsigned newtonRaycastPreFilter(
const NewtonBody* body,
const NewtonCollision* collision,
void* userData);
141 void go(
const OgreNewt::World* world,
const Ogre::Vector3& startpt,
const Ogre::Vector3& endpt,
bool sorted);
147 bool userCallback(
Body* body, Ogre::Real distance,
const Ogre::Vector3& normal, dLong collisionID );
153 int getHitCount()
const;
156 BasicRaycastInfo getInfoAt(
unsigned int hitnum )
const;
159 BasicRaycastInfo getFirstHit()
const;
165 typedef std::vector<BasicRaycastInfo> RaycastInfoList;
167 RaycastInfoList mRayList;
simple class that represents a single raycast rigid body intersection.
Ogre::Real mDistance
dist from point1 of the raycast, in range [0,1].
Ogre::Quaternion getNormalOrientation()
Ogre::Vector3 getNormal()
bool operator<(const BasicRaycastInfo &rhs) const
OgreNewt::Body * mBody
pointer to body intersected with
Ogre::Vector3 mNormal
normal of intersection.
OgreNewt::Body * getBody()
dLong mCollisionID
collision ID of the primitive hit by the ray (for compound collision bodies)
Basic implementation of the raycast.
main class for all Rigid Bodies in the system.
bool m_treecollisioncallback_bodyalreadyadded
save if this body was already added by RayCastCallback from TreeCollision
OgreNewt::Body * m_treecollisioncallback_lastbody
save the last OgreNewt::Body from the newtonRaycastPreFilter to use this for example the TreeCollisio...
virtual bool userCallback(OgreNewt::Body *body, Ogre::Real distance, const Ogre::Vector3 &normal, dLong collisionID)=0
user callback filter function
virtual bool userPreFilterCallback(OgreNewt::Body *body)
user callback pre-filter function.
represents a physics world.
_OgreNewtExport Ogre::Quaternion grammSchmidt(const Ogre::Vector3 &pin)