gltf-extensions icon indicating copy to clipboard operation
gltf-extensions copied to clipboard

Change OMI_physics_joint to be more like KHR/MSFT physics

Open aaronfranke opened this issue 6 months ago • 0 comments

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. https://github.com/omigroup/omi-godot/pull/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.

aaronfranke avatar Sep 03 '24 10:09 aaronfranke