SO3Engine
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
OgreNewt::Collision Class Reference

represents a shape for collision detection More...

#include <OgreNewt_Collision.h>

Inheritance diagram for OgreNewt::Collision:
OgreNewt::CollisionPrimitives::CompoundCollision OgreNewt::CollisionPrimitives::Null OgreNewt::CollisionPrimitives::TreeCollision OgreNewt::ConvexCollision OgreNewt::CollisionPrimitives::TreeCollisionSceneParser OgreNewt::CollisionPrimitives::Box OgreNewt::CollisionPrimitives::Capsule OgreNewt::CollisionPrimitives::ChamferCylinder OgreNewt::CollisionPrimitives::ConcaveHull OgreNewt::CollisionPrimitives::Cone OgreNewt::CollisionPrimitives::ConvexHull OgreNewt::CollisionPrimitives::Cylinder OgreNewt::CollisionPrimitives::Ellipsoid OgreNewt::CollisionPrimitives::Pyramid

Public Member Functions

 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.
 

Static Public Member Functions

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

NewtonCollision * m_col
 
const Worldm_world
 

Friends

class OgreNewt::CollisionSerializer
 friend functions for the Serializer
 

Detailed Description

represents a shape for collision detection

Definition at line 50 of file OgreNewt_Collision.h.

Constructor & Destructor Documentation

◆ Collision() [1/3]

OgreNewt::Collision::Collision ( const World world)

constructor

Definition at line 12 of file OgreNewt_Collision.cpp.

◆ Collision() [2/3]

OgreNewt::Collision::Collision ( const Collision shape)

constructor

Definition at line 16 of file OgreNewt_Collision.cpp.

◆ Collision() [3/3]

OgreNewt::Collision::Collision ( const NewtonCollision *  collision,
const World world 
)

constructor

Definition at line 20 of file OgreNewt_Collision.cpp.

◆ ~Collision()

OgreNewt::Collision::~Collision ( )
virtual

destructor

Definition at line 24 of file OgreNewt_Collision.cpp.

Member Function Documentation

◆ getAABB()

Ogre::AxisAlignedBox OgreNewt::Collision::getAABB ( const Ogre::Quaternion &  orient = Ogre::Quaternion::IDENTITY,
const Ogre::Vector3 &  pos = Ogre::Vector3::ZERO 
) const

you can set different IDs for each piece in a compound collision object, and then use these IDs in a collision callback to determine which part is currently colliding. ‍/ void setUserID( unsigned id ) const { NewtonCollisionSetUserID( m_col, id); }

! get user ID, for collision callback identification unsigned getUserID() const { return NewtonCollisionGetUserID(m_col); }

! get the Axis-Aligned Bounding Box for this collision shape. /*!

Warning
The returned AABB can be too large! If you need an AABB that fits exactly use the OgreNewt::CollisionTools::CalculateFittingAABB function

Definition at line 32 of file OgreNewt_Collision.cpp.

◆ getCollisionPrimitiveType() [1/2]

CollisionPrimitiveType OgreNewt::Collision::getCollisionPrimitiveType ( ) const
inline

Returns the Collisiontype for this Collision.

Definition at line 95 of file OgreNewt_Collision.h.

◆ getCollisionPrimitiveType() [2/2]

CollisionPrimitiveType OgreNewt::Collision::getCollisionPrimitiveType ( const NewtonCollision *  col)
static

Returns the Collisiontype for the given Newton-Collision.

Definition at line 50 of file OgreNewt_Collision.cpp.

◆ getInfo() [1/2]

NewtonCollisionInfoRecord * OgreNewt::Collision::getInfo ( )
inline

Returns collision info record for this collision.

Definition at line 101 of file OgreNewt_Collision.h.

◆ getInfo() [2/2]

NewtonCollisionInfoRecord * OgreNewt::Collision::getInfo ( const NewtonCollision *  col)
static

Returns collision info record for given collision.

Definition at line 59 of file OgreNewt_Collision.cpp.

◆ getNewtonCollision()

NewtonCollision *const OgreNewt::Collision::getNewtonCollision ( ) const
inline

retrieve the Newton pointer

retrieves the pointer to the NewtonCollision object.

Definition at line 70 of file OgreNewt_Collision.h.

◆ getWorld()

const World * OgreNewt::Collision::getWorld ( ) const
inline

Returns the Newton world this collision belongs to.

Definition at line 75 of file OgreNewt_Collision.h.

Friends And Related Symbol Documentation

◆ OgreNewt::CollisionSerializer

friend class OgreNewt::CollisionSerializer
friend

friend functions for the Serializer

Definition at line 107 of file OgreNewt_Collision.h.

Member Data Documentation

◆ m_col

NewtonCollision* OgreNewt::Collision::m_col
protected

Definition at line 112 of file OgreNewt_Collision.h.

◆ m_world

const World* OgreNewt::Collision::m_world
protected

Definition at line 113 of file OgreNewt_Collision.h.


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