-
Notifications
You must be signed in to change notification settings - Fork 1.2k
KHR_physics_rigid_bodies Draft Proposal #2424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
eoineoineoin
wants to merge
5
commits into
KhronosGroup:main
Choose a base branch
from
eoineoineoin:rigidBodyMerge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
16d0368
Merge KHR_physics_rigid_bodies draft from development repository.
eoineoineoin a651dd1
Merge various clarifications and fixes from development branch
eoineoineoin 3e4ffb1
Remove unnecessary known implementations section
eoineoineoin 66ea5bf
Merge changes from refactor of KHR_collision_shapes to KHR_implicit_s…
eoineoineoin 13ffdd2
Merge 35cc5dd4746b43bd from origin repo
eoineoineoin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
507 changes: 507 additions & 0 deletions
507
extensions/2.0/Khronos/KHR_physics_rigid_bodies/README.md
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
360 changes: 360 additions & 0 deletions
360
extensions/2.0/Khronos/KHR_physics_rigid_bodies/figures/Overview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions
38
...HR_physics_rigid_bodies/schema/glTF.KHR_physics_rigid_bodies.collision_filter.schema.json
This file contains hidden or 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,38 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "glTF.KHR_physics_rigid_bodies.collision_filter.schema.json", | ||
| "title": "KHR_physics_rigid_bodies Collision Filter", | ||
| "type": "object", | ||
| "description": "Parameters describing a parameterization of a collision filter, allowing for disabling collision between pairs of shapes.", | ||
| "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ], | ||
| "properties": { | ||
| "collisionSystems": { | ||
| "type": "array", | ||
| "description": "An array of strings representing the names of the collision systems of which this object is a member.", | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "collideWithSystems": { | ||
| "type": "array", | ||
| "description": "An array of strings representing the name of the collision systems which this object can collide with.", | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "notCollideWithSystems": { | ||
| "type": "array", | ||
| "description": "An array of strings representing the names of the collision systems which this object does not collide with.", | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "extensions": { }, | ||
| "extras": { } | ||
| }, | ||
| "not": { | ||
| "anyOf": [ | ||
| { "required": [ "collideWithSystems", "notCollideWithSystems" ] } | ||
| ] | ||
| } | ||
| } |
78 changes: 78 additions & 0 deletions
78
...nos/KHR_physics_rigid_bodies/schema/glTF.KHR_physics_rigid_bodies.joint.drive.schema.json
This file contains hidden or 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.KHR_physics_rigid_bodies.joint.drive.schema.json", | ||
| "title": "KHR_physics_rigid_bodies Physics Joint Drive", | ||
| "type": "object", | ||
| "description": "Parameters describing a drive 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": 3, | ||
| "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" | ||
| ] | ||
| } |
69 changes: 69 additions & 0 deletions
69
...nos/KHR_physics_rigid_bodies/schema/glTF.KHR_physics_rigid_bodies.joint.limit.schema.json
This file contains hidden or 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,69 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "glTF.KHR_physics_rigid_bodies.joint.limit.schema.json", | ||
| "title": "KHR_physics_rigid_bodies Physics Joint Limit", | ||
| "type": "object", | ||
| "description": "Parameters describing how the relative motion of a pair of nodes is constrained.", | ||
| "allOf": [ { "$ref": "glTFProperty.schema.json" } ], | ||
| "properties": { | ||
| "min": { | ||
| "type": "number", | ||
| "description": "The minimum of the allowed range of relative distance/angle." | ||
| }, | ||
| "max": { | ||
| "type": "number", | ||
| "description": "The maximum of the allowed range of relative distance/angle." | ||
| }, | ||
| "stiffness": { | ||
| "type": "number", | ||
| "description": "The spring constant used to calculate a restorative force when the joint is extended beyond the limit. If not present, limit should be infinitely stiff.", | ||
| "minimum": 0 | ||
| }, | ||
| "damping": { | ||
| "type": "number", | ||
| "description": "Damping applied to the velocity when the joint is extended beyond the limit.", | ||
| "minimum": 0, | ||
| "default": 0 | ||
| }, | ||
| "extensions": { }, | ||
| "extras": { } | ||
| }, | ||
| "oneOf": [ | ||
| { | ||
| "type": "object", | ||
| "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.", | ||
| "type": "array", | ||
| "items": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "maximum": 2 | ||
| }, | ||
| "minItems": 1, | ||
| "maxItems": 3, | ||
| "uniqueItems": true | ||
| } | ||
| }, | ||
| "required": ["linearAxes"] | ||
| }, | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "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.", | ||
| "type": "array", | ||
| "items": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "maximum": 2 | ||
| }, | ||
| "minItems": 1, | ||
| "maxItems": 3, | ||
| "uniqueItems": true | ||
| } | ||
| }, | ||
| "required": ["angularAxes"] | ||
| } | ||
| ] | ||
| } |
28 changes: 28 additions & 0 deletions
28
...0/Khronos/KHR_physics_rigid_bodies/schema/glTF.KHR_physics_rigid_bodies.joint.schema.json
This file contains hidden or 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.KHR_physics_rigid_bodies.joint.schema.json", | ||
| "title": "KHR_physics_rigid_bodies Physics Joint", | ||
| "type": "object", | ||
| "description": "Parameters describing a joint, constraining the motion of a pair of bodies.", | ||
| "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ], | ||
| "properties": { | ||
| "limits": { | ||
| "type": "array", | ||
| "description": "The set of limits which make up this joint", | ||
| "items": { | ||
| "type": "object", | ||
| "$ref": "glTF.KHR_physics_rigid_bodies.joint.limit.schema.json" | ||
| } | ||
| }, | ||
| "drives": { | ||
| "type": "array", | ||
| "description": "The set of drives applying forces to this joint", | ||
| "items": { | ||
| "type": "object", | ||
| "$ref": "glTF.KHR_physics_rigid_bodies.joint.drive.schema.json" | ||
| } | ||
| }, | ||
| "extensions": { }, | ||
| "extras": { } | ||
| } | ||
| } |
77 changes: 77 additions & 0 deletions
77
...nos/KHR_physics_rigid_bodies/schema/glTF.KHR_physics_rigid_bodies.joint_drive.schema.json
This file contains hidden or 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,77 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-04/schema", | ||
| "title": "KHR_physics_rigid_bodies Physics Joint Drive", | ||
| "type": "object", | ||
| "description": "Parameters describing a drive which applies forces within a joint.", | ||
| "allOf": [ { "$ref": "glTFProperty.schema.json" } ], | ||
| "properties": { | ||
| "type": { | ||
| "description": "Determines the degree of freedom which this drive controls.", | ||
| "anyOf": [ | ||
| { | ||
| "enum": [ "linear" ], | ||
| "description": "The drive applies a linear force along the driven axis." | ||
| }, | ||
| { | ||
| "enum": [ "angular" ], | ||
| "description": "The drive applies a torque about the driven axis." | ||
| }, | ||
| { | ||
| "type": "string" | ||
| } | ||
| ] | ||
| }, | ||
| "mode": { | ||
| "description": "Specifies the force calculation mode.", | ||
| "anyOf": [ | ||
| { | ||
| "enum": [ "force" ], | ||
| "description": "Value computed from the spring equation is the force to apply along the axis." | ||
| }, | ||
| { | ||
| "enum": [ "acceleration" ], | ||
| "description": "Value computed from the spring equation is the acceleration to apply along the axis." | ||
| }, | ||
| { | ||
| "type": "string" | ||
| } | ||
| ] | ||
| }, | ||
| "axis": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "maximum": 3, | ||
| "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" | ||
| ] | ||
| } |
40 changes: 40 additions & 0 deletions
40
...hronos/KHR_physics_rigid_bodies/schema/glTF.KHR_physics_rigid_bodies.material.schema.json
This file contains hidden or 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,40 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "glTF.KHR_physics_rigid_bodies.material.schema.json", | ||
| "title": "KHR_physics_rigid_bodies Physics Material", | ||
| "type": "object", | ||
| "description": "Parameters describing how an object should respond to collisions during physics simulation.", | ||
| "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ], | ||
| "properties": { | ||
| "staticFriction": { | ||
| "type": "number", | ||
| "description": "The friction used when an object is laying still on a surface. Usually a value from 0 to 1. A value of zero feels like ice, a value of 1 will make it very hard to get the object moving. Simulations which do not differentiate between static and dynamic friction should use the dynamic friction value.", | ||
| "minimum": 0.0, | ||
| "default": 0.6 | ||
| }, | ||
| "dynamicFriction": { | ||
| "type": "number", | ||
| "description": "The friction used when already moving. Usually a value from 0 to 1. A value of zero feels like ice, a value of 1 will make it come to rest very quickly unless a lot of force or gravity pushes the object.", | ||
| "minimum": 0.0, | ||
| "default": 0.6 | ||
| }, | ||
| "restitution": { | ||
| "type": "number", | ||
| "description": "How bouncy is the surface? A value of 0 will not bounce. A value of 1 will bounce without any loss of energy.", | ||
| "minimum": 0.0, | ||
| "default": 0.0 | ||
| }, | ||
| "frictionCombine": { | ||
| "type": "string", | ||
| "description": "Determines how friction should be combined when two objects interact.", | ||
| "enum": ["average", "minimum", "maximum", "multiply"] | ||
| }, | ||
| "restitutionCombine": { | ||
| "type": "string", | ||
| "description": "Determines how restitution should be combined when two objects interact.", | ||
| "enum": ["average", "minimum", "maximum", "multiply"] | ||
| }, | ||
| "extensions": { }, | ||
| "extras": { } | ||
| } | ||
| } |
39 changes: 39 additions & 0 deletions
39
...ons/2.0/Khronos/KHR_physics_rigid_bodies/schema/glTF.KHR_physics_rigid_bodies.schema.json
This file contains hidden or 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,39 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "glTF.KHR_physics_rigid_bodies.schema.json", | ||
| "title": "KHR_physics_rigid_bodies glTF Document Extension", | ||
| "type": "object", | ||
| "description": "Top level physics properties.", | ||
| "allOf": [ { "$ref": "glTFProperty.schema.json" } ], | ||
| "properties": { | ||
| "physicsMaterials": { | ||
| "type": "array", | ||
| "description": "An array of physics materials.", | ||
| "items": { | ||
| "type": "object", | ||
| "$ref": "glTF.KHR_physics_rigid_bodies.material.schema.json" | ||
| }, | ||
| "minItems": 1 | ||
| }, | ||
| "collisionFilters": { | ||
| "type": "array", | ||
| "description": "An array providing collision filter descriptions.", | ||
| "items": { | ||
| "type": "object", | ||
| "$ref": "glTF.KHR_physics_rigid_bodies.collision_filter.schema.json" | ||
| }, | ||
| "minItems": 1 | ||
| }, | ||
| "physicsJoints": { | ||
| "type": "array", | ||
| "description": "An array of physics joint descriptions.", | ||
| "items": { | ||
| "type": "object", | ||
| "$ref": "glTF.KHR_physics_rigid_bodies.joint.schema.json" | ||
| }, | ||
| "minItems": 1 | ||
| }, | ||
| "extensions": { }, | ||
| "extras": { } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diagram is incomplete, it shows node -> geometry -> shape, but it excludes how physics nodes can have mesh-based geometry by pointing to another node (node -> geometry -> node -> mesh), which, by the way, is a construction I am against, since node -> geometry -> mesh would be much better.