SO3Engine
|
TreeCollision - complex polygonal collision. More...
#include <OgreNewt_CollisionPrimitives.h>
Public Member Functions | |
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 | |
Public Member Functions inherited from OgreNewt::Collision | |
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. | |
Static Public Member Functions | |
static dFloat _CDECL | newtonRayCastCallback (const NewtonBody *const body, const NewtonCollision *const treeCollision, dFloat distance, dFloat *normal, int faceId, void *userData) |
used internally | |
Static Public Member Functions inherited from OgreNewt::Collision | |
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. | |
Additional Inherited Members | |
Protected Attributes inherited from OgreNewt::Collision | |
NewtonCollision * | m_col |
const World * | m_world |
Detailed Description
TreeCollision - complex polygonal collision.
TreeCollision objects are general polygon collision objects. TreeCollision objects have a requirement that their mass must = 0 (aka are have infinite mass)
Definition at line 304 of file OgreNewt_CollisionPrimitives.h.
Constructor & Destructor Documentation
◆ TreeCollision() [1/5]
OgreNewt::CollisionPrimitives::TreeCollision::TreeCollision | ( | const World * | world | ) |
constructor
Create a 'blank' tree collision object. Can be used for manual TreeCollision creation, or to be used with TreeCollisionSerializer::importTreeCollision
- Parameters
-
world pointer to the OgreNewt::World
Definition at line 463 of file OgreNewt_CollisionPrimitives.cpp.
◆ TreeCollision() [2/5]
OgreNewt::CollisionPrimitives::TreeCollision::TreeCollision | ( | const World * | world, |
Ogre::Entity * | ent, | ||
bool | optimize, | ||
int | id, | ||
FaceWinding | fw = FW_DEFAULT , |
||
const Ogre::Vector3 & | scale = Ogre::Vector3::UNIT_SCALE |
||
) |
constructor
Create a tree collision object.
- Parameters
-
world pointer to the OgreNewt::World ent pointer to an Ogre::Entitiy, if it is attached to a node, the scale of the parent node is used optimize bool whether you want to optimize the collision or not. id an id for this shape, can be received with collision->getUserId()
Definition at line 468 of file OgreNewt_CollisionPrimitives.cpp.
◆ TreeCollision() [3/5]
OgreNewt::CollisionPrimitives::TreeCollision::TreeCollision | ( | const World * | world, |
const Ogre::SceneNode * | node, | ||
bool | optimize, | ||
int | id, | ||
FaceWinding | fw = FW_DEFAULT , |
||
const Ogre::Vector3 & | scale = Ogre::Vector3::UNIT_SCALE |
||
) |
Definition at line 636 of file OgreNewt_CollisionPrimitives.cpp.
◆ TreeCollision() [4/5]
OgreNewt::CollisionPrimitives::TreeCollision::TreeCollision | ( | const World * | world, |
int | numVertices, | ||
int | numIndices, | ||
const float * | vertices, | ||
const int * | indices, | ||
bool | optimize, | ||
int | id, | ||
FaceWinding | fw = FW_DEFAULT |
||
) |
constructor
build a TreeCollision from vertice and index information. This can be used with the dotScene scene manager for building TreeCollision objects from each mesh in the scene.
- Parameters
-
world pointer to OgreNewt::World numVertices number of vertices passed in the array. numIndices number of indices passed in the array. vertices pointer to array of vertices (positions only). indices pointer to array of indices. optimize bool whether you want to optimize the collision or not. id an id for this shape, can be received with collision->getUserId()
Definition at line 643 of file OgreNewt_CollisionPrimitives.cpp.
◆ TreeCollision() [5/5]
OgreNewt::CollisionPrimitives::TreeCollision::TreeCollision | ( | const World * | world, |
int | numVertices, | ||
Ogre::Vector3 * | vertices, | ||
Ogre::IndexData * | indexData, | ||
bool | optimize, | ||
int | id, | ||
FaceWinding | fw = FW_DEFAULT |
||
) |
constructor
build a TreeCollision from vertice and index information. This can be used with the ogre Paging Landscape SceneManager, or other custom solutions.
- Parameters
-
world pointer to OgreNewt::World numVertices number of vertices in the array. vertices pointer to array of Ogre::Vector3 vertices (positions only) indexData pointer to Ogre::IndexData for the mesh optimize bool whether you want to optimize the collision or not. id an id for this shape, can be received with collision->getUserId()
Definition at line 684 of file OgreNewt_CollisionPrimitives.cpp.
◆ ~TreeCollision()
|
inline |
destructor
Definition at line 353 of file OgreNewt_CollisionPrimitives.h.
Member Function Documentation
◆ AddEntities()
void OgreNewt::CollisionPrimitives::TreeCollision::AddEntities | ( | const Ogre::SceneNode * | node, |
const Ogre::SceneNode * | mainNode, | ||
const Ogre::Vector3 | scale, | ||
FaceWinding | fw = FW_DEFAULT |
||
) |
Definition at line 747 of file OgreNewt_CollisionPrimitives.cpp.
◆ addPoly()
void OgreNewt::CollisionPrimitives::TreeCollision::addPoly | ( | Ogre::Vector3 * | polys, |
unsigned int | ID | ||
) |
add a poly to the tree collision
Add a single poly to the tree collision.
- Parameters
-
polys pointer to an array of 3 Vector3D objects representing the global position of each poly. ID and identifier to assign to this poly, that can be retrieved later upon collision detection.
Definition at line 904 of file OgreNewt_CollisionPrimitives.cpp.
◆ finish()
void OgreNewt::CollisionPrimitives::TreeCollision::finish | ( | bool | optimize | ) |
finish the tree collision
Definition at line 909 of file OgreNewt_CollisionPrimitives.cpp.
◆ newtonRayCastCallback()
|
static |
used internally
TODO: what do we need to return here?
Definition at line 932 of file OgreNewt_CollisionPrimitives.cpp.
◆ setRayCastCallbackactive()
|
inline |
set RayCastCallback active/disabled
- Parameters
-
active true = Callback active; false = Callback disabled
Definition at line 373 of file OgreNewt_CollisionPrimitives.h.
◆ start()
void OgreNewt::CollisionPrimitives::TreeCollision::start | ( | int | id | ) |
start a tree collision creation
Definition at line 889 of file OgreNewt_CollisionPrimitives.cpp.
The documentation for this class was generated from the following files:
- include/External/ogrenewt/OgreNewt_CollisionPrimitives.h
- src/External/ogrenewt/OgreNewt_CollisionPrimitives.cpp
Generated by 1.9.8