Gem Illuminator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Player Class Reference

The Player class' only responsibilities are riding on lightrays and updating the camera. More...

#include <player.h>

Inheritance diagram for Player:

Public Slots

Cameracamera () const
 The camera which is updated by player. More...
 
void setCamera (Camera *camera)
 Sets the camera, that should be updated by player. The player does not take ownership of camera. More...
 
qreal velocity () const
 The velocity of player. More...
 
void setVelocity (qreal velocity)
 Sets velocity of player. More...
 

Signals

void cameraChanged ()
 
void velocityChanged ()
 

Public Member Functions

 Player (QObject *parent=0)
 
virtual ~Player ()
 
void moveOnRay (const LightRay &ray, int timeDifferenceInMilliseconds)
 Moves the player along a ray. More...
 
void moveToStartPointOnRay (const LightRay &ray)
 Sest the player to ray.startPosition() and updates the camera accordingly. More...
 
void moveToEndPointOnRay (const LightRay &ray)
 Sets the player to ray.endPosition() and updates the camera accordingly. More...
 
const QVector3D & position () const
 The position of player in world coordinates. More...
 
void setPosition (const QVector3D &position)
 
void setViewDirection (const QVector3D &viewDirection)
 Set view direction to provided value. For now this value should be the same like the direction of followed lightray. More...
 

Protected Member Functions

void updateCameraForPointOnRay (const QVector3D &point, const LightRay &ray)
 Updates the camera position for given point on ray. More...
 

Protected Attributes

qreal m_velocity
 
QVector3D * m_position
 
Cameram_camera
 

Detailed Description

The Player class' only responsibilities are riding on lightrays and updating the camera.

Constructor & Destructor Documentation

Player::Player ( QObject *  parent = 0)
explicit
Player::~Player ( )
virtual

Member Function Documentation

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
rayThe ray that is followed by ray.
timeDifferenceInMillisecondsThe 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
raymoveToEndPointOnRay();
void Player::moveToStartPointOnRay ( const LightRay ray)

Sest the player to ray.startPosition() and updates the camera accordingly.

Parameters
raymoveToEndPointOnRay();
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
camera
void Player::setPosition ( const QVector3D &  position)
void Player::setVelocity ( qreal  velocity)
slot

Sets velocity of player.

Parameters
velocity
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
viewDirection
void Player::updateCameraForPointOnRay ( const QVector3D &  point,
const LightRay ray 
)
protected

Updates the camera position for given point on ray.

Parameters
pointThe new position() of player on ray. This point has to lie on ray or it will lead to unexpected behaviour
rayThe 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

Member Data Documentation

Camera* Player::m_camera
protected
QVector3D* Player::m_position
protected
qreal Player::m_velocity
protected

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