4 : bC(
Vector3D(0, 0, 0),
Vector3D(300, 200, 100)), previousTime(0), startedSim(false) {
57 long currentTime = micros();
58 float dT = (float)(currentTime -
previousTime) / 1000000.0f;
62 bMS->
Update(dT, accelNormalized, rotation);
64 for (
int i = 0; i < 12; i++) {
Defines the PhysicsSimulator class for managing physics simulations within a scene.
Simulates motion and collision interactions between a BoundaryCube and multiple BoundarySpheres.
void Randomize(float range)
Randomizes the velocities of all boundary spheres within a specified range.
void Update(float dT, Vector3D acceleration, Quaternion rotation)
Updates the simulation by applying physics and resolving collisions.
void Set(Vector3D p, Vector3D intensity, float falloff, float a, float b)
Sets the light's properties.
static T Map(T value, T inLow, T inMax, T outMin, T outMax)
Maps a value from one range to another.
Transform * GetTransform()
Retrieves the object's transformation data.
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.
Manages a collection of 3D objects and applies optional screen-space effects.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
float Z
The Z-component of the 3D vector.
float X
The X-component of the 3D vector.
float Y
The Y-component of the 3D vector.