Skip to content

Commit

Permalink
Change OMI_physics_joint to be more like KHR/MSFT physics
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronfranke committed Sep 3, 2024
1 parent f0733c8 commit 3895df4
Show file tree
Hide file tree
Showing 21 changed files with 1,324 additions and 4,344 deletions.
314 changes: 196 additions & 118 deletions extensions/2.0/OMI_physics_joint/README.md

Large diffs are not rendered by default.

757 changes: 141 additions & 616 deletions extensions/2.0/OMI_physics_joint/examples/hanging_rope.gltf

Large diffs are not rendered by default.

Binary file modified extensions/2.0/OMI_physics_joint/examples/hanging_rope0.bin
Binary file not shown.
1,102 changes: 194 additions & 908 deletions extensions/2.0/OMI_physics_joint/examples/pendulum_balls.gltf

Large diffs are not rendered by default.

Binary file modified extensions/2.0/OMI_physics_joint/examples/pendulum_balls0.bin
Binary file not shown.
1,283 changes: 239 additions & 1,044 deletions extensions/2.0/OMI_physics_joint/examples/rope_railing.gltf

Large diffs are not rendered by default.

Binary file modified extensions/2.0/OMI_physics_joint/examples/rope_railing0.bin
Binary file not shown.
500 changes: 100 additions & 400 deletions extensions/2.0/OMI_physics_joint/examples/simple_joint.gltf

Large diffs are not rendered by default.

Binary file modified extensions/2.0/OMI_physics_joint/examples/simple_joint0.bin
Binary file not shown.
418 changes: 70 additions & 348 deletions extensions/2.0/OMI_physics_joint/examples/slider_ball.gltf

Large diffs are not rendered by default.

Binary file modified extensions/2.0/OMI_physics_joint/examples/slider_ball0.bin
Binary file not shown.
535 changes: 94 additions & 441 deletions extensions/2.0/OMI_physics_joint/examples/swing_and_slide.gltf

Large diffs are not rendered by default.

Binary file modified extensions/2.0/OMI_physics_joint/examples/swing_and_slide0.bin
Binary file not shown.
506 changes: 104 additions & 402 deletions extensions/2.0/OMI_physics_joint/examples/weld_joint.gltf

Large diffs are not rendered by default.

Binary file modified extensions/2.0/OMI_physics_joint/examples/weld_joint0.bin
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "glTF.OMI_physics_joint.drive.schema.json",
"title": "OMI_physics_joint Physics Joint Drive",
"type": "object",
"description": "Parameters describing a drive or motor which applies forces within a joint.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"type": {
"description": "Determines the degree of freedom which this drive controls.",
"anyOf": [
{
"const": "linear",
"description": "The drive applies a linear force along the driven axis."
},
{
"const": "angular",
"description": "The drive applies a torque about the driven axis."
},
{
"type": "string"
}
]
},
"mode": {
"description": "Specifies the force calculation mode.",
"anyOf": [
{
"const": "force",
"description": "Value computed from the spring equation is the force to apply along the axis."
},
{
"const": "acceleration",
"description": "Value computed from the spring equation is the acceleration to apply along the axis."
},
{
"type": "string"
}
]
},
"axis": {
"type": "integer",
"minimum": 0,
"maximum": 2,
"description": "The index of the axis which this drive applies forces on."
},
"maxForce": {
"type": "number",
"description": "The maximum force (or torque, for angular drives) the drive can apply. If not provided, this drive is not force-limited.",
"minimum": 0
},
"positionTarget": {
"type": "number",
"description": "The target translation/angle along the axis that this drive attempts to achieve."
},
"velocityTarget": {
"type": "number",
"description": "The target velocity along/about the axis that this drive attempts to achieve."
},
"stiffness": {
"type": "number",
"description": "The stiffness of the drive, scaling the force based on the position target.",
"default": 0,
"minimum": 0
},
"damping": {
"type": "number",
"description": "The damping of the drive, scaling the force based on the velocity target.",
"default": 0,
"minimum": 0
}
},
"required": [
"type",
"mode",
"axis"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "glTF.OMI_physics_joint.limit.schema.json",
"title": "OMI_physics_joint Physics Joint Limit",
"type": "object",
"description": "Parameters describing how a joint constrains the relative motion of a pair of nodes.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"linearAxes": {
"description": "The indices of the linear axes which are limited, constraining the linear motion in 1, 2 or 3 dimensions. 1D keeps an object some distance from an infinite plane. 2D keeps an object some distance from an infinite line. 3D keeps an object some distance from a point. Can only contain 0 (X), 1 (Y), or 2 (Z), so [0, 1, 2] constrains all three axes.",
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 2
},
"minItems": 0,
"maxItems": 3,
"uniqueItems": true
},
"angularAxes": {
"description": "The indices of the angular axes which are limited, constraining the angular motion in 1, 2 or 3 dimensions. 1D limits rotation about one axis (e.g. a universal joint). 2D limits rotation about two axes (e.g. a cone). 3D limits rotation about all three axes. Can only contain 0 (X), 1 (Y), or 2 (Z), so [0, 1, 2] constrains all three axes.",
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 2
},
"minItems": 0,
"maxItems": 3,
"uniqueItems": true
},
"min": {
"type": "number",
"description": "The minimum of the allowed range of relative distance in meters, or angle in radians. If not specified, the minimum is unbounded (negative infinity). At least one of min or max should be present, or the limit is useless."
},
"max": {
"type": "number",
"description": "The maximum of the allowed range of relative distance in meters, or angle in radians. If not specified, the maximum is unbounded (positive infinity). At least one of min or max should be present, or the limit is useless."
},
"stiffness": {
"type": "number",
"description": "The stiffness strength used to calculate a restorative force when the joint is extended beyond the limit. If not present, the limit should be infinitely stiff.",
"minimum": 0.0
},
"damping": {
"type": "number",
"description": "Damping applied to the velocity when the joint is extended beyond the limit.",
"minimum": 0.0,
"default": 0.0
},
"extensions": { },
"extras": { }
},
"oneOf": [
{
"required": ["linearAxes"]
},
{
"required": ["angularAxes"]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "glTF.OMI_physics_joint.schema.json",
"title": "OMI_physics_joint Physics Joint Settings",
"type": "object",
"description": "Parameters describing joint settings, which may be referenced by nodes to constrain or drive the relative motion of pairs of nodes.",
"allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],
"properties": {
"limits": {
"type": "array",
"description": "The set of limits which constrain relative motion between a pair of nodes.",
"items": {
"type": "object",
"$ref": "glTF.OMI_physics_joint.joint.limit.schema.json"
}
},
"drives": {
"type": "array",
"description": "The set of drives applying forces to this joint. Drives include motors and springs.",
"items": {
"type": "object",
"$ref": "glTF.OMI_physics_joint.joint.drive.schema.json"
}
},
"extensions": { },
"extras": { }
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"$id": "glTF.OMI_physics_joint.schema.json",
"title": "OMI_physics_joint glTF Document Extension",
"type": "object",
"description": "Top level joint resources.",
"description": "Top level physics joint settings.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"constraints": {
"description": "An array of physics joint constraints that can be referenced by nodes.",
"physicsJoints": {
"type": "array",
"description": "An array of physics joint settings.",
"items": {
"type": "object",
"$ref": "joint_constraint.schema.json"
"$ref": "glTF.OMI_physics_joint.joint.schema.json"
},
"minItems": 1
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "node.OMI_physics_joint.schema.json",
"title": "OMI_physics_joint glTF Node Extension",
"title": "OMI_physics_joint Node Joint Property",
"type": "object",
"description": "Node extension that references a physics joint.",
"description": "Parameters describing how the relative motion of a pair of nodes is constrained.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"constraints": {
"description": "An array of ids of joint constraints that are applied to the node.",
"type": "array",
"items": {
"type": "number",
"$ref": "glTFid.schema.json"
},
"minItems": 1
"connectedNode": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The index of the node to which this is connected."
},
"nodeA": {
"description": "The id of the first node.",
"type": "number",
"$ref": "glTFid.schema.json"
"joint": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The index of the joint settings in the top level physicsJoints array."
},
"nodeB": {
"description": "The id of the second node.",
"type": "number",
"$ref": "glTFid.schema.json"
"enableCollision": {
"type": "boolean",
"description": "If true, allow the connected objects to collide. Connected objects do not collide by default.",
"default": false
},
"extensions": { },
"extras": { }
},
"required": [
"constraints"
]
"required": ["connectedNode", "joint"]
}

0 comments on commit 3895df4

Please sign in to comment.