Object Class Reference

Base class for all physics-enabled game objects. More...

Inheritance diagram for Object:

Inheritance graph
[legend]
Collaboration diagram for Object:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Object (irr::scene::ISceneNode *node)
 ctor
virtual ~Object ()
 dtor
void setOpposedRotation (bool y)
btRigidBody * getBody () const
irr::scene::ISceneNode * getNode () const
btVector3 getCenterOfMassPosition () const
virtual void update ()
 Handler called at the end of each frame.

Protected Member Functions

virtual void init (btCollisionShape *shape, btScalar mass)
 Initialize the collision object from a shape and a mass.
virtual void startFrame ()
 Handler called at the beginning of each frame.
virtual void collision (Object *obj, btPersistentManifold *manifold, float scale)
 Handler called upon collision with another Object.

Friends

class World


Detailed Description

Base class for all physics-enabled game objects.

An Object is attached to an Irrlicht scene node and changes its position based on input from the Bullet engine.

It must have a collision shape and a mass, set in the init() method and thus this class should be considered virtual (even though it is not) unless you know what you are doing.

See also:
Box

Sphere

Capsule

Mesh

SharedMesh

Character

Camera


Constructor & Destructor Documentation

Object::Object ( irr::scene::ISceneNode *  node  ) 

ctor

Parameters:
node Scene node to manage
The scene node is usually a (animated) mesh scene node or a terrain scene node but there is no real limitation to its nature as long as a proper shape goes with it.


Member Function Documentation

btRigidBody * Object::getBody (  )  const

irr::scene::ISceneNode * Object::getNode (  )  const

Returns:
pointer to the attached scene node

Referenced by Character::update().

btVector3 Object::getCenterOfMassPosition (  )  const

Returns:
position of the center of mass
Some meshes are centered around (i.e have their origin at) their feet so we need a consistent way to get the center of a mesh.

This method actually only affects the Y component of the position vector, based on the bounding box.

Referenced by Player::update(), and Camera::update().

void Object::update (  )  [virtual]

Handler called at the end of each frame.

The default implementation simply update the position of the attached scene node.

References World::quaternionToEuler().

Referenced by Character::update(), and Camera::update().

void Object::init ( btCollisionShape *  shape,
btScalar  mass 
) [protected, virtual]

Initialize the collision object from a shape and a mass.

Parameters:
shape collision shape of the object
mass mass of the object (negative for kinematic object and null for static ones)

References World::irrToBullet().

Referenced by Box::Box(), Capsule::Capsule(), Mesh::Mesh(), SharedMesh::SharedMesh(), and Sphere::Sphere().


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

Generated on Sat Jul 26 13:58:39 2008 for TFK:GE by  doxygen 1.5.5