Definition at line 34 of file tgSimView.h.
tgSimView::tgSimView |
( |
tgWorld & |
world, |
|
|
double |
stepSize = 1.0/1000.0 , |
|
|
double |
renderRate = 1.0/60.0 |
|
) |
| |
The only constructor..
- Parameters
-
[in] | world | a reference to the tgWorld being simulated. |
[in] | stepSize | the time interval for advancing the simulation; std::invalid_argument is thrown if not positive |
[in] | renderRate | the time interval for updating the graphics; std::invalid_argument is thrown if less than stepSize |
- Exceptions
-
std::invalid_argument | if stepSize is not positive or renderRate is less than stepSize |
Definition at line 36 of file tgSimView.cpp.
void tgSimView::bindToSimulation |
( |
tgSimulation & |
simulation | ) |
|
|
protected |
Called by a constructor of friend class tgSimulation when an instance of this class is passed as argument to the constructor. Cache a back pointer to the tgSimulation
- Parameters
-
[in,out] | simulation | a reference to the tgSimulation being constructed |
- Exceptions
-
std::invalid_argument | if the tgSimView already has a back pointer. |
Definition at line 77 of file tgSimView.cpp.
void tgSimView::bindToWorld |
( |
tgWorld & |
world | ) |
|
|
protected |
double tgSimView::getRenderRate |
( |
| ) |
const |
|
inline |
Return the interval in seconds at which the graphics are rendered.
- Returns
- the interval in seconds at which the graphics are rendered
Definition at line 118 of file tgSimView.h.
double tgSimView::getStepSize |
( |
| ) |
const |
|
inline |
Return the interval in seconds at which the graphics are rendered.
- Returns
- the interval in seconds at which the graphics are rendered
Definition at line 133 of file tgSimView.h.
bool tgSimView::isInitialzed |
( |
| ) |
const |
|
inlineprotected |
- Todo:
- Get rid of this. May only be possible once we're no longer using GLUT
Definition at line 162 of file tgSimView.h.
void tgSimView::releaseFromSimulation |
( |
| ) |
|
|
protected |
void tgSimView::render |
( |
| ) |
const |
|
virtual |
void tgSimView::reset |
( |
| ) |
|
|
virtual |
void tgSimView::run |
( |
int |
steps | ) |
|
|
virtual |
void tgSimView::setRenderRate |
( |
double |
renderRate | ) |
|
Set the interval in seconds at which the graphics are to be rendered. It is set to the minimum of the renderRate argument and the current step size.
- Parameters
-
[in] | renderRate | the interval in seconds at which the graphics are to be rendered |
Definition at line 188 of file tgSimView.cpp.
void tgSimView::setStepSize |
( |
double |
stepSize | ) |
|
Set the interval in seconds at which the simulation is advanced. The render rate is adjusted to be no less than stepSize.
- Parameters
-
[in] | stepSize | the interval in seconds at which the simulation is advanced; std::invalid_argument is thrown if stepSize is not positive |
- Exceptions
-
std::invalid_argument | if stepSize is not positive |
Definition at line 196 of file tgSimView.cpp.
void tgSimView::setup |
( |
| ) |
|
|
virtual |
void tgSimView::teardown |
( |
| ) |
|
|
virtual |
Return a reference to the tgWorld being simulated.
- Returns
- a reference to the tgWorld being simulated
Definition at line 65 of file tgSimView.h.
An object that knows how to visit the various models for rendering or data logging.
- Note
- This is a pointer to avoid #including the header file.
Definition at line 179 of file tgSimView.h.
A back pointer to the simulation that owns this view. Made protected to allow tgSimulatorWithGraphics to inherit it. The constructor initializes it to NULL and it becomes non-NULL when added to a simulation.
Definition at line 172 of file tgSimView.h.
double tgSimView::m_renderRate |
|
protected |
The interval in seconds at which the graphics are rendered. It must be be greater than or equal to m_stepSize. Note that Bullet is set to render at 60 hz (60 fps), so changing this from 60 may cause the simulation to run faster or slower than real time.
- Todo:
- See about maintaining real time simulation with a different rendering rate
Definition at line 199 of file tgSimView.h.
double tgSimView::m_renderTime |
|
protected |
The time in seconds when the next render should be. It must be non-negative.
Definition at line 205 of file tgSimView.h.
double tgSimView::m_stepSize |
|
protected |
The interval in seconds at which the simulation is advanced. It must be positive and it must be less than or equal to m_renderRate. Typically between 1/1000 and 1/4000 will run close to real time. Slower simulations will run faster but be less accurate.
Definition at line 188 of file tgSimView.h.
The documentation for this class was generated from the following files: