Schemas / Simulation

rig.sim.rigidbody

v0.31.0 · draft 4 fields 0 required

Fields

FieldTypeMeaning
velocity vec3 optional Optional. Initial velocity, units per second; absent = at rest
mass float optional Optional. Mass; must be greater than 0; absent = 1
drag number0 – 1 optional Optional. 0-1, fraction of velocity lost per second; absent = 0
gravity vec3 optional Optional. Per-body acceleration, units per second squared; absent = the host's ambient gravity

Point-mass physics constants. Format when present.

gravity is an override, not a required constant. A host that keeps one gravity vector for the whole simulation omits the field and applies its own; a host with per-body gravity writes it.

These are authored initial conditions, not live state. Position is integrated into rig.spatial.transform as the simulation runs, so a document saved mid-run captures where things are, and velocity still reads as where they started.

That means a simulation is not resumable across hosts. Reloading gives the same scene with the bodies re-launched, not the run frozen and continued. Rig carries the setup; the trajectory belongs to whoever integrates it.

Collision shapes, restitution, friction, and constraints are deliberately absent. No two engines agree on them closely enough for the numbers to mean the same thing twice.

JSON Schema

Resolves at https://rig.works/schemas/rig.sim.rigidbody.schema.jsonraw file.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.sim.rigidbody.schema.json",
  "title": "rig.sim.rigidbody",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "velocity": {
      "$ref": "./_defs.schema.json#/$defs/vec3"
    },
    "mass": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "drag": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "gravity": {
      "$ref": "./_defs.schema.json#/$defs/vec3"
    }
  }
}