![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Manages physics simulations for objects within a scene. More...
#include <PhysicsSimulator.h>
Public Member Functions | |
PhysicsSimulator () | |
Default constructor initializes the PhysicsSimulator. | |
Scene * | GetScene () |
Retrieves the scene managed by the simulator. | |
void | Update (Vector3D acceleration, Quaternion rotation) |
Updates the simulation with new acceleration and rotation values. | |
Private Attributes | |
BoundaryCube | bC |
Boundary cube to contain and interact with objects. | |
BoundaryMotionSimulator * | bMS |
Simulator handling boundary object interactions. | |
Scene * | scene |
Scene containing objects and their dynamics. | |
Light | lights [6] |
Array of lights illuminating the scene. | |
Object3D * | objects [12] |
Array of objects in the simulation. | |
long | previousTime |
Time of the previous simulation update. | |
bool | startedSim |
Indicates if the simulation has started. | |
Manages physics simulations for objects within a scene.
Definition at line 26 of file PhysicsSimulator.h.
PhysicsSimulator | ( | ) |
Default constructor initializes the PhysicsSimulator.
Definition at line 3 of file PhysicsSimulator.cpp.
References bC, bMS, lights, objects, BoundaryMotionSimulator::Randomize(), scene, and Light::Set().
Scene * GetScene | ( | ) |
Retrieves the scene managed by the simulator.
Definition at line 47 of file PhysicsSimulator.cpp.
References scene.
void Update | ( | Vector3D | acceleration, |
Quaternion | rotation | ||
) |
Updates the simulation with new acceleration and rotation values.
acceleration | The acceleration vector applied to objects. |
rotation | The rotation quaternion applied to objects. |
Definition at line 51 of file PhysicsSimulator.cpp.
References bMS, Transform::GetPosition(), Object3D::GetTransform(), Mathematics::Map(), objects, previousTime, Transform::SetScale(), startedSim, BoundaryMotionSimulator::Update(), Vector3D::X, Vector3D::Y, and Vector3D::Z.
|
private |
Boundary cube to contain and interact with objects.
Definition at line 28 of file PhysicsSimulator.h.
Referenced by PhysicsSimulator().
|
private |
Simulator handling boundary object interactions.
Definition at line 29 of file PhysicsSimulator.h.
Referenced by PhysicsSimulator(), and Update().
|
private |
Array of lights illuminating the scene.
Definition at line 31 of file PhysicsSimulator.h.
Referenced by PhysicsSimulator().
|
private |
Array of objects in the simulation.
Definition at line 32 of file PhysicsSimulator.h.
Referenced by PhysicsSimulator(), and Update().
|
private |
Time of the previous simulation update.
Definition at line 34 of file PhysicsSimulator.h.
Referenced by Update().
|
private |
Scene containing objects and their dynamics.
Definition at line 30 of file PhysicsSimulator.h.
Referenced by GetScene(), and PhysicsSimulator().
|
private |
Indicates if the simulation has started.
Definition at line 35 of file PhysicsSimulator.h.
Referenced by Update().