Schemas / Simulation

rig.sim.collider

v1.0.0 · stable maturity: draft 15 fields 1 required

Fields

FieldTypeMeaning
kind enumsphere · box · capsule · mesh required sphere, box, capsule, mesh
radius float optional Sphere radius, or capsule radius. Required for those kinds
height float optional Capsule height, end to end. Required when kind is capsule
halfExtents vec3 optional Box half-size. Required when kind is box
mesh entity optional Optional. Entity with rig.geometry.mesh. Absent = the mesh on this entity. Used when kind is mesh
offset vec3 optional Optional. Shape centre in the entity's local space; absent = origin
sensor bool optional Optional. Overlap reports and no response; absent = false
friction number0 – * optional Optional. Contact friction, 0 or greater; absent = the host default
restitution number0 – 1 optional Optional. Bounce, 0-1; absent = 0
restitutionThreshold float optional Optional. Minimum speed that still bounces. Absent = the host default
density number> 0 optional Optional. Mass per volume for hosts that derive mass from shapes. Must be greater than 0. Ignored when the body sets mass
layer int optional Optional. Collision layer; absent = 0
mask uint optional Optional. Bitmask of layers this shape collides with; absent = every layer
frictionCombine enumaverage · multiply · minimum · maximum optional Optional. average, multiply, minimum, maximum. How this friction mixes with the other shape. Absent = the host default
restitutionCombine enumaverage · multiply · minimum · maximum optional Optional. Same tokens, for bounce

Contact shape. Format when present. One shape on the entity; a compound is child entities.

halfExtents is half the box on each axis. A host whose shape size is the full side length halves it on the way in.

The numbers are the authored request. The solver is fulfillment: two hosts need not reproduce the same contact from the same coefficients.

Hit tests for rig.interact.selectable use this shape when it is present.

JSON Schema

Resolves at https://rig.works/schemas/rig.sim.collider.schema.json — raw file.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.sim.collider.schema.json",
  "title": "rig.sim.collider",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "sphere",
        "box",
        "capsule",
        "mesh"
      ]
    },
    "radius": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "height": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "halfExtents": {
      "$ref": "./_defs.schema.json#/$defs/vec3"
    },
    "mesh": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    },
    "offset": {
      "$ref": "./_defs.schema.json#/$defs/vec3"
    },
    "sensor": {
      "$ref": "./_defs.schema.json#/$defs/bool"
    },
    "friction": {
      "type": "number",
      "minimum": 0
    },
    "restitution": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "restitutionThreshold": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "density": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "layer": {
      "$ref": "./_defs.schema.json#/$defs/int"
    },
    "mask": {
      "$ref": "./_defs.schema.json#/$defs/uint"
    },
    "frictionCombine": {
      "type": "string",
      "enum": [
        "average",
        "multiply",
        "minimum",
        "maximum"
      ]
    },
    "restitutionCombine": {
      "type": "string",
      "enum": [
        "average",
        "multiply",
        "minimum",
        "maximum"
      ]
    }
  },
  "required": [
    "kind"
  ],
  "x-rig-maturity": "draft"
}

Seen in

play-scene.json · robot-lab.json · robot-lesson.json