SO3Engine
|
TreeCollision created by parsing a tree of SceneNodes, adding collision data of all meshes. More...
#include <OgreNewt_CollisionPrimitives.h>
Public Member Functions | |
TreeCollisionSceneParser (OgreNewt::World *world) | |
~TreeCollisionSceneParser () | |
void | parseScene (Ogre::SceneNode *startNode, int id, bool optimize=true, FaceWinding fw=FW_DEFAULT) |
parse the scene. | |
![]() | |
TreeCollision (const World *world) | |
constructor | |
TreeCollision (const World *world, Ogre::Entity *ent, bool optimize, int id, FaceWinding fw=FW_DEFAULT, const Ogre::Vector3 &scale=Ogre::Vector3::UNIT_SCALE) | |
constructor | |
TreeCollision (const World *world, const Ogre::SceneNode *node, bool optimize, int id, FaceWinding fw=FW_DEFAULT, const Ogre::Vector3 &scale=Ogre::Vector3::UNIT_SCALE) | |
void | AddEntities (const Ogre::SceneNode *node, const Ogre::SceneNode *mainNode, const Ogre::Vector3 scale, FaceWinding fw=FW_DEFAULT) |
TreeCollision (const World *world, int numVertices, int numIndices, const float *vertices, const int *indices, bool optimize, int id, FaceWinding fw=FW_DEFAULT) | |
constructor | |
TreeCollision (const World *world, int numVertices, Ogre::Vector3 *vertices, Ogre::IndexData *indexData, bool optimize, int id, FaceWinding fw=FW_DEFAULT) | |
constructor | |
~TreeCollision () | |
destructor | |
void | start (int id) |
start a tree collision creation | |
void | addPoly (Ogre::Vector3 *polys, unsigned int ID) |
add a poly to the tree collision | |
void | finish (bool optimize) |
finish the tree collision | |
void | setRayCastCallbackactive (bool active=true) |
set RayCastCallback active/disabled | |
![]() | |
Collision (const World *world) | |
constructor | |
Collision (const Collision &shape) | |
constructor | |
Collision (const NewtonCollision *collision, const World *world) | |
constructor | |
virtual | ~Collision () |
destructor | |
NewtonCollision *const | getNewtonCollision () const |
retrieve the Newton pointer | |
const World * | getWorld () const |
Ogre::AxisAlignedBox | getAABB (const Ogre::Quaternion &orient=Ogre::Quaternion::IDENTITY, const Ogre::Vector3 &pos=Ogre::Vector3::ZERO) const |
CollisionPrimitiveType | getCollisionPrimitiveType () const |
Returns the Collisiontype for this Collision. | |
NewtonCollisionInfoRecord * | getInfo () |
Returns collision info record for this collision. | |
Protected Member Functions | |
virtual bool | entityFilter (const Ogre::SceneNode *currentNode, const Ogre::Entity *currentEntity, FaceWinding &fw) |
this is a user-inherited function that lets you filter which Entities will be added to the treeCollision. | |
virtual unsigned int | getID (const Ogre::SceneNode *currentNode, const Ogre::Entity *currentEntity, unsigned int currentSubMesh) |
user inherit-able function, allows customization of the ID to be assigned to this group of polygons. | |
Additional Inherited Members | |
![]() | |
static dFloat _CDECL | newtonRayCastCallback (const NewtonBody *const body, const NewtonCollision *const treeCollision, dFloat distance, dFloat *normal, int faceId, void *userData) |
used internally | |
![]() | |
static CollisionPrimitiveType | getCollisionPrimitiveType (const NewtonCollision *col) |
Returns the Collisiontype for the given Newton-Collision. | |
static NewtonCollisionInfoRecord * | getInfo (const NewtonCollision *col) |
Returns collision info record for given collision. | |
![]() | |
NewtonCollision * | m_col |
const World * | m_world |
TreeCollision created by parsing a tree of SceneNodes, adding collision data of all meshes.
Users can inherit this class, and inherit the "getID" function to perform their own filtering on the IDs to pass to Newton. IDs are useful during collision callbacks to determine which part of the world is being hit.
By default, the ID is set to an incrementing integer.
Definition at line 397 of file OgreNewt_CollisionPrimitives.h.
OgreNewt::CollisionPrimitives::TreeCollisionSceneParser::TreeCollisionSceneParser | ( | OgreNewt::World * | world | ) |
Definition at line 974 of file OgreNewt_CollisionPrimitives.cpp.
|
inline |
Definition at line 402 of file OgreNewt_CollisionPrimitives.h.
|
inlineprotectedvirtual |
this is a user-inherited function that lets you filter which Entities will be added to the treeCollision.
return true to add this entity, return false to ignore it. You can also change the face winding on an entity-by-entity basis by changing the fw variable from within the filter.
Definition at line 414 of file OgreNewt_CollisionPrimitives.h.
|
inlineprotectedvirtual |
user inherit-able function, allows customization of the ID to be assigned to this group of polygons.
Definition at line 417 of file OgreNewt_CollisionPrimitives.h.
void OgreNewt::CollisionPrimitives::TreeCollisionSceneParser::parseScene | ( | Ogre::SceneNode * | startNode, |
int | id, | ||
bool | optimize = true , |
||
FaceWinding | fw = FW_DEFAULT |
||
) |
parse the scene.
Definition at line 978 of file OgreNewt_CollisionPrimitives.cpp.