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 |
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.
Object::Object | ( | irr::scene::ISceneNode * | node | ) |
ctor
node | Scene node to manage |
btRigidBody * Object::getBody | ( | ) | const |
Referenced by World::addObject(), Character::Character(), World::removeObject(), Character::update(), Camera::update(), and Character::~Character().
irr::scene::ISceneNode * Object::getNode | ( | ) | const |
btVector3 Object::getCenterOfMassPosition | ( | ) | const |
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.
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().