A physical simulation scene for running a simulation and creating physical objects in the scene.
More...
|
| virtual const char * | TypeName () const noexcept=0 |
| virtual bool | IsValid (bool bSilent=true) const noexcept=0 |
| | Checks whether the scene is valid.
|
| virtual void | Up (const spat::Vector< One > &up)=0 |
| | Sets the up direction for this simulator.
|
|
virtual spat::Vector< One > | Up () const =0 |
| | Gets the up direction for this simulator.
|
| virtual void | Gravity (const spat::Vector< Acceleration > &gravityAccelerarion)=0 |
| | Sets the vector of gravity acceleration.
|
|
virtual spat::Vector< Acceleration > | Gravity () const =0 |
| | Gets the gravity force applied with this simulator.
|
| virtual void | Register (Simulated &simulated)=0 |
| | Registers a Simulated object for simulation.
|
|
virtual void | Unregister (const Simulated &simulated)=0 |
| | Unregisters a Simulated object from simulation.
|
|
virtual void | UnregisterAllSimulated ()=0 |
| | Unregisters all Simulated objects from simulation.
|
| virtual bool | IsSimulationRunning () const noexcept=0 |
| virtual Time | SimulationTime () const noexcept=0 |
| virtual void | BeginSimulation () noexcept=0 |
| | Prepares the simulation to start.
|
| virtual void | Loop (Time forTimePeriod)=0 |
| | Steps the simulation by fixed_timestep until forTimePeriod expires.
|
|
virtual void | Step (Time dt=fixed_timestep)=0 |
| | Completes one simulation step.
|
| virtual void | EndSimulation () noexcept=0 |
| | Cleans up after the simulation ends.
|
|
virtual void | Pause () noexcept=0 |
| | Pauses the simulation.
|
|
virtual void | Resume () noexcept=0 |
| | Resumes the simulation.
|
|
virtual void | Stop () noexcept=0 |
| | Stops the simulation loop.
|
|
virtual std::unique_ptr< Body > | CreateBody () const =0 |
|
virtual std::unique_ptr< Shape > | CreateShape () const =0 |
|
virtual std::unique_ptr< Gestalt > | CreateGestalt () const =0 |
|
virtual std::unique_ptr< Gestalt > | CreateGestalt (spat::Box< Length > box, Mass mass) const noexcept=0 |
|
virtual std::unique_ptr< Geom > | CreateGeom (GeomType type) const =0 |
|
virtual std::unique_ptr< GeomCuboid > | CreateGeomCuboid () const =0 |
|
virtual std::unique_ptr< GeomCylinder > | CreateGeomCylinder () const =0 |
|
virtual std::unique_ptr< GeomCapsule > | CreateGeomCapsule () const =0 |
|
virtual std::unique_ptr< GeomSphere > | CreateGeomSphere () const =0 |
|
virtual std::unique_ptr< GeomHeightField > | CreateGeomHeightField () const =0 |
|
virtual std::unique_ptr< GeomMesh > | CreateGeomConvexMesh () const =0 |
|
virtual std::unique_ptr< GeomMesh > | CreateGeomTriangleMesh () const =0 |
|
virtual std::unique_ptr< HingeJoint > | CreateHingeJoint (Body *pBodyA, const spat::Frame< Length, One > &localAnchorA, Body *pBodyB, const spat::Frame< Length, One > &localAnchorB) const =0 |
|
virtual std::unique_ptr< SliderJoint > | CreateSliderJoint (Body *pBodyA, const spat::Frame< Length, One > &localAnchorA, Body *pBodyB, const spat::Frame< Length, One > &localAnchorB) const =0 |
|
virtual std::unique_ptr< BallAndSocketJoint > | CreateBallAndSocketJoint (Body *pBodyA, const spat::Frame< Length, One > &localAnchorA, Body *pBodyB, const spat::Frame< Length, One > &localAnchorB) const =0 |
|
virtual std::unique_ptr< DistanceJoint > | CreateDistanceJoint (Body *pBodyA, const spat::Frame< Length, One > &localAnchorA, Body *pBodyB, const spat::Frame< Length, One > &localAnchorB) const =0 |
|
virtual std::shared_ptr< TrackJointFeeder > | CreateTrackJointFeeder (const Body &bodyMoving, const spat::Frame< Length, One > &localAnchor) noexcept=0 |
|
virtual std::shared_ptr< TrackJointFeeder > | CreateTrackJointFeeder (const Body &bodyMoving, const spat::Frame< Length, One > &localAnchor, const Body &bodyTrack) noexcept=0 |
|
virtual std::shared_ptr< TrackJointFeederMotorModel > | CreateTrackJointFeederMotorModel (const Body &bodyMoving, const spat::Frame< Length, One > &localAnchor) noexcept=0 |
|
virtual std::shared_ptr< TrackJointFeederMotorModel > | CreateTrackJointFeederMotorModel (const Body &bodyMoving, const spat::Frame< Length, One > &localAnchor, const Body &bodyTrack) noexcept=0 |
|
virtual void | Release (TrackJointFeeder &feeder) noexcept=0 |
|
virtual void | DumpTasksTo (std::ostream &stream) const noexcept=0 |
| | Dumps information about all tasks to the given stream.
|
| virtual struct Jack & | JackOnSimulationStep () noexcept=0 |
| | A Jack that triggers a pulse once a simulation step.
|
|
virtual struct MultiPlug & | PlugToStop () noexcept=0 |
| | A Plug that stops a running simulation.
|
Enters a main simulation loop and simulates the scene.
The simulation is left when the simulation is stopped or the PlugToStop is triggered. - Parameters
-
| forTimePeriod | Time to run simulation for. This is meant as a convenience function to run the simulation for a certain time (e.g. for testing); to do one simulation step in a game loop use Loop() or Step() instead. |
|
|
virtual void | Simulate ()=0 |
|
virtual void | Simulate (Time forTimePeriod)=0 |
| virtual const std::string & | Reference (const std::string &name) const=0 |
| | Gets a reference that was set for this object by name.
|
|
virtual const std::vector< char const * > & | ReferenceNames (const std::string &namePart) const=0 |
| | Searches for all reference names that countain namePart as substring in the name.
|
| virtual IDType | ID () const noexcept=0 |
|
| Identified (const Identified &)=delete |
|
Identified & | operator= (const Identified &)=delete |
A physical simulation scene for running a simulation and creating physical objects in the scene.
The times given to the simulation are proper simulation times, not the time that passes for the real world. Ideally the simulation runs faster than real time. It is strongly recommended to use fixed time steps for the simulation; variable time steps will lead to instabilities. Use the Loop() method to adapt to variable time steps.