Definition at line 53 of file tgSimViewGraphics.h.
tgSimViewGraphics::tgSimViewGraphics |
( |
tgWorld & |
world, |
|
|
double |
stepSize = 1.0/120.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 |
- Todo:
- figure out a good time to delete this
Definition at line 36 of file tgSimViewGraphics.cpp.
void tgSimView::bindToSimulation |
( |
tgSimulation & |
simulation | ) |
|
|
protectedinherited |
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 | ) |
|
|
protectedinherited |
void tgSimViewGraphics::clientMoveAndDisplay |
( |
| ) |
|
|
virtual |
void tgSimViewGraphics::clientResetScene |
( |
| ) |
|
|
virtual |
Called when the space bar is pressed. Calls reset, then updates the pointers to the world and glDebugDrawer
Definition at line 175 of file tgSimViewGraphics.cpp.
void tgSimViewGraphics::displayCallback |
( |
| ) |
|
|
virtual |
Contains a smaller set of rendering functions than clientMoveAndDisplay
Definition at line 159 of file tgSimViewGraphics.cpp.
double tgSimView::getRenderRate |
( |
| ) |
const |
|
inlineinherited |
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 |
|
inlineinherited |
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 |
|
inlineprotectedinherited |
- 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 |
( |
| ) |
|
|
protectedinherited |
void tgSimView::render |
( |
| ) |
const |
|
virtualinherited |
void tgSimViewGraphics::render |
( |
| ) |
|
void tgSimViewGraphics::reset |
( |
| ) |
|
|
virtual |
void tgSimViewGraphics::run |
( |
| ) |
|
|
inlinevirtual |
Run until user stops - currently the same as run(steps) due to use of GLUT
Reimplemented from tgSimView.
Definition at line 79 of file tgSimViewGraphics.h.
void tgSimViewGraphics::run |
( |
int |
steps | ) |
|
|
virtual |
Run for a specified number of steps. Currently performs the role of run() at this level
- Todo:
- doesn't work until FreeGLUT or another rendering engine is implemented
Reimplemented from tgSimView.
Definition at line 104 of file tgSimViewGraphics.cpp.
void tgSimView::setRenderRate |
( |
double |
renderRate | ) |
|
|
inherited |
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 | ) |
|
|
inherited |
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 tgSimViewGraphics::setup |
( |
| ) |
|
|
virtual |
void tgSimViewGraphics::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 |
|
protectedinherited |
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 |
|
protectedinherited |
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 |
|
protectedinherited |
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: