Schemas / Simulation

rig.sim.joint

v1.0.0 · stable maturity: draft 18 fields 3 required

Fields

FieldTypeMeaning
kind enumfixed · hinge · distance · spring · slider · ball required fixed, hinge, distance, spring, slider, ball
a entity required First body
b entity required Second body
anchorA vec3 optional Optional. Anchor in a's local space; absent = origin
anchorB vec3 optional Optional. Anchor in b's local space; absent = origin
axis vec3 optional Optional. Hinge or slider axis in a's local space; absent = local +Y
min float optional Optional. Lower limit. Degrees for hinge, distance for distance / slider. Absent = unlimited
max float optional Optional. Upper limit, same units as min. Absent = unlimited
stiffness float optional Optional. Spring stiffness. Meaningful for spring
damping float optional Optional. Spring damping. Meaningful for spring
breakForce float optional Optional. Impulse that breaks the joint. Absent = unbreakable
collideConnected bool optional Optional. The two bodies also collide; absent = false
mimic entity optional Optional. Joint this one follows
mimicMultiplier float optional Optional. Scale on the followed joint's position. Absent = 1
mimicOffset float optional Optional. Added after the scale. Same units as min. Absent = 0
swingDegrees number0 – * optional Optional. Cone from the rest pose. Meaningful for ball. Absent = unlimited
position float optional Optional. Joint coordinate at load. Degrees for hinge, scene units for slider and distance. Absent = the pose implied by the two transforms
velocity float optional Optional. Rate of position at load. Degrees per second, or scene units per second. Absent = at rest

Constraint between two bodies. Format when present.

Limits and break thresholds are authored intent. A host that cannot represent a kind skips that joint. A host that finds a mimic cycle skips the mimic. A drive on this joint is rig.sim.actuator.

ball has no single axis and no single position. Its pose is the child transform. swingDegrees is the cone a host may enforce. A fixed joint has no position.

position and velocity are the joint when the document is loaded, the same bargain as a body's velocity. A save of a running robot writes them so another host can continue.

JSON Schema

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

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.sim.joint.schema.json",
  "title": "rig.sim.joint",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "fixed",
        "hinge",
        "distance",
        "spring",
        "slider",
        "ball"
      ]
    },
    "a": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    },
    "b": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    },
    "anchorA": {
      "$ref": "./_defs.schema.json#/$defs/vec3"
    },
    "anchorB": {
      "$ref": "./_defs.schema.json#/$defs/vec3"
    },
    "axis": {
      "$ref": "./_defs.schema.json#/$defs/vec3"
    },
    "min": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "max": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "stiffness": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "damping": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "breakForce": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "collideConnected": {
      "$ref": "./_defs.schema.json#/$defs/bool"
    },
    "mimic": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    },
    "mimicMultiplier": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "mimicOffset": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "swingDegrees": {
      "type": "number",
      "minimum": 0
    },
    "position": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "velocity": {
      "$ref": "./_defs.schema.json#/$defs/float"
    }
  },
  "required": [
    "kind",
    "a",
    "b"
  ],
  "x-rig-maturity": "draft"
}

Seen in

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