Simulation Class Reference

Simulation parameters. More...

#include <Simulation.h>

List of all members.

Public Member Functions

 Simulation ()
 ~Simulation ()
void setBasePhyStep (double step)
UINT getBasePhyStep () const
double getCurPhyStep () const
 Returns the size (in seconds) of the steps, regardless of the pause state.
double getCurPhyNbStepsPerSec () const
 Returns the number of steps per second, regardless of the pause state.
double getPhySpeedNum () const
 Time multiplier that affect the number of steps (Computes more or less steps).
void setPhySpeedNum (double factor)
double getPhySpeedStep () const
 Time multiplier that affect the step size (Computes larger or smaller steps).
void setPhySpeedStep (double factor)
bool isPaused () const
 Maximum delay between two frames, else consider the computer had a slowdown and do not compute physics.
void pause (bool set=true)
void togglePause ()
void addOrSetCallback (SimulationCallback *_pCB)

Public Attributes

osg::observer_ptr
< SimulationCallback
pCB
 Callback called when data change.

Protected Attributes

double basePhyStep
 Physics base step size (Second).
double phySpeedNum
double phySpeedStep
bool paused


Detailed Description

Simulation parameters.

Todo:
Must be thread safe
Version:
0.2.x - Under dev

Definition at line 50 of file Simulation.h.


Constructor & Destructor Documentation

Simulation::Simulation (  ) 

Definition at line 35 of file Simulation.cpp.

References DEFAULT_BASE_PHY_STEP, and setBasePhyStep().

Simulation::~Simulation (  ) 

Definition at line 39 of file Simulation.cpp.


Member Function Documentation

void Simulation::addOrSetCallback ( SimulationCallback _pCB  )  [inline]

Definition at line 125 of file Simulation.h.

UINT Simulation::getBasePhyStep (  )  const [inline]

Definition at line 71 of file Simulation.h.

double Simulation::getCurPhyNbStepsPerSec (  )  const [inline]

Returns the number of steps per second, regardless of the pause state.

Definition at line 76 of file Simulation.h.

double Simulation::getCurPhyStep (  )  const [inline]

Returns the size (in seconds) of the steps, regardless of the pause state.

Definition at line 74 of file Simulation.h.

Referenced by Ammo::hitBefore().

double Simulation::getPhySpeedNum (  )  const [inline]

Time multiplier that affect the number of steps (Computes more or less steps).

  • The simulation step size (and thus the simulation frequency) remains unchanched.
  • The number of steps by seconds changes, that is to say the speed in real time is changed.
  • Affects CPU load.

Definition at line 82 of file Simulation.h.

double Simulation::getPhySpeedStep (  )  const [inline]

Time multiplier that affect the step size (Computes larger or smaller steps).

  • Affects the the simulation step size (and thus the simulation frequency).
  • The number of steps by seconds does not change, that is to say the speed in real time is not modified.
  • Affects simulation precision.
    Warning:
    Changing this parameter can cause simulation instability (such as physics 'explosions'); use with caution.

Definition at line 97 of file Simulation.h.

bool Simulation::isPaused (  )  const [inline]

Maximum delay between two frames, else consider the computer had a slowdown and do not compute physics.

Definition at line 118 of file Simulation.h.

void Simulation::pause ( bool  set = true  )  [inline]

Definition at line 119 of file Simulation.h.

void Simulation::setBasePhyStep ( double  step  )  [inline]

Definition at line 63 of file Simulation.h.

References ASSERT.

Referenced by Simulation().

void Simulation::setPhySpeedNum ( double  factor  )  [inline]

Definition at line 83 of file Simulation.h.

void Simulation::setPhySpeedStep ( double  factor  )  [inline]

Definition at line 98 of file Simulation.h.

void Simulation::togglePause (  )  [inline]

Definition at line 120 of file Simulation.h.


Member Data Documentation

double Simulation::basePhyStep [protected]

Physics base step size (Second).

Definition at line 132 of file Simulation.h.

bool Simulation::paused [protected]

Definition at line 135 of file Simulation.h.

osg::observer_ptr<SimulationCallback> Simulation::pCB

Callback called when data change.

Definition at line 123 of file Simulation.h.

double Simulation::phySpeedNum [protected]

Definition at line 133 of file Simulation.h.

double Simulation::phySpeedStep [protected]

Definition at line 134 of file Simulation.h.


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

Generated on Sun Jan 17 11:39:29 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9