Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
trax::Simulated Struct Referenceabstract

A simulated object. Register the object with a scene to get called back for Update, Pause, Resume and Stop. More...

#include <C:/Trend/Development/Trax3/Code/trax/Simulated.h>

Inheritance diagram for trax::Simulated:

Public Member Functions

virtual bool Start (Scene &scene)=0
 Called if the simulation is started.
virtual void Idle ()=0
 Called during the simulation calculations, to perform tasks foreign to the physical simulation.
virtual void Update (Time dt=fixed_timestep)=0
 Called to update the simulated object after the simuation step finishes.
virtual void Pause () noexcept=0
 Called if the simulation is paused.
virtual void Resume () noexcept=0
 Called if the simulation is resumed after pause.
virtual void Stop () noexcept=0
 Called if the simulation is stopped.

Detailed Description

A simulated object. Register the object with a scene to get called back for Update, Pause, Resume and Stop.

Member Function Documentation

◆ Idle()

virtual void trax::Simulated::Idle ( )
pure virtual

Called during the simulation calculations, to perform tasks foreign to the physical simulation.

This is meant for precalculating values for the next frame, but is not allowed to acces simulation data: no read/write poses or velocities of Bodies and Shapes or creation/deletion of objects created from the Scene interface.

◆ Start()

virtual bool trax::Simulated::Start ( Scene & scene)
pure virtual

Called if the simulation is started.

Parameters
sceneThe scene the simulation is started in.
Returns
true if the simulated object wants to get called back for Update, Pause, Resume and Stop.

◆ Update()

virtual void trax::Simulated::Update ( Time dt = fixed_timestep)
pure virtual

Called to update the simulated object after the simuation step finishes.

Parameters
dtThe time step to update the object with.

The documentation for this struct was generated from the following file: