Project

General

Profile

SO3Engine
OgreNewt::CollisionPrimitives::ConvexHull Class Reference

ConvexHull primitive. More...

#include <OgreNewt_CollisionPrimitives.h>

Inheritance diagram for OgreNewt::CollisionPrimitives::ConvexHull:
OgreNewt::ConvexCollision OgreNewt::Collision

Public Member Functions

 ConvexHull (const World *world)
 constructor
 
 ConvexHull (const World *world, Ogre::Entity *ent, int id=1, const Ogre::Quaternion &orient=Ogre::Quaternion::IDENTITY, const Ogre::Vector3 &pos=Ogre::Vector3::ZERO, Ogre::Real tolerance=0.001f, const Ogre::Vector3 &scale=Ogre::Vector3::UNIT_SCALE)
 constructor
 
 ConvexHull (const World *world, const Ogre::Vector3 *verts, int vertcount, int id=1, const Ogre::Quaternion &orient=Ogre::Quaternion::IDENTITY, const Ogre::Vector3 &pos=Ogre::Vector3::ZERO, Ogre::Real tolerance=0.001f)
 
 ~ConvexHull ()
 destructor
 
- Public Member Functions inherited from OgreNewt::ConvexCollision
 ConvexCollision (const World *world)
 constructor
 
 ConvexCollision (const Collision &convexShape)
 constructor
 
 ConvexCollision (const ConvexCollision &convexShape)
 constructor
 
 ~ConvexCollision ()
 destructor
 
Ogre::Real calculateVolume () const
 calculate the volume of the collision shape, useful for buoyancy calculations.
 
void calculateInertialMatrix (Ogre::Vector3 &inertia, Ogre::Vector3 &offset) const
 calculate the moment of inertia for this collision primitive, along with the theoretical center-of-mass for this shape.
 
- 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 WorldgetWorld () 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.
 

Additional Inherited Members

- 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.
 
- Protected Attributes inherited from OgreNewt::Collision
NewtonCollision * m_col
 
const Worldm_world
 

Detailed Description

ConvexHull primitive.

"wrap" around a set cloud of vertices. a convex hull is the smallest possible convex shape that fully encloses all points supplied.

Definition at line 212 of file OgreNewt_CollisionPrimitives.h.

Constructor & Destructor Documentation

◆ ConvexHull() [1/3]

OgreNewt::CollisionPrimitives::ConvexHull::ConvexHull ( const World world)

constructor

Create a 'blank' convexhull collision object. Can be used for CollisionSerializer::importCollision

Parameters
worldpointer to the OgreNewt::World

Definition at line 170 of file OgreNewt_CollisionPrimitives.cpp.

◆ ConvexHull() [2/3]

OgreNewt::CollisionPrimitives::ConvexHull::ConvexHull ( const World world,
Ogre::Entity *  ent,
int  id = 1,
const Ogre::Quaternion &  orient = Ogre::Quaternion::IDENTITY,
const Ogre::Vector3 &  pos = Ogre::Vector3::ZERO,
Ogre::Real  tolerance = 0.001f,
const Ogre::Vector3 &  scale = Ogre::Vector3::UNIT_SCALE 
)

constructor

Overloaded constructor. pass an Entity*, and it will use its vertex data. if it is attached to Node*, the collision will be scaled apperently (entity->getParentNode()->getScale()), but if the scale changes, you need to adopt your collision by yourself

Parameters
worldpointer to the OgreNewt::World
entpointer to an Ogre::Entity
idan id for this shape, can be received with collision->getUserId()
orientorientation offset of the primitive
posposition offset of the primitive \parem tolerance a tolerance passed to newton
forceScaleif set to something else then (0,0,0), the value of this argument will be used as scale instead of the parent-node's scale

Definition at line 173 of file OgreNewt_CollisionPrimitives.cpp.

◆ ConvexHull() [3/3]

OgreNewt::CollisionPrimitives::ConvexHull::ConvexHull ( const World world,
const Ogre::Vector3 *  verts,
int  vertcount,
int  id = 1,
const Ogre::Quaternion &  orient = Ogre::Quaternion::IDENTITY,
const Ogre::Vector3 &  pos = Ogre::Vector3::ZERO,
Ogre::Real  tolerance = 0.001f 
)

Overloaded constructor. pass a pointer to an array of vertices and the hull will be made from that.

Parameters
worldpointer to the OgreNewt::World
vertspointer to an array of Ogre::Vector3's that contain vertex position data
vertcountnumber ot vetices in the array
idan id for this shape, can be received with collision->getUserId()
orientorientation offset of the primitive
posposition offset of the primitive
tolerancea tolerance passed to newton

Definition at line 294 of file OgreNewt_CollisionPrimitives.cpp.

◆ ~ConvexHull()

OgreNewt::CollisionPrimitives::ConvexHull::~ConvexHull ( )
inline

destructor

Definition at line 251 of file OgreNewt_CollisionPrimitives.h.


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