Public Member Functions | |
Camera (irr::scene::ICameraSceneNode *camera, Object *target, World *world) | |
ctor | |
virtual void | update () |
Update the camera. | |
virtual bool | event (const irr::SEvent &e) |
Event handler. | |
irr::scene::ICameraSceneNode * | getNode () const |
const irr::core::vector3df & | getDirection () const |
float | getYaw () const |
float | getPitch () const |
The purpose of this class is to manage a camera scene node to follow a game object (most probably a character) either in 1st or 3rd person view.
It handles collision with the environment when in 3rd person view to avoid walls to stand between the target object and the camera.
ctor
camera | camera scene node to manage | |
target | game object to follow | |
world | World in which the game object evolves |
void Camera::update | ( | ) | [virtual] |
Update the camera.
The camera scene node position and target are affected. The target object may be affected (rotation in 3rd person view)
References Object::getBody(), Object::getCenterOfMassPosition(), World::getDynamicsWorld(), and Object::update().
bool Camera::event | ( | const irr::SEvent & | e | ) | [virtual] |
Event handler.
Change the position (3rd person view) or the target (1st person view) of the camera based on mouse input
References World::getDevice().
irr::scene::ICameraSceneNode * Camera::getNode | ( | ) | const |
const irr::core::vector3df & Camera::getDirection | ( | ) | const |
float Camera::getYaw | ( | ) | const |
float Camera::getPitch | ( | ) | const |