14 mReturnInfoList(NULL),
15 mReturnInfoListLength(0),
16 mReturnInfoListSize(0)
42 mReturnInfoList =
new NewtonWorldConvexCastReturnInfo[maxcontactscount];
70 unsigned _CDECL Convexcast::newtonConvexcastPreFilter(
const NewtonBody *body,
const NewtonCollision *collision,
void* userData)
75 Body* bod = (
Body*)NewtonBodyGetUserData( body );
110 go( world, col, startpt, colori, endpt, maxcontactscount, threadIndex);
133 for( j = 0; j < i; j++ )
~BasicConvexcast()
destuctor.
int getContactsCount() const
how many contacts do we have
bool userPreFilterCallback(OgreNewt::Body *body)
prefilter filter, ignores body set in constructor or always returns true if it's not set
ConvexcastContactInfo getInfoAt(int hitnum) const
retrieve the raycast info for a specific hit.
int calculateBodyHitCount() const
how many bodies did we hit? if maxcontactscount is to small, this value will be smaller too!
Ogre::Real getDistanceToFirstHit() const
retrieve the distance to the first contact (in range [0,1] from startpt to endpt)
OgreNewt::Body * mIgnoreBody
Body to ignore in filter.
BasicConvexcast()
empty constructor
main class for all Rigid Bodies in the system.
OgreNewt::World *const getWorld() const
get a pointer to the OgreNewt::World this body belongs to.
NewtonCollision *const getNewtonCollision() const
retrieve the Newton pointer
represents a collision shape that is explicitly convex.
Ogre::Real mFirstContactDistance
distance in [0,1] to first contact
virtual ~Convexcast()
destuctor.
void go(const OgreNewt::World *world, const OgreNewt::ConvexCollisionPtr &col, const Ogre::Vector3 &startpt, const Ogre::Quaternion &colori, const Ogre::Vector3 &endpt, int maxcontactscount, int threadIndex)
performs the convexcast.
virtual bool userPreFilterCallback(OgreNewt::Body *body)
user callback pre-filter function.
NewtonWorldConvexCastReturnInfo * mReturnInfoList
list that stores the results of the convex-cast
int mReturnInfoListLength
the real length of the list
int mReturnInfoListSize
the actual maximum length of the list (number of elements memory has been reserved for)
bool isRaycastRecording()
returns true, if currently recording raycasts
bool isRaycastRecordingHitBodies()
returns true, if hit bodies are currently recording
void addHitBody(const OgreNewt::Body *body)
this function is used internally
void addDiscardedBody(const OgreNewt::Body *body)
this function is used internally
void addConvexRay(const OgreNewt::ConvexCollisionPtr &col, const Ogre::Vector3 &startpt, const Ogre::Quaternion &colori, const Ogre::Vector3 &endpt)
this function is used internally
represents a physics world.
Debugger & getDebugger() const
get the debugger for this world
NewtonWorld * getNewtonWorld() const
retrieves a pointer to the NewtonWorld
_OgreNewtExport void QuatPosToMatrix(const Ogre::Quaternion &quat, const Ogre::Vector3 &pos, dFloat *matrix)
Take a Quaternion and Position Matrix and create a Newton-happy float matrix!