Prowl’s physics system is powered by Jitter2, a high-performance double-precision rigid-body simulation library. The staticDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl/llms.txt
Use this file to discover all available pages before exploring further.
Physics class acts as the bridge between your game code and the underlying Jitter2.World, driving the simulation forward every frame via SceneManager and exposing ray-casting, layer filtering, and force application APIs that feel natural alongside the rest of the engine. Everything from gravity to solver iterations is surfaced through a project-wide PhysicsSetting singleton so you can tune the entire simulation from a single place without touching code.
Physics Settings
PhysicsSetting is a ScriptableSingleton stored in your project settings. It controls every global parameter of the Jitter2 world.
| Property | Type | Default | Description |
|---|---|---|---|
Gravity | Vector3 | (0, -9.81, 0) | World gravity vector applied to every non-static body. |
SolverIterations | int | 6 | Position-solver passes per step (1–16). Higher = more accurate stacks. |
RelaxIterations | int | 4 | Velocity-solver relaxation passes (0–16). |
Substep | int | 1 | Physics sub-steps per frame tick (1–16). More sub-steps improve tunnelling resistance. |
TargetFrameRate | int | 50 | The target fixed-update rate (5–120 Hz). Sets Time.fixedDeltaTime. |
AllowSleep | bool | true | Allows inactive bodies to deactivate and skip simulation. |
UseMultithreading | bool | true | Spreads the Jitter2 step across available CPU cores. |
AutoSyncTransforms | bool | true | Writes the GameObject Transform into the rigid body before each step. |
PhysicsSetting is serialised to PhysicsSettings.projsetting inside your project’s settings folder. Changes take effect immediately at runtime — you do not need to restart the editor.The Physics World
The engine exposes the live Jitter2 world throughPhysics.World. You rarely need to touch it directly, but it is useful for advanced integrations such as custom constraints or querying body state.
Physics.Update() is called automatically by SceneManager once per frame. It accumulates Time.deltaTime, then steps the simulation in fixed-size increments of Time.fixedDeltaTime, up to a maximum of 10 catch-up steps to avoid the spiral-of-death.
Rigidbody3D Component
Rigidbody3D is the component that registers a GameObject with the physics world. Add it to any object that should move under physics forces. At least one Collider component must also be present on the same GameObject (or a child) to give the body a physical shape.
Add Rigidbody3D
In the editor, select your
GameObject and click Add Component → Physics → Rigidbody3D. The body is registered with Physics.World as soon as the component is enabled.Configure mass and material
Set
Mass (kg), Friction (0–1), and Restitution (0–1 bounciness) in the Inspector or at runtime via code.Key Properties
Applying Forces
Raycasting
Physics provides six Raycast overloads covering all common use cases. The direction vector is normalised automatically.
- Boolean check
- Hit info
- Distance-limited
- Layer-masked
Returns
true if any collider is hit — no allocation, fastest option.RaycastHit Fields
Layer Collision Matrix
Prowl uses a symmetric 32×32 boolean matrix (stored inPhysicsSetting) to determine which physics layers can collide with each other. Use Physics.SetLayerCollision to configure layer interactions at runtime or in your game initialisation code.
LayerFilter broadcast-phase filter reads this matrix before any narrow-phase work, so filtered-out pairs incur almost zero CPU cost.
Practical Examples
Ground check with downward raycast
Ground check with downward raycast
Shooting a projectile ray
Shooting a projectile ray
Applying a jump impulse
Applying a jump impulse