Project

General

Profile

SO3Engine
OgreNewt::BasicConvexcast Class Reference

Basic implementation of the convexcast. More...

#include <OgreNewt_ConvexCast.h>

Inheritance diagram for OgreNewt::BasicConvexcast:
OgreNewt::Convexcast

Classes

class  ConvexcastContactInfo
 simple class that represents a single convexcast contact More...
 

Public Member Functions

 BasicConvexcast ()
 empty constructor
 
 BasicConvexcast (const OgreNewt::World *world, const OgreNewt::ConvexCollisionPtr &col, const Ogre::Vector3 &startpt, const Ogre::Quaternion &colori, const Ogre::Vector3 &endpt, int maxcontactscount, int threadIndex, OgreNewt::Body *ignoreBody=NULL)
 constructor
 
 ~BasicConvexcast ()
 destuctor.
 
bool userPreFilterCallback (OgreNewt::Body *body)
 prefilter filter, ignores body set in constructor or always returns true if it's not set
 
void setIgnoreBody (OgreNewt::Body *body)
 sets body to ignore in filter
 
OgreNewt::BodygetIgnoreBody ()
 return body ignored in filter
 
int calculateBodyHitCount () const
 how many bodies did we hit? if maxcontactscount is to small, this value will be smaller too!
 
int getContactsCount () const
 how many contacts do we have
 
ConvexcastContactInfo getInfoAt (int hitnum) const
 retrieve the raycast info for a specific hit.
 
Ogre::Real getDistanceToFirstHit () const
 retrieve the distance to the first contact (in range [0,1] from startpt to endpt)
 
- Public Member Functions inherited from OgreNewt::Convexcast
 Convexcast ()
 constructor
 
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.
 

Protected Attributes

OgreNewt::BodymIgnoreBody
 Body to ignore in filter.
 
- Protected Attributes inherited from OgreNewt::Convexcast
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)
 
Ogre::Real mFirstContactDistance
 distance in [0,1] to first contact
 

Detailed Description

Basic implementation of the convexcast.

This class is provided for general convexcast use. it returns information about the body hit by the convexcast

Definition at line 84 of file OgreNewt_ConvexCast.h.

Constructor & Destructor Documentation

◆ BasicConvexcast() [1/2]

OgreNewt::BasicConvexcast::BasicConvexcast ( )

empty constructor

Definition at line 102 of file OgreNewt_ConvexCast.cpp.

◆ BasicConvexcast() [2/2]

OgreNewt::BasicConvexcast::BasicConvexcast ( const OgreNewt::World world,
const OgreNewt::ConvexCollisionPtr col,
const Ogre::Vector3 &  startpt,
const Ogre::Quaternion &  colori,
const Ogre::Vector3 &  endpt,
int  maxcontactscount,
int  threadIndex,
OgreNewt::Body ignoreBody = NULL 
)

constructor

performs a raycast, then the results can be queried from the object after creation.

Parameters
worldpointer to the OgreNewt::World
colpointer to a convex collision shape used for the cast
startptstarting point of ray in global space
coloriorientation of the collision in global space
endptending point of ray in global space
maxcontactscountmaximum number of contacts that should be saved
threadIndexThread index
ignoreBodyBody to ignore in filter, use if you're casting from inside other body and need to ignore it

Definition at line 106 of file OgreNewt_ConvexCast.cpp.

◆ ~BasicConvexcast()

OgreNewt::BasicConvexcast::~BasicConvexcast ( )

destuctor.

Definition at line 113 of file OgreNewt_ConvexCast.cpp.

Member Function Documentation

◆ calculateBodyHitCount()

int OgreNewt::BasicConvexcast::calculateBodyHitCount ( ) const

how many bodies did we hit? if maxcontactscount is to small, this value will be smaller too!

Definition at line 127 of file OgreNewt_ConvexCast.cpp.

◆ getContactsCount()

int OgreNewt::BasicConvexcast::getContactsCount ( ) const

how many contacts do we have

Definition at line 145 of file OgreNewt_ConvexCast.cpp.

◆ getDistanceToFirstHit()

Ogre::Real OgreNewt::BasicConvexcast::getDistanceToFirstHit ( ) const

retrieve the distance to the first contact (in range [0,1] from startpt to endpt)

Definition at line 173 of file OgreNewt_ConvexCast.cpp.

◆ getIgnoreBody()

OgreNewt::Body * OgreNewt::BasicConvexcast::getIgnoreBody ( )
inline

return body ignored in filter

Definition at line 131 of file OgreNewt_ConvexCast.h.

◆ getInfoAt()

BasicConvexcast::ConvexcastContactInfo OgreNewt::BasicConvexcast::getInfoAt ( int  hitnum) const

retrieve the raycast info for a specific hit.

Definition at line 150 of file OgreNewt_ConvexCast.cpp.

◆ setIgnoreBody()

void OgreNewt::BasicConvexcast::setIgnoreBody ( OgreNewt::Body body)
inline

sets body to ignore in filter

Definition at line 128 of file OgreNewt_ConvexCast.h.

◆ userPreFilterCallback()

bool OgreNewt::BasicConvexcast::userPreFilterCallback ( OgreNewt::Body body)
virtual

prefilter filter, ignores body set in constructor or always returns true if it's not set

Reimplemented from OgreNewt::Convexcast.

Definition at line 115 of file OgreNewt_ConvexCast.cpp.

Member Data Documentation

◆ mIgnoreBody

OgreNewt::Body* OgreNewt::BasicConvexcast::mIgnoreBody
protected

Body to ignore in filter.

Definition at line 150 of file OgreNewt_ConvexCast.h.


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