RigsofRods
Soft-body Physics Simulation
Public Member Functions | Private Attributes
SkyX::BasicController Class Reference

Basic controller class
More...

#include <BasicController.h>

+ Inheritance diagram for SkyX::BasicController:
+ Collaboration diagram for SkyX::BasicController:

Public Member Functions

 BasicController (const bool &deleteBySkyX=true)
 Constructor. More...
 
void update (const Ogre::Real &simDeltaTime)
 Update controller. More...
 
void setTime (const Ogre::Vector3 &t)
 Set time. More...
 
const Ogre::Vector3 & getTime () const
 Get time. More...
 
void setEastDirection (const Ogre::Vector2 &ed)
 Set eastn direction. More...
 
const Ogre::Vector2 & getEastDirection () const
 Get east direction. More...
 
Ogre::Vector3 getSunDirection ()
 Get sun direction. More...
 
Ogre::Vector3 getMoonDirection ()
 Get moon direction. More...
 
void setMoonPhase (const Ogre::Real &mp)
 Set moon phase. More...
 
Ogre::Real getMoonPhase ()
 Get moon phase. More...
 
- Public Member Functions inherited from SkyX::Controller
 Controller (const bool &deleteBySkyX)
 Constructor. More...
 
virtual ~Controller ()
 Destructor. More...
 
const bool & getDeleteBySkyX () const
 Must the controller be destroyed by SkyX? More...
 

Private Attributes

Ogre::Vector3 mTime
 Time information: x = time in [0, 24]h range, y = sunrise hour in [0, 24]h range, z = sunset hour in [0, 24] range. More...
 
Ogre::Vector2 mEastDirection
 East direction (in X,Z world coords) More...
 
Ogre::Vector3 mSunDirection
 Sun direction. More...
 
Ogre::Vector3 mMoonDirection
 Moon direction. More...
 
Ogre::Real mMoonPhase
 Moon phase. More...
 

Detailed Description

Basic controller class

Definition at line 35 of file BasicController.h.

Constructor & Destructor Documentation

◆ BasicController()

SkyX::BasicController::BasicController ( const bool &  deleteBySkyX = true)

Constructor.

Parameters
deleteBySkyXtrue to automatically destroy the controller by SkyX, false otherwise

Definition at line 28 of file BasicController.cpp.

Member Function Documentation

◆ getEastDirection()

const Ogre::Vector2& SkyX::BasicController::getEastDirection ( ) const
inline

Get east direction.

Returns
Current east direction, in X,Z world coords

Definition at line 78 of file BasicController.h.

◆ getMoonDirection()

Ogre::Vector3 SkyX::BasicController::getMoonDirection ( )
inlinevirtual

Get moon direction.

Returns
Moon direction, Earth-to-Moon direction

Implements SkyX::Controller.

Definition at line 94 of file BasicController.h.

◆ getMoonPhase()

Ogre::Real SkyX::BasicController::getMoonPhase ( )
inlinevirtual

Get moon phase.

Returns
Moon phase in [-1,1] range, where -1 means fully covered Moon, 0 clear Moon and 1 fully covered Moon

Implements SkyX::Controller.

Definition at line 110 of file BasicController.h.

◆ getSunDirection()

Ogre::Vector3 SkyX::BasicController::getSunDirection ( )
inlinevirtual

Get sun direction.

Returns
Sun direction, the Earth-to-Sun direction

Implements SkyX::Controller.

Definition at line 86 of file BasicController.h.

◆ getTime()

const Ogre::Vector3& SkyX::BasicController::getTime ( ) const
inline

Get time.

Returns
Current time, where x = time in [0, 24]h range, y = sunrise hour in [0, 24]h range, z = sunset hour in [0, 24] range

Definition at line 61 of file BasicController.h.

◆ setEastDirection()

void SkyX::BasicController::setEastDirection ( const Ogre::Vector2 &  ed)
inline

Set eastn direction.

Parameters
edEast direction, in X,Z world coords (must be normalized)

Definition at line 69 of file BasicController.h.

+ Here is the call graph for this function:

◆ setMoonPhase()

void SkyX::BasicController::setMoonPhase ( const Ogre::Real &  mp)
inline

Set moon phase.

Parameters
mpMoon phase in [-1,1] range, where -1 means fully covered Moon, 0 clear Moon and 1 fully covered Moon

Definition at line 102 of file BasicController.h.

+ Here is the caller graph for this function:

◆ setTime()

void SkyX::BasicController::setTime ( const Ogre::Vector3 &  t)
inline

Set time.

Parameters
tTime, where x = time in [0, 24]h range, y = sunrise hour in [0, 24]h range, z = sunset hour in [0, 24] range

Definition at line 52 of file BasicController.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

void SkyX::BasicController::update ( const Ogre::Real &  simDeltaTime)
virtual

Update controller.

Parameters
simDeltaTimeSimulation delta time (It's not the time since last frame, it's the delta simulation time, one time the time since last frame has been multiplied by the time multiplier)

Reimplemented from SkyX::Controller.

Definition at line 38 of file BasicController.cpp.

+ Here is the caller graph for this function:

Field Documentation

◆ mEastDirection

Ogre::Vector2 SkyX::BasicController::mEastDirection
private

East direction (in X,Z world coords)

Definition at line 119 of file BasicController.h.

◆ mMoonDirection

Ogre::Vector3 SkyX::BasicController::mMoonDirection
private

Moon direction.

Definition at line 124 of file BasicController.h.

◆ mMoonPhase

Ogre::Real SkyX::BasicController::mMoonPhase
private

Moon phase.

Definition at line 126 of file BasicController.h.

◆ mSunDirection

Ogre::Vector3 SkyX::BasicController::mSunDirection
private

Sun direction.

Definition at line 122 of file BasicController.h.

◆ mTime

Ogre::Vector3 SkyX::BasicController::mTime
private

Time information: x = time in [0, 24]h range, y = sunrise hour in [0, 24]h range, z = sunset hour in [0, 24] range.

Definition at line 117 of file BasicController.h.


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