Project

General

Profile

SO3Engine
OgreNewt::Raycast Class Referenceabstract

general raycast More...

#include <OgreNewt_RayCast.h>

Inheritance diagram for OgreNewt::Raycast:
OgreNewt::BasicRaycast

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::Bodym_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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Raycast()

OgreNewt::Raycast::Raycast ( )

constructor

Definition at line 12 of file OgreNewt_RayCast.cpp.

◆ ~Raycast()

OgreNewt::Raycast::~Raycast ( )
virtual

destuctor.

Definition at line 13 of file OgreNewt_RayCast.cpp.

Member Function Documentation

◆ go()

void OgreNewt::Raycast::go ( const OgreNewt::World world,
const Ogre::Vector3 &  startpt,
const Ogre::Vector3 &  endpt 
)

performs the raycast.

call after creating the object.

Parameters
worldpointer to the OgreNewt::World
startptstarting point of ray in global space
endptending point of ray in global space

Definition at line 16 of file OgreNewt_RayCast.cpp.

◆ userCallback()

virtual bool OgreNewt::Raycast::userCallback ( OgreNewt::Body body,
Ogre::Real  distance,
const Ogre::Vector3 &  normal,
dLong  collisionID 
)
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.

◆ userPreFilterCallback()

virtual bool OgreNewt::Raycast::userPreFilterCallback ( OgreNewt::Body body)
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.

Friends And Related Symbol Documentation

◆ CollisionPrimitives::TreeCollision::newtonRayCastCallback

dFloat CollisionPrimitives::TreeCollision::newtonRayCastCallback ( const NewtonBody *const  body,
const NewtonCollision *const  treeCollision,
dFloat  distance,
dFloat *  normal,
int  faceId,
void *  userData 
)
friend

Member Data Documentation

◆ m_treecollisioncallback_bodyalreadyadded

bool OgreNewt::Raycast::m_treecollisioncallback_bodyalreadyadded
protected

save if this body was already added by RayCastCallback from TreeCollision

Definition at line 74 of file OgreNewt_RayCast.h.

◆ m_treecollisioncallback_lastbody

OgreNewt::Body* OgreNewt::Raycast::m_treecollisioncallback_lastbody
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.


The documentation for this class was generated from the following files: