ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
PhysicsSimulator.h
Go to the documentation of this file.
1/**
2 * @file PhysicsSimulator.h
3 * @brief Defines the PhysicsSimulator class for managing physics simulations within a scene.
4 *
5 * The PhysicsSimulator class integrates boundary motion, object dynamics, and lighting
6 * to provide a cohesive simulation environment. It manages a scene with objects, boundary
7 * conditions, and physical interactions.
8 *
9 * @date 22/12/2024
10 * @version 1.0
11 * @author Coela Can't
12 */
13
14#pragma once
15
16#include "../Renderer/Lights/Light.h"
18#include "../Scene/Objects/Object3D.h"
19#include "../Utils/Math/Quaternion.h"
20#include "../Scene/Scene.h"
21
22/**
23 * @class PhysicsSimulator
24 * @brief Manages physics simulations for objects within a scene.
25 */
27private:
28 BoundaryCube bC; ///< Boundary cube to contain and interact with objects.
29 BoundaryMotionSimulator* bMS; ///< Simulator handling boundary object interactions.
30 Scene* scene; ///< Scene containing objects and their dynamics.
31 Light lights[6]; ///< Array of lights illuminating the scene.
32 Object3D* objects[12]; ///< Array of objects in the simulation.
33
34 long previousTime; ///< Time of the previous simulation update.
35 bool startedSim; ///< Indicates if the simulation has started.
36
37public:
38 /**
39 * @brief Default constructor initializes the PhysicsSimulator.
40 */
42
43 /**
44 * @brief Retrieves the scene managed by the simulator.
45 * @return Pointer to the Scene object.
46 */
47 Scene* GetScene();
48
49 /**
50 * @brief Updates the simulation with new acceleration and rotation values.
51 * @param acceleration The acceleration vector applied to objects.
52 * @param rotation The rotation quaternion applied to objects.
53 */
54 void Update(Vector3D acceleration, Quaternion rotation);
55};
Defines the BoundaryMotionSimulator class for simulating motion and collisions of boundary objects.
Represents an axis-aligned bounding cube for collision detection and physics.
Simulates motion and collision interactions between a BoundaryCube and multiple BoundarySpheres.
Represents a light source with position, intensity, and falloff properties.
Definition Light.h:22
Represents a 3D object with geometry, material, and transformation data.
Definition Object3D.h:28
Manages physics simulations for objects within a scene.
BoundaryMotionSimulator * bMS
Simulator handling boundary object interactions.
long previousTime
Time of the previous simulation update.
PhysicsSimulator()
Default constructor initializes the PhysicsSimulator.
BoundaryCube bC
Boundary cube to contain and interact with objects.
Scene * scene
Scene containing objects and their dynamics.
Scene * GetScene()
Retrieves the scene managed by the simulator.
Object3D * objects[12]
Array of objects in the simulation.
void Update(Vector3D acceleration, Quaternion rotation)
Updates the simulation with new acceleration and rotation values.
Light lights[6]
Array of lights illuminating the scene.
bool startedSim
Indicates if the simulation has started.
A mathematical construct representing a rotation in 3D space.
Definition Quaternion.h:30
Manages a collection of 3D objects and applies optional screen-space effects.
Definition Scene.h:25
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
Definition Vector3D.h:26