Skip to content
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

Change OMI_physics_joint to be more like KHR/MSFT physics #232

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aaronfranke
Copy link
Member

@aaronfranke aaronfranke commented Sep 3, 2024

This PR changes OMI_physics_joint to be more like KHR/MSFT physics: https://github.com/eoineoineoin/glTF_Physics/tree/master/extensions/2.0/Khronos/KHR_physics_rigid_bodies#joints

Preview: https://github.com/aaronfranke/gltf-extensions/tree/msft-style-joints/extensions/2.0/OMI_physics_joint

This change is a significant overhaul, but here is a summary of the changes:

  • Compared with previous OMI_physics_joint:
    • A joint node is now a descendant of one physics body, and refer to another descendant of a physics body (like Unity), instead of being one node that refers to two bodies (like Godot). Fortunately, converting between these can be done at import/export time losslessly, so there are no pain points for Godot users. Update OMI_physics_joint to be more like KHR physics joints omi-godot#12
    • Constraints are now called limits.
    • Lower and upper limits are now called min and max.
    • Min and max default to unbounded (infinity), instead of defaulting to zero. This means that in practice most joints will contain "min": 0, "max": 0. This is done because "infinity" is hard to specify in JSON, and using infinity allows for things like creating a Godot WorldBoundaryShape3D with a joint instead of a shape. Note that if you want both min and max unbounded, simply do not use a limit.
    • The array of limits in one joint is now located at the document level, instead of the node level. Previously each node had a list of indices referencing constraints (limits) at the document level.
    • Added joint drives, which can function as motors and/or springs.
    • Added glTF Object Model property specifications.
    • Modified README, schemas, and example files.
  • Compared with KHR physics joints:
    • Much more verbose README in a similar style to other OMI and Khronos extensions.
      • Over 200 lines of text, compared to under 100 lines. Descriptions of every property.
    • Did my best to make things clear and highly readable, a lot of sentences rephrased or rewritten.
    • Schema matches very closely.
    • This PR is currently missing example files for joint drives.

This is not guaranteed to be the last PR to OMI_physics_joint, but it gets us most of the way towards alignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant