30#include "trax/Configuration.h"
31#include "trax/Identified.h"
32#include "trax/Units.h"
34#include "spat/Frame.h"
71 struct Scene : Identified<Scene>
74 static dclspc std::unique_ptr<Scene>
Make(
const Simulator& simulator )
noexcept;
78 virtual const char*
TypeName() const noexcept = 0;
84 virtual
bool IsValid(
bool bSilent = true ) const noexcept = 0;
134 virtual
void Simulate() = 0;
136 virtual
void Simulate(
Time forTimePeriod ) = 0;
186 virtual
void Stop() noexcept = 0;
189 virtual
std::unique_ptr<
Body> CreateBody() const = 0;
191 virtual
std::unique_ptr<
Shape> CreateShape() const = 0;
193 virtual
std::unique_ptr<
Gestalt> CreateGestalt() const = 0;
199 virtual
std::unique_ptr<
GeomCuboid> CreateGeomCuboid() const = 0;
203 virtual
std::unique_ptr<
GeomCapsule> CreateGeomCapsule() const = 0;
205 virtual
std::unique_ptr<
GeomSphere> CreateGeomSphere() const = 0;
209 virtual
std::unique_ptr<
GeomMesh> CreateGeomConvexMesh() const = 0;
211 virtual
std::unique_ptr<
GeomMesh> CreateGeomTriangleMesh() const = 0;
239 const
Body& bodyMoving,
243 const
Body& bodyMoving,
245 const
Body& bodyTrack ) noexcept = 0;
248 const
Body& bodyMoving,
252 const
Body& bodyMoving,
254 const
Body& bodyTrack ) noexcept = 0;
273 virtual ~
Scene() = default;
Class with minimal functionality to support a track joint on a track system.
Definition TrackJointFeeder.h:43
Class with functionality to support a track joint on a track system. Provides a model for friction,...
Definition TrackJointFeeder.h:198
Value< Dimension< 0, 0, 0 > > One
Dimensionless value.
Definition DimensionedValues.h:319
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
Value< Dimension< 0, 1, 0 > > Mass
Mass.
Definition DimensionedValues.h:327
Value< Dimension< 0, 0, 1 > > Time
Time.
Definition DimensionedValues.h:329
Value< Dimension< 1, 0, -2 > > Acceleration
Acceleration.
Definition DimensionedValues.h:332
The namespace provides classes and methods for spatial computations.
Definition Box.h:32
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
GeomType
Type of a geom.
Definition GeomType.h:33
constexpr Time fixed_timestep
The fixed timestep to use with the simulation.
Definition Units.h:136
Axis aligned box.
Definition Box.h:41
A Frame ("TNBFrame") describes a location in 3d space and an orientation using a right handed coordin...
Definition Frame.h:52
Implements a 3D - vector in cartesian coordinates.
Definition Vector.h:48
A dynamic object in physical space.
Definition Body.h:44
A Capsule is a Cylinder with round caps.
Definition Geom.h:220
Rectangular cuboid shape.
Definition Geom.h:182
Cylinder shaped Geom.
Definition Geom.h:201
A Geom is used for collision detection. It differs from a Shape in that it defines the most simple el...
Definition Geom.h:50
A sphere shaped Geom.
Definition Geom.h:240
A Gestalt is a Body with a Shape.
Definition Gestalt.h:100
A jack a plug can get connected with.
Definition Jack.h:83
A MultiPlug provides a variable number of actual Plugs to one input slot.
Definition Plug.h:307
A physical simulation scene for running a simulation and creating physical objects in the scene.
Definition Scene.h:72
virtual void Resume() noexcept=0
Resumes the simulation.
static dclspc std::unique_ptr< Scene > Make(const Simulator &simulator) noexcept
Makes a Scene object.
virtual void Gravity(const spat::Vector< Acceleration > &gravityAccelerarion)=0
Sets the vector of gravity acceleration.
virtual void Step(Time dt=fixed_timestep)=0
Completes one simulation step.
virtual void Register(Simulated &simulated)=0
Registers a Simulated object for simulation.
virtual void Stop() noexcept=0
Stops the simulation loop.
virtual struct Jack & JackOnSimulationStep() noexcept=0
A Jack that triggers a pulse once a simulation step.
virtual void Up(const spat::Vector< One > &up)=0
Sets the up direction for this simulator.
virtual void BeginSimulation() noexcept=0
Prepares the simulation to start.
virtual void Unregister(const Simulated &simulated)=0
Unregisters a Simulated object from simulation.
virtual bool IsValid(bool bSilent=true) const noexcept=0
Checks whether the scene is valid.
virtual struct MultiPlug & PlugToStop() noexcept=0
A Plug that stops a running simulation.
virtual Time SimulationTime() const noexcept=0
virtual void DumpTasksTo(std::ostream &stream) const noexcept=0
Dumps information about all tasks to the given stream.
virtual void EndSimulation() noexcept=0
Cleans up after the simulation ends.
virtual void Loop(Time forTimePeriod)=0
Steps the simulation by fixed_timestep until forTimePeriod expires.
virtual const char * TypeName() const noexcept=0
virtual void UnregisterAllSimulated()=0
Unregisters all Simulated objects from simulation.
virtual void Pause() noexcept=0
Pauses the simulation.
virtual bool IsSimulationRunning() const noexcept=0
A Shape is a collection of Geoms.
Definition Shape.h:41
A simulated object. Register the object with a scene to get called back for Update,...
Definition Simulated.h:39
Interface for the physics simulator.
Definition Simulator.h:59