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
LightRay Class Reference

The LightRay class describes the lightrays sent into Scene. Because LightRays are sent into Scene right after creation, they are more lines but rays. Rays are organized as a tree, a ray owns all of its successors(). Most of the game logic is still done within LightRay::update(). More...

#include <lightray.h>

Inheritance diagram for LightRay:
GameLostRay

Public Slots

const QVector3D & startPosition () const
 
void setStartPosition (const QVector3D &position)
 
const QVector3D & endPosition () const
 
void setEndPosition (const QVector3D &position)
 
const QVector3D & direction () const
 
const QVector3D & normalizedDirection () const
 
const QVector3D & color () const
 
void setColor (const QVector3D &color)
 
Playerplayer () const
 
void setPlayer (Player *attachedPlayer)
 
Scenescene () const
 
void setScene (Scene *owningScene)
 
bool isStatic () const
 
void setStatic ()
 
LightRayselectedSuccessor ()
 Returns the ray the player should move on after reaching end of current ray. In case no successors exists they will be calculated using calculateSuccessors() More...
 
void setSelectedSuccessor (LightRay *successor)
 
const QList< LightRay * > & successors ()
 

Signals

void colorChanged ()
 
void startPositionChanged ()
 
void endPositionChanged ()
 
void playerChanged ()
 
void sceneChanged ()
 

Public Member Functions

 LightRay (QObject *parent=0)
 
virtual ~LightRay ()
 
virtual void update (int timeDifference)
 Updates our game. The player will be moved. More...
 
QVector3D normalizedOrthogonalVector () const
 Calculates a normalized vector that is orthogonal to direction(). More...
 
QVector3D calculateColor ()
 calculateSuccessorColor calculates the successor color based on its normalized direction The color values are approximately in the range between 0.1 and 0.8 More...
 

Protected Member Functions

bool isPlayerBeforeCollisionPoint ()
 
void calculateSuccessors ()
 
AbstractGemcollidingGem () const
 
void setCollidingGem (AbstractGem *gem)
 

Protected Attributes

AbstractGemm_collidingGem
 
LightRayDatam_data
 
QList< LightRay * > * m_successors
 
LightRaym_selectedSuccessor
 
bool m_isStatic
 
Playerm_player
 
Scenem_scene
 

Detailed Description

The LightRay class describes the lightrays sent into Scene. Because LightRays are sent into Scene right after creation, they are more lines but rays. Rays are organized as a tree, a ray owns all of its successors(). Most of the game logic is still done within LightRay::update().

Constructor & Destructor Documentation

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

Member Function Documentation

QVector3D LightRay::calculateColor ( )

calculateSuccessorColor calculates the successor color based on its normalized direction The color values are approximately in the range between 0.1 and 0.8

Returns
The calculated color
void LightRay::calculateSuccessors ( )
protected
AbstractGem * LightRay::collidingGem ( ) const
protected
const QVector3D& LightRay::color ( ) const
slot
void LightRay::colorChanged ( )
signal
const QVector3D& LightRay::direction ( ) const
slot
const QVector3D& LightRay::endPosition ( ) const
slot
void LightRay::endPositionChanged ( )
signal
bool LightRay::isPlayerBeforeCollisionPoint ( )
protected
bool LightRay::isStatic ( ) const
slot
const QVector3D& LightRay::normalizedDirection ( ) const
slot
QVector3D LightRay::normalizedOrthogonalVector ( ) const

Calculates a normalized vector that is orthogonal to direction().

Returns
Player* LightRay::player ( ) const
slot
void LightRay::playerChanged ( )
signal
Scene* LightRay::scene ( ) const
slot
void LightRay::sceneChanged ( )
signal
LightRay * LightRay::selectedSuccessor ( )
slot

Returns the ray the player should move on after reaching end of current ray. In case no successors exists they will be calculated using calculateSuccessors()

Returns
void LightRay::setCollidingGem ( AbstractGem gem)
protected
void LightRay::setColor ( const QVector3D &  color)
slot
void LightRay::setEndPosition ( const QVector3D &  position)
slot
void LightRay::setPlayer ( Player attachedPlayer)
slot
void LightRay::setScene ( Scene owningScene)
slot
void LightRay::setSelectedSuccessor ( LightRay successor)
slot
void LightRay::setStartPosition ( const QVector3D &  position)
slot
void LightRay::setStatic ( )
slot
const QVector3D& LightRay::startPosition ( ) const
slot
void LightRay::startPositionChanged ( )
signal
const QList< LightRay * > & LightRay::successors ( )
slot
void LightRay::update ( int  timeDifference)
virtual

Updates our game. The player will be moved.

Parameters
timeDifferenceTime since last update in milliseconds.

Reimplemented in GameLostRay.

Member Data Documentation

AbstractGem* LightRay::m_collidingGem
protected
LightRayData* LightRay::m_data
protected
bool LightRay::m_isStatic
protected
Player* LightRay::m_player
protected
Scene* LightRay::m_scene
protected
LightRay* LightRay::m_selectedSuccessor
protected
QList<LightRay *>* LightRay::m_successors
protected

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