The Player class' only responsibilities are riding on lightrays and updating the camera.
More...
#include <player.h>
The Player class' only responsibilities are riding on lightrays and updating the camera.
Player::Player |
( |
QObject * |
parent = 0 | ) |
|
|
explicit |
Camera* Player::camera |
( |
| ) |
const |
|
slot |
The camera which is updated by player.
- Returns
void Player::cameraChanged |
( |
| ) |
|
|
signal |
void Player::moveOnRay |
( |
const LightRay & |
ray, |
|
|
int |
timeDifferenceInMilliseconds |
|
) |
| |
Moves the player along a ray.
- Parameters
-
ray | The ray that is followed by ray. |
timeDifferenceInMilliseconds | The time elapsed since last update in order to calculate how far the player should move. |
void Player::moveToEndPointOnRay |
( |
const LightRay & |
ray | ) |
|
Sets the player to ray.endPosition() and updates the camera accordingly.
- Parameters
-
void Player::moveToStartPointOnRay |
( |
const LightRay & |
ray | ) |
|
Sest the player to ray.startPosition() and updates the camera accordingly.
- Parameters
-
const QVector3D & Player::position |
( |
| ) |
const |
The position of player in world coordinates.
- Returns
void Player::setCamera |
( |
Camera * |
camera | ) |
|
|
slot |
Sets the camera, that should be updated by player. The player does not take ownership of camera.
- Parameters
-
void Player::setPosition |
( |
const QVector3D & |
position | ) |
|
void Player::setVelocity |
( |
qreal |
velocity | ) |
|
|
slot |
Sets velocity of player.
- Parameters
-
void Player::setViewDirection |
( |
const QVector3D & |
viewDirection | ) |
|
Set view direction to provided value. For now this value should be the same like the direction of followed lightray.
- Parameters
-
void Player::updateCameraForPointOnRay |
( |
const QVector3D & |
point, |
|
|
const LightRay & |
ray |
|
) |
| |
|
protected |
Updates the camera position for given point on ray.
- Parameters
-
point | The new position() of player on ray. This point has to lie on ray or it will lead to unexpected behaviour |
ray | The lightray the player is following. |
qreal Player::velocity |
( |
| ) |
const |
|
slot |
The velocity of player.
- Returns
- Returns the distance, that is passed in one second.
void Player::velocityChanged |
( |
| ) |
|
|
signal |
QVector3D* Player::m_position |
|
protected |
The documentation for this class was generated from the following files: