ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
PhysicsSimulator Class Reference

Manages physics simulations for objects within a scene. More...

#include <PhysicsSimulator.h>

Collaboration diagram for PhysicsSimulator:

Public Member Functions

 PhysicsSimulator ()
 Default constructor initializes the PhysicsSimulator.
 
SceneGetScene ()
 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.
 
BoundaryMotionSimulatorbMS
 Simulator handling boundary object interactions.
 
Scenescene
 Scene containing objects and their dynamics.
 
Light lights [6]
 Array of lights illuminating the scene.
 
Object3Dobjects [12]
 Array of objects in the simulation.
 
long previousTime
 Time of the previous simulation update.
 
bool startedSim
 Indicates if the simulation has started.
 

Detailed Description

Manages physics simulations for objects within a scene.

Definition at line 26 of file PhysicsSimulator.h.

Constructor & Destructor Documentation

◆ 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().

Member Function Documentation

◆ GetScene()

Scene * GetScene ( )

Retrieves the scene managed by the simulator.

Returns
Pointer to the Scene object.

Definition at line 47 of file PhysicsSimulator.cpp.

References scene.

◆ Update()

void Update ( Vector3D  acceleration,
Quaternion  rotation 
)

Updates the simulation with new acceleration and rotation values.

Parameters
accelerationThe acceleration vector applied to objects.
rotationThe 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.

Member Data Documentation

◆ bC

BoundaryCube bC
private

Boundary cube to contain and interact with objects.

Definition at line 28 of file PhysicsSimulator.h.

Referenced by PhysicsSimulator().

◆ bMS

Simulator handling boundary object interactions.

Definition at line 29 of file PhysicsSimulator.h.

Referenced by PhysicsSimulator(), and Update().

◆ lights

Light lights[6]
private

Array of lights illuminating the scene.

Definition at line 31 of file PhysicsSimulator.h.

Referenced by PhysicsSimulator().

◆ objects

Object3D* objects[12]
private

Array of objects in the simulation.

Definition at line 32 of file PhysicsSimulator.h.

Referenced by PhysicsSimulator(), and Update().

◆ previousTime

long previousTime
private

Time of the previous simulation update.

Definition at line 34 of file PhysicsSimulator.h.

Referenced by Update().

◆ scene

Scene* scene
private

Scene containing objects and their dynamics.

Definition at line 30 of file PhysicsSimulator.h.

Referenced by GetScene(), and PhysicsSimulator().

◆ startedSim

bool startedSim
private

Indicates if the simulation has started.

Definition at line 35 of file PhysicsSimulator.h.

Referenced by Update().


The documentation for this class was generated from the following files: