Creates a new PhysicsSystem.
The event bus to dispatch collision events.
Continuous Collision Detection (CCD) threshold, as a multiple of a body's broad radius.
Set to Infinity to disable CCD entirely.
The fixed time step for physics calculations (e.g. 1/60).
Global gravity vector (default: -9.81 on Y)
Active Physics Joints / Constraints tracked directly by the system.
Maximum delta time allowed per frame.
Maximum number of sub-steps per frame to prevent spiral of death.
Number of iterative solver iterations per substep for stacking stability & constraint relaxation (default: 4).
How far the accumulator has progressed into the next fixed timestep [0, 1).
Steps the physics simulation forward. /** Adds a joint to the physics simulation.
Renders every tracked rigid body's transform interpolated between previous and current physics states.
Resets and clears the broadphase tree, active pairs, and trigger/collision tracking state.
Clears all joints tracked by the system.
Returns a stable integer ID for any Collidable object.
Uses collider.id if defined, or assigns a stable internal ID.
Casts a ray against all active colliders in the scene, returning the closest hit.
The ray to cast.
Maximum travel distance (default: Infinity).
32-bit collision layer mask filter (default: 0xFFFFFFFF).
OptionaloutHit: RaycastHit
Optional RaycastHit object receiving the hit details.
If true, ignores sensor/trigger colliders (default: true).
RaycastHit or null if nothing was hit within maxDistance.
Casts a ray against all active colliders and returns all hits sorted by distance ascending.
The ray to cast.
Maximum travel distance.
32-bit collision layer mask filter.
OptionaloutHits: RaycastHit[]
Optional array receiving the results.
If true, ignores sensor/trigger colliders.
Array of RaycastHit objects sorted by distance ascending.
Sweeps a sphere along a direction vector against all active colliders in the scene.
Starting center position of the swept sphere.
Radius of the sphere.
Direction vector of the sweep.
Maximum travel distance along direction.
32-bit collision layer mask filter (default: 0xFFFFFFFF).
OptionaloutHit: RaycastHit
Optional RaycastHit object receiving the hit details.
If true, ignores sensor/trigger colliders (default: true).
RaycastHit or null if no obstacle was struck.
Advances the physics simulation for a given Scene by delta time dt.
Automatically executes fixed-timestep sub-steps to preserve determinism and numerical stability.
The scene containing objects with RigidBodies.
Delta time in seconds.
A lightweight physics solver using Semi-Implicit Euler integration and spatial broadphase acceleration.