-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change OMI_physics_joint to be more like KHR/MSFT physics
- Loading branch information
1 parent
f0733c8
commit 97a6b59
Showing
21 changed files
with
1,322 additions
and
4,346 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
757 changes: 141 additions & 616 deletions
757
extensions/2.0/OMI_physics_joint/examples/hanging_rope.gltf
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
1,102 changes: 194 additions & 908 deletions
1,102
extensions/2.0/OMI_physics_joint/examples/pendulum_balls.gltf
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
-135 KB
(84%)
extensions/2.0/OMI_physics_joint/examples/pendulum_balls0.bin
Binary file not shown.
1,283 changes: 239 additions & 1,044 deletions
1,283
extensions/2.0/OMI_physics_joint/examples/rope_railing.gltf
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
500 changes: 100 additions & 400 deletions
500
extensions/2.0/OMI_physics_joint/examples/simple_joint.gltf
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
418 changes: 70 additions & 348 deletions
418
extensions/2.0/OMI_physics_joint/examples/slider_ball.gltf
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
535 changes: 94 additions & 441 deletions
535
extensions/2.0/OMI_physics_joint/examples/swing_and_slide.gltf
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
-45.1 KB
(84%)
extensions/2.0/OMI_physics_joint/examples/swing_and_slide0.bin
Binary file not shown.
506 changes: 104 additions & 402 deletions
506
extensions/2.0/OMI_physics_joint/examples/weld_joint.gltf
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
78 changes: 78 additions & 0 deletions
78
extensions/2.0/OMI_physics_joint/schema/glTF.OMI_physics_joint.joint.drive.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} |
63 changes: 63 additions & 0 deletions
63
extensions/2.0/OMI_physics_joint/schema/glTF.OMI_physics_joint.joint.limit.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
extensions/2.0/OMI_physics_joint/schema/glTF.OMI_physics_joint.joint.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": { } | ||
} | ||
} |
42 changes: 0 additions & 42 deletions
42
extensions/2.0/OMI_physics_joint/schema/glTF.OMI_physics_joint.joint_constraint.schema.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 13 additions & 21 deletions
34
extensions/2.0/OMI_physics_joint/schema/node.OMI_physics_joint.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |