PhysicsOptions Class
Configuration for PhysicsWorld creation.
public class PhysicsOptions
Inheritance System.Object → PhysicsOptions
| Properties | |
|---|---|
| ContactHitEventThreshold | Minimum closing speed (pixels/s) at which a contact fires OnCollisionHit. Set to 0 to fire on every contact. Leave null to use the Box2D default. |
| ContinuousEnabled | Whether world-level continuous collision detection is enabled. Default is true. |
| CustomCollisionFilter | An optional world-level collision filter applied to every candidate contact pair. Return false to prevent the pair from colliding or triggering. |
| Gravity | World gravity in pixels per second squared. Default: (0, 980) ≈ 9.8 m/s² at 100 px/m. |
| MaxLinearSpeed | Maximum linear speed (pixels/s) any body can reach. Leave null to use the Box2D default. |
| PixelsPerMeter | Pixel-to-meter ratio passed to B2.SetLengthUnitsPerMeter. Default: 100 (1 meter = 100 pixels). |
| PreSolveFilter | An optional pre-solve filter invoked by the Box2D solver for every active contact pair each step. Return false to cancel the contact for that step. Primary use-case: one-way platforms. See PreSolveContact for details. |
| RestitutionThreshold | Minimum impact speed (pixels/s) required for restitution (bounciness) to be applied. Below this threshold contacts are treated as inelastic. Leave null to use the Box2D default. |
| SleepingEnabled | Whether body sleeping is enabled. Default is true. |
| SubStepCount | Number of Box2D sub-steps per fixed-update tick. Must be at least 1. Default is 4. |