Crate physics

Source
Expand description

Original rigid-body simulation for the recovered Ferravex games.

Primitive parts have analytical mass and angular inertia. Bodies can own locally transformed primitive parts and fixed, hinge, distance or spring connections. Capsule/cylinder contact pairs remain limited to the documented primitive matrix. This is a small native solver, not a compatibility implementation of Rapier.

Modules§

assembly
Bounded mechanisms inserted only after every ordinary error is preflighted.
character
Kinematic upright capsules and planar boxes, shared by games and prediction. Positive Y is up. Positions are feet/sole centers. Move terrain first, then motors.
d2
d3
radial
Allocation-free radial impulses selected by the existing direct-overlap query.
triggers
Bounded, opt-in sensor occupancy derived from accepted ContactEvents.

Structs§

BodySet
BodySleepState
A copied, current sleep snapshot for a live body; no solver state is exposed for mutation. The dimensional world’s sleep_state method includes a handle-checked example.
BreakLimits
Collider
ColliderHandle
ColliderSet
ContactManifold
ContactPair
Contacts include transient impacts from all substeps of the latest outer step.
ContactPoint
Diagnostics for a persistent contact. Anchors are in each body’s local space; normal and tangent impulse are in world space at the last solved substep.
ImpactRecord
One canonical generational collider pair’s strongest accepted point solve in the latest outer step, including contacts absent from the final cache. Read these through the dimensional world’s impacts method after opting in with set_impact_settings.
ImpactSettings
Observation thresholds only; these never change solver tolerances or impulses. The dimensional PhysicsWorld::set_impact_settings method documents an example using inferred defaults.
Joint
JointBreakEvent
JointDesc
JointHandle
JointLoad
Conservative sums of absolute constraint row forces/torques, avoiding cancellation between opposing rows. Units are newtons and newton-meters.
JointMotor
JointSet
MassProperties
Checked body-local mass and inertia, computed using the solver’s formulas.
MassPropertyError
A mass-construction failure, with the zero-based input child when known.
PhysicsMaterial
Authored collider coefficients, or effective coefficients from a material pair.
RigidBodyHandle
Rotation2
A planar rotation, measured in radians.
SleepStats
Current dynamic-body counts, each bounded by the world’s 4096-body limit. This is an allocation-free snapshot, not a cumulative event history or the last-step island report. See the dimensional world’s sleep_stats method for an example.
SolverSettings
Solver settings are validated and installed transactionally through the world.
StepStats

Enums§

BodyValidationError
The first invalid field encountered by checked rigid-body authoring.
CombineError
Why a checked scalar combination failed.
CombineRule
A coefficient mixing rule, in increasing priority order: Average < Geometric < Minimum < Maximum < Multiply.
ContactEvent
Changes to the set of pairs observed during consecutive valid outer steps. Both physical contacts and sensor overlaps count. Changing sensor status alone does not restart an overlap, provided the pair remains collision-eligible. Handles retain their original generations, including in removal stop events.
ImpactRecordingError
Transactional impact configuration failure; the previous settings and snapshot remain intact. Successful reservation before a later allocation failure may retain additional unused capacity for reuse.
JointKind
JointValidationError
The first invalid field in a joint description or live configuration.
MassPropertyIssue
Why checked mass construction failed.
MaterialError
Material authoring failed before any collider was changed.
PhysicsError

Constants§

MAX_CHILDREN
MAX_COLLIDERS
MAX_IMPACT_RECORDS
Maximum logical outer-step impact records. Recording is disabled by default. Call set_impact_settings through the dimensional PhysicsWorld; its method documentation includes preparation and a runnable recipe.
MAX_JOINTS