Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

SimulatorThread Class Reference

#include <SimulatorThread.h>

List of all members.

Public Member Functions

Public Attributes

Private Member Functions

Private Attributes


Constructor & Destructor Documentation

SimulatorThread::SimulatorThread ThyrixMainFrame iniFrame  ) 
 

Definition at line 6 of file SimulatorThread.cpp.

References setFramesPerSecond(), and setTimeFactor().

SimulatorThread::~SimulatorThread  )  [virtual]
 

Definition at line 16 of file SimulatorThread.cpp.


Member Function Documentation

void * SimulatorThread::Entry  )  [virtual]
 

Definition at line 60 of file SimulatorThread.cpp.

References World::advanceTime(), expectedTime, frame, frameInterval, World::getDt(), ThyrixMainFrame::paint(), simulationTimer, sleepIfAhead(), and world.

void SimulatorThread::OnExit  )  [virtual]
 

Called when the thread exits - whether it terminates normally or is stopped with Delete() (but not when it is Kill()ed!)

Definition at line 90 of file SimulatorThread.cpp.

void SimulatorThread::setFramesPerSecond int  fps  ) 
 

Definition at line 36 of file SimulatorThread.cpp.

References frameInterval.

Referenced by ThyrixMainFrame::onSetFps(), and SimulatorThread().

void SimulatorThread::setPause  ) 
 

Definition at line 25 of file SimulatorThread.cpp.

References paused.

Referenced by ThyrixMainFrame::onSetSpeed().

void SimulatorThread::setTimeFactor float  newFactor  ) 
 

Definition at line 29 of file SimulatorThread.cpp.

References expectedTime, paused, simulationTimer, and timeFactor.

Referenced by ThyrixMainFrame::onSetSpeed(), SimulatorThread(), and sleepIfAhead().

void SimulatorThread::sleepIfAhead  )  [private]
 

Sleeps to adjust the speed of the simulator to a predefined speed.

Definition at line 40 of file SimulatorThread.cpp.

References expectedTime, setTimeFactor(), simulationTimer, and timeFactor.

Referenced by Entry().

void SimulatorThread::step  ) 
 

Advances the simulator with a timestep. Called directly by the frame, following a command event.

Definition at line 19 of file SimulatorThread.cpp.

References World::advanceTime(), and world.

Referenced by ThyrixMainFrame::onStep().


Member Data Documentation

float SimulatorThread::expectedTime [private]
 

The time (real time, relative to the starting time of the simulator or a later reference time) at which the next simulator timestep should be executed, in s.

Definition at line 54 of file SimulatorThread.h.

Referenced by Entry(), setTimeFactor(), and sleepIfAhead().

ThyrixMainFrame* SimulatorThread::frame [private]
 

A pointer to the frame on which it will draw.

Definition at line 61 of file SimulatorThread.h.

Referenced by Entry().

unsigned SimulatorThread::frameInterval [private]
 

The time interval for displaying a frame, in ms.

Definition at line 47 of file SimulatorThread.h.

Referenced by Entry(), and setFramesPerSecond().

bool SimulatorThread::paused [private]
 

Indicates that the simulation is paused.

Definition at line 50 of file SimulatorThread.h.

Referenced by setPause(), and setTimeFactor().

wxStopWatch SimulatorThread::simulationTimer [private]
 

A timer used for syncronizing the simulator time at a desired speed factor. Counts the time since the starting of the simulation or a later reference time.

Definition at line 58 of file SimulatorThread.h.

Referenced by Entry(), setTimeFactor(), and sleepIfAhead().

float SimulatorThread::timeFactor [private]
 

The time factor between the speed of the simulator and real time.

Definition at line 44 of file SimulatorThread.h.

Referenced by setTimeFactor(), and sleepIfAhead().

World* SimulatorThread::world
 

Definition at line 37 of file SimulatorThread.h.

Referenced by Entry(), and step().


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

Thyrix homepageUsers' guide

(C) Arxia 2004-2005