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

OMI_physics_gravity #216

Merged
merged 1 commit into from
May 23, 2024
Merged

OMI_physics_gravity #216

merged 1 commit into from
May 23, 2024

Conversation

aaronfranke
Copy link
Member

@aaronfranke aaronfranke commented Apr 5, 2024

This PR adds a new extension OMI_physics_gravity.

Preview: https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_physics_gravity

Implementation: omigroup/omi-godot#5

This extension allows specifying gravity volumes on trigger glTF nodes and specifying the global world gravity at the document level.

Global world gravity is always directional. A document-level extension may define the magnitude and direction of the global world gravity. Only one or zero instanced glTF files should have the document-level extension. The intention is to use the document-level extension only on the main "map" glTF. If multiple glTF files have the document-level gravity extension, use the most recently instanced glTF model's gravity (when instancing, override the previous gravity).

For a per-node gravity volume, the OMI_physics_gravity extension MUST be defined on an OMI_physics_body node that has a trigger property and does not have motion or collider properties. The shape of where the gravity influence is experienced is defined by the trigger shapes. The details of which way the gravity points can be specified in a variety of types, which are described in more detail in the README and schemas.

Whether or not a rigid body is influenced by a gravity volume is determined by the priority/replace/stop settings of each gravity volume the body is inside of. The priority integer determines the order in which gravity volumes are calculated, with higher values being calculated first, and the global world gravity is always calculated last. The replace boolean controls whether or not to keep gravity already calculated so far from higher priority nodes. The stop boolean controls whether or not to continue calculating gravity from any lower priority nodes and the global world gravity.

Copy link
Contributor

@lyuma lyuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stage 1 agreed by vote in discord
IMG_4835

@aaronfranke aaronfranke force-pushed the OMI_physics_gravity branch from a8de60c to 6be8297 Compare May 23, 2024 22:26
@aaronfranke aaronfranke force-pushed the OMI_physics_gravity branch from 6be8297 to 46a1956 Compare May 23, 2024 22:40
Copy link
Contributor

@antpb antpb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing work! 🚀

@antpb antpb merged commit 2174467 into omigroup:main May 23, 2024
2 checks passed
@aaronfranke aaronfranke deleted the OMI_physics_gravity branch May 25, 2024 09:56
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.

3 participants