OverviewFilesCommitsIssuesDocsReleasesPeers

gltf-extensions commits / b14522f

removes omi_physic_body to split into two PRs
b14522f7b000cfc9d2c0fc4fc9de38af68d0394e
by antpb <itartist.pdf@gmail.com> · 2022-03-29T23:07:33.000Z

Changed files (1) +0 -111

extensions/2.0/OMI_physics_body/README.md +0 -111
……@@ -1,111 +0,0 @@
1# OMI_physics_body
2
3## Contributors
4
5* Mauve Signweaver, Mauve Software Inc.
6* YOUR NAME HERE
7
8## Status
9
10Open Metaverse Interoperability Group Stage 1 Proposal
11
12## Dependencies
13
14Written against the glTF 2.0 spec.
15
16Depends on the OMI_collider spec.
17
18## Overview
19
20This extension allows for setting basic physics properties on Nodes in glTF scenes.
21
22Nodes may be specified as having a physics body (or as being a trigger) which will work together with any Colliders defined via the OMI_collider spec.
23
24Note that each body can either have it's collider specified on the same node, or on nodes that are direct children of the body. In the case of there being child nodes, those colliders should be treated as "Compound Colliders" in those game engines that support it.
25
26### Example:
27
28This example defines a node which contains a single "sphere" collider which is being marked as a "rigid body" for the physics engine.
29
30```json=
31{
32 "nodes": [{
33 "name": "Ball",
34 "extensions": {
35 "OMI_physics_body": {
36 "type": "dynamic"
37 },
38 "OMI_collider": {
39 "type": "sphere",
40 "radius": 0.5
41 }
42 }
43 }]
44}
45```
46
47## glTF Scheme Updates
48
49### Example:
50
51### Physics Types
52
53There are different types of physics bodies that have different interactions with physics systems and other bodies within a scene.
54
55Here is a table listing the mapping between the GLTF object type and the equivalent properties in major game engines.
56
57| Shape | Unity | Godot | Unreal |
58| --------- | --------------------- | ------------- | ------------ |
59| Static | Collider | StaticBody | WorldStatic |
60| Kinematic | RigidBody.isKinematic | KinematicBody | WorldDynamic |
61| Dynamic | RigidBody | RigidBody | PhysicsBody |
62| Trigger | Collider.isTrigger | Area | Overlap:true |
63
64#### Static
65
66Static bodies are used to define bodies that can be collided with, but that do not move according to physics. This is usually used for level geometry.
67
68#### Kinematic
69
70Kinematic bodies behave like static bodies with the exception that they can be moved using scripts. e.g. moving platforms. You should mark nodes that are meant to be animated either with animations or a script.
71
72#### Dynamic
73
74Rigid bodies are affected by physics and can collide with each other and with Static bodies. This can be used for things like items that can be interacted with, falling objects in a scene, etc.
75
76#### Trigger
77
78Trigger bodies (aka collision area, aka overlap) do not interact with the physics system, but can generate events when another physics body "enters" them. This is useful to trigger events when an object enteres an area. E.g: A "goal" area which triggers whenever a ball gets thrown into it. In Unity this is set with the `trigger` property on a collider in Unity, setting the `overlap` property in Unreal, or using an Area object in Godot.
79
80### JSON Schema
81```json=
82{
83 "$schema": "http://json-schema.org/draft-04/schema",
84 "title": "PhysicsBody",
85 "type": "object",
86 "required": ["type"],
87 "properties": {
88 "type": {
89 "type": "string",
90 "description": "The type of body this node represents",
91 "enum": [
92 "static",
93 "dynamic",
94 "kinematic"
95 "trigger"
96 ]
97 }
98 }
99}
100```
101
102## Known Implementations
103
104TODO
105
106## Resources:
107
108Unity colliders: https://docs.unity3d.com/Manual/CollidersOverview.html
109Unreal Engine Physics: https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Physics/Collision/Overview/
110Godot Physics Body: https://docs.godotengine.org/en/stable/classes/class_physicsbody.html#class-physicsbody
111Godot Area: https://docs.godotengine.org/en/stable/classes/class_area.html#area