Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

data/physical-materials/

A physical material: the bulk properties rigid-body physics needs, in SI units. Density gives a body its mass, friction and restitution decide how contacts slide and bounce, and the impact profile decides when a contact is an impact event and which sound it plays. Blocks, collider parts and assembly cells name materials by key. The engine declares manifold:default, manifold:stone, manifold:earth, manifold:wood, manifold:metal, manifold:glass, manifold:plant, manifold:snow and manifold:ice, which mods may patch. Loaded by both sides and covered by the data hash.

Registrymanifold:physical-material
Filesdata/physical-materials/*.ron, *.update.ron, *.final.ron
Sidesboth: the server and every client load it, and the handshake’s data hash covers it
Readsnothing
ContractPhysics runtime (docs/architecture/physics-runtime.md), data stage

Entry

A record, written PhysicalMaterial(..); the name before the parentheses is optional.

FieldTypeRequiredDefaultDescription
idstringyesThe material’s key, <mod-id>:<name>.
densityf32yesDensity, kg/m³, above 0. A 1 m³ block at 1000 weighs one tonne.
frictionf32yesFriction, at least 0. A contact uses the lower of its two materials’.
restitutionf32yesRestitution (bounciness), 0 to 1. A contact uses the higher of its two materials’.
impactImpactProfileno1 m/s, no soundWhen a contact is an impact, and its sound.

Example

From tools/test-mods/delivery-probe/data/physical-materials/delivery.ron:

PhysicalMaterial(id: "delivery-probe-mod:rubber", density: 1100.0, friction: 0.9, restitution: 0.8)

Types

ImpactProfile

How a material’s contacts become impact events and cues.

A record: ImpactProfile(..) or (..).

FieldTypeRequiredDefaultDescription
min_event_speedf32no1.0The approach speed, m/s, below which a contact is not an impact. A pair uses the lower of its two materials’.
soundstring or NonenononeThe impact’s sound cue key, which the client resolves.