Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
SkyX::BasicController Class Reference

Description

Basic controller class

Definition at line 35 of file BasicController.h.

+ Inheritance diagram for SkyX::BasicController:

Public Member Functions

 BasicController (const bool &deleteBySkyX=true)
 
void update (const Ogre::Real &simDeltaTime)
 
void setTime (const Ogre::Vector3 &t)
 
const Ogre::Vector3 & getTime () const
 
void setEastDirection (const Ogre::Vector2 &ed)
 
const Ogre::Vector2 & getEastDirection () const
 
Ogre::Vector3 getSunDirection ()
 
Ogre::Vector3 getMoonDirection ()
 
void setMoonPhase (const Ogre::Real &mp)
 
Ogre::Real getMoonPhase ()
 
- Public Member Functions inherited from SkyX::Controller
 Controller (const bool &deleteBySkyX)
 
virtual ~Controller ()
 
const bool & getDeleteBySkyX () const
 

Private Attributes

Ogre::Vector3 mTime
 
Ogre::Vector2 mEastDirection
 
Ogre::Vector3 mSunDirection
 
Ogre::Vector3 mMoonDirection
 
Ogre::Real mMoonPhase
 

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.

◆ 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.

◆ 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.

◆ 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.

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: