diff --git a/extensions/2.0/Vendor/OMI_collider/README.md b/extensions/2.0/Vendor/OMI_collider/README.md new file mode 100644 index 0000000000..aded5f081c --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/README.md @@ -0,0 +1,160 @@ +# OMI_collider + +## Contributors + +* Aaron Franke, The Mirror Megaverse Inc. +* Robert Long, The Matrix.org Foundation +* Mauve Signweaver, Mauve Software Inc. + +## Status + +Open Metaverse Interoperability Group Stage 2 Proposal + +## Dependencies + +Written against the glTF 2.0 spec. + +Can be optionally used together with the `OMI_physics_body` spec. + +## Overview + +Colliders can be added to glTF nodes along with information about the "type" of collider it is representing. + +This extension allows specifying shapes to be used in glTF scenes for collision or triggers. Shapes should be specified on their own glTF nodes. + +This extension does not describe what colliders should do within a scene, aside from whether they are a trigger or not. For a more thorough physics body specification, you need to also use the `OMI_physics_body` extension, and add `OMI_collider` nodes as children of the physics body. Multiple `OMI_collider` siblings with the same `isTrigger` setting may be treated as a single "compound collider" in game engines that support them. + +### Example: + +This example defines a single box collider with a size of 1 meter in all dimensions: + +```json +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [1, 1, 1], + "type": "box" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider" + ], + "nodes": [ + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "BoxCollider" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [0] + } + ] +} +``` + +More example assets can be found in the [examples/](examples/) folder. All of these examples use `OMI_collider` and not `OMI_physics_body`. + +## glTF Schema Updates + +This extension consists of three new data structures for defining colliders on the root glTF document and referencing them on a glTF node. The main data structure defines a collider shape and is what most of this document describes. The second data structure uses the key `"OMI_collider"` in the document-level `"extensions"` which contains a list of the main collider shape data structures. The third data structure uses the key `"OMI_collider"` in the node-level `"extensions"` which contains an index of the collider shape to use from the list document-level collider list. + +The extension must also be added to the glTF's `extensionsUsed` array and because it is optional, it does not need to be added to the `extensionsRequired` array. + +### Property Summary + +The rest of the document, including this summary, defines the properties for the main data structure. + +| | Type | Description | Default value | Valid on | +| --------------| ----------- | -------------------------------------------------------------------------- | -------------------- | ------------------------- | +| **type** | `string` | The type of the collider shape as a string. | Required, no default | Always valid | +| **isTrigger** | `boolean` | If true, the shape is a trigger and is not solid to other objects. | false | Always valid | +| **size** | `number[3]` | The size of the box shape in meters. | [1.0, 1.0, 1.0] | Box | +| **radius** | `number` | The radius of the shape in meters. | 0.5 | Sphere, capsule, cylinder | +| **height** | `number` | The height of the shape in meters. | 2.0 | Capsule, cylinder | +| **mesh** | `number` | The index of the glTF mesh in the document to use as a trimesh shape. | -1 | Trimesh, hull | + +### Collider Types + +The `"type"` property is a lowercase string that defines what type of shape this collider is. + +The selection of shapes was carefully chosen with a balance of compatibility between major game engines and containing the most commonly used shapes for easy asset creation. Colliders inherit the transform of the glTF node they are attached to. This includes rotation and translation, however it is discouraged to scale collider nodes since this can cause problems in some physics engines. + +Here is a table listing the mapping between the `OMI_collider` type and the equivalent types in major game engines. + +| Shape | Unity | Unreal | Godot | Blender | Bullet (Ammo, Panda3D, etc) | +| -------- | ------------- | ------------- | --------------------- | ----------- | --------------------------- | +| Box | Box | Box | BoxShape3D | Box | Box Shape | +| Sphere | Sphere | Sphere | SphereShape3D | Sphere | Sphere Shape | +| Capsule | Capsule | Capsule | CapsuleShape3D | Capsule | Capsule Shape | +| Cylinder | Approximation | Approximation | CylinderShape3D | Cylinder | Cylinder Shape | +| Hull | Mesh (Convex) | Convex | ConvexPolygonShape3D | Convex Hull | Convex Shape | +| Trimesh | Mesh | Mesh | ConcavePolygonShape3D | Mesh | Mesh Shape | + +#### Box + +Box shapes describe a cube or cuboid shape. They have `size` property which is an array of 3 numbers that describes the width, height, and depth. If the `size` property is omitted, the default size is `[1, 1, 1]`, representing a cube with a volume of one cubic meter, edges/diameters one meter long, and extents/radius of half a meter. The position of the glTF node is the center of the box shape. + +#### Sphere + +Sphere shapes describe a uniform "ball" shape. They have a `radius` property which is a single number. If the `radius` property is omitted, the default radius is `0.5`, representing a sphere with a radius of half a meter, a diameter of one meter. The position of the glTF node is the center of the sphere shape. + +#### Capsule + +Capsule shapes describe a "pill" shape. They have a `radius` and `height` property. The height is aligned with the node's local vertical axis. If you wish to align it along a different axis, rotate the glTF node. If the `radius` property is omitted, the default radius is `0.5`, and if the `height` property is omitted, the default height is `2`. The height describes the total height from bottom to top. The height of the capsule must be at least twice as much as the radius. The "mid-height" between the centers of each spherical cap end can be found with `height - radius * 2`. + +#### Cylinder + +Cylinder shapes describe a "tall circle" shape. They are similar in structure to capsules, they have a `radius` and `height` property. The height is aligned with the node's local vertical axis. If you wish to align it along a different axis, rotate the glTF node. If the `radius` property is omitted, the default radius is `0.5`, and if the `height` property is omitted, the default height is `2`. + +The use of cylinder is discouraged if another shape would work well in its place. Cylinders are harder to calculate than boxes, spheres, and capsules. Not all game engines support cylinder shapes. Engines that do not support cylinder shapes should use an approximation, such as a convex hull roughly shaped like a cylinder. Cylinders over twice as tall as they are wide can use another approximation: a convex hull combined with an embedded capsule (to allow for smooth rolling), by copying the cylinder's values into a new capsule shape. + +#### Hull + +Hull shapes represent a convex hull. Being "convex" means that the shape cannot have any holes or divots. Hulls are defined with a `mesh` property with an index of a mesh in the glTF `meshes` array. The glTF mesh in the array MUST be a `trimesh` to work, and should be made of only one glTF mesh primitive (one surface). Valid hulls must contain at least one triangle, which becomes three points on the convex hull. Hulls are recommended to have at least four points so that they have 3D volume. The final hull shape should have no more than 255 points in total. + +Hulls can be used to represent complex convex shapes that are not easy to represent with other primitives. If a shape can be represented with a few primitives, prefer using those primitives instead of convex hulls. Hulls are much faster than trimesh shapes. + +#### Trimesh + +Trimesh shapes represent a concave triangle mesh. They are defined with a `mesh` property with an index of a mesh in the glTF `meshes` array. The glTF mesh in the array MUST be a `trimesh` to work, and should be made of only one glTF mesh primitive (one surface). Valid trimesh shapes must contain at least one triangle. + +Avoid using a trimesh shape for most objects, they are the slowest shapes to calculate and have several limitations. Most physics engines do not support moving trimesh shapes or calculating collisions between multiple trimesh shapes. Trimesh shapes will not work reliably with `isTrigger` or with pushing objects out due to not having an "interior" space, they only have a surface. Trimesh shapes are typically used for complex level geometry (for example, things that you can go inside of). If your shape can be represented with a combination of simpler primitives, or a convex hull, or multiple convex hulls, prefer that instead. + +### Trigger + +The `"isTrigger"` property defines if this shape is a trigger or collider. It is a boolean, either `true` or `false`. If omitted, the default value is `false`. + +Trigger shapes are not solid to other objects and will not collide with them. Triggers can generate events when another physics body "enters" them. For example, a "goal" area which triggers whenever a ball gets thrown into it. Which event gets triggered by a trigger shape is game-specific and not defined by `OMI_collider` (if nothing happens, that is also valid). + +### JSON Schema + +See [schema/collider.schema.json](schema/collider.schema.json) for the main collider schema, [schema/glTF.OMI_collider.schema.json](schema/glTF.OMI_collider.schema.json) for the document-level list of colliders, and [schema/node.OMI_collider.schema.json](schema/node.OMI_collider.schema.json) for the node-level collider selection. + +## Known Implementations + +* Godot Engine: https://github.com/godotengine/godot/pull/69266 +* Third Room Unity Exporter: https://github.com/matrix-org/thirdroom-unity-exporter/blob/main/Runtime/Scripts/OMI_collider/OMI_ColliderExtension.cs +* Third Room glTF Transform: https://github.com/matrix-org/thirdroom/blob/main/src/asset-pipeline/extensions/OMIColliderExtension.ts +* Third Room glTF Loader: https://github.com/matrix-org/thirdroom/blob/main/src/engine/gltf/OMI_collider.ts + +## Resources: + +* Godot Shapes: https://docs.godotengine.org/en/latest/classes/class_shape3d.html +* Unity Colliders: https://docs.unity3d.com/Manual/CollidersOverview.html +* Unreal Engine Collision Shapes: https://docs.unrealengine.com/4.27/en-US/API/Runtime/PhysicsCore/FCollisionShape/ +* Unreal Engine Mesh Collisions: https://docs.unrealengine.com/4.27/en-US/WorkingWithContent/Types/StaticMeshes/HowTo/SettingCollision/ +* Blender Collisions: https://docs.blender.org/manual/en/latest/physics/rigid_body/properties/collisions.html +* Mozilla Hubs ammo-shape: https://github.com/MozillaReality/hubs-blender-exporter/blob/bb28096159e1049b6b80da00b1ae1534a6ca0855/default-config.json#L608 diff --git a/extensions/2.0/Vendor/OMI_collider/examples/box_collider.gltf b/extensions/2.0/Vendor/OMI_collider/examples/box_collider.gltf new file mode 100644 index 0000000000..8672a72954 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/examples/box_collider.gltf @@ -0,0 +1,40 @@ +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [ + 1, + 1, + 1 + ], + "type": "box" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider" + ], + "nodes": [ + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "BoxCollider" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_collider/examples/capsule_collider.gltf b/extensions/2.0/Vendor/OMI_collider/examples/capsule_collider.gltf new file mode 100644 index 0000000000..2eb928fa18 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/examples/capsule_collider.gltf @@ -0,0 +1,37 @@ +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "height": 2.0, + "radius": 0.5, + "type": "capsule" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider" + ], + "nodes": [ + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "CapsuleCollider" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_collider/examples/cylinder_collider.gltf b/extensions/2.0/Vendor/OMI_collider/examples/cylinder_collider.gltf new file mode 100644 index 0000000000..f0e9eb2523 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/examples/cylinder_collider.gltf @@ -0,0 +1,37 @@ +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "height": 2.0, + "radius": 0.5, + "type": "cylinder" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider" + ], + "nodes": [ + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "CylinderCollider" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_collider/examples/hull/convex_hull.gltf b/extensions/2.0/Vendor/OMI_collider/examples/hull/convex_hull.gltf new file mode 100644 index 0000000000..dae833e3a0 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/examples/hull/convex_hull.gltf @@ -0,0 +1,240 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5125, + "count": 24, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 20, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 20, + "max": [ + 0.999969, + 0, + 0.999969, + 1 + ], + "min": [ + -0.999969, + -0.007936, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5126, + "count": 20, + "max": [ + 0.894377, + 0.447188, + 1 + ], + "min": [ + -0.894377, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 20, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5125, + "count": 24, + "max": [ + 19 + ], + "min": [ + 2 + ], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 0 + }, + { + "buffer": 0, + "byteLength": 96, + "byteOffset": 288 + }, + { + "buffer": 0, + "byteLength": 240, + "byteOffset": 384 + }, + { + "buffer": 0, + "byteLength": 320, + "byteOffset": 624 + }, + { + "buffer": 0, + "byteLength": 240, + "byteOffset": 944 + }, + { + "buffer": 0, + "byteLength": 160, + "byteOffset": 1184 + }, + { + "buffer": 0, + "byteLength": 96, + "byteOffset": 1344 + } + ], + "buffers": [ + { + "byteLength": 1440, + "uri": "convex_hull0.bin" + } + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "mesh": 0, + "type": "hull" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider" + ], + "meshes": [ + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "POSITION": 0 + }, + "indices": 1, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 4, + "POSITION": 2, + "TANGENT": 3, + "TEXCOORD_0": 5 + }, + "indices": 6, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1 + ], + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "ConvexHull" + }, + { + "extensions": {}, + "mesh": 1, + "name": "ConvexMesh" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_collider/examples/hull/convex_hull0.bin b/extensions/2.0/Vendor/OMI_collider/examples/hull/convex_hull0.bin new file mode 100644 index 0000000000..6dd4d73d3c Binary files /dev/null and b/extensions/2.0/Vendor/OMI_collider/examples/hull/convex_hull0.bin differ diff --git a/extensions/2.0/Vendor/OMI_collider/examples/hull/convex_hull_only.gltf b/extensions/2.0/Vendor/OMI_collider/examples/hull/convex_hull_only.gltf new file mode 100644 index 0000000000..b58e2a50aa --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/examples/hull/convex_hull_only.gltf @@ -0,0 +1,104 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5125, + "count": 24, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 0 + }, + { + "buffer": 0, + "byteLength": 96, + "byteOffset": 288 + } + ], + "buffers": [ + { + "byteLength": 384, + "uri": "convex_hull_only0.bin" + } + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "mesh": 0, + "type": "hull" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider" + ], + "meshes": [ + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "POSITION": 0 + }, + "indices": 1, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "ConvexHull" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_collider/examples/hull/convex_hull_only0.bin b/extensions/2.0/Vendor/OMI_collider/examples/hull/convex_hull_only0.bin new file mode 100644 index 0000000000..fc706fe16a Binary files /dev/null and b/extensions/2.0/Vendor/OMI_collider/examples/hull/convex_hull_only0.bin differ diff --git a/extensions/2.0/Vendor/OMI_collider/examples/sphere_collider.gltf b/extensions/2.0/Vendor/OMI_collider/examples/sphere_collider.gltf new file mode 100644 index 0000000000..157c4a6c46 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/examples/sphere_collider.gltf @@ -0,0 +1,36 @@ +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "radius": 0.5, + "type": "sphere" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider" + ], + "nodes": [ + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "SphereCollider" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_collider/examples/trigger_box.gltf b/extensions/2.0/Vendor/OMI_collider/examples/trigger_box.gltf new file mode 100644 index 0000000000..1dbbf181af --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/examples/trigger_box.gltf @@ -0,0 +1,41 @@ +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "isTrigger": true, + "size": [ + 1, + 1, + 1 + ], + "type": "box" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider" + ], + "nodes": [ + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "TriggerBox" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_collider/examples/trimesh/concave_trimesh.gltf b/extensions/2.0/Vendor/OMI_collider/examples/trimesh/concave_trimesh.gltf new file mode 100644 index 0000000000..36b11f447f --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/examples/trimesh/concave_trimesh.gltf @@ -0,0 +1,203 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 0.5, + 0.5, + 0.5 + ], + "min": [ + -0.5, + -0.5, + -0.5 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 0 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 288 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 672 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 960 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 1152 + } + ], + "buffers": [ + { + "byteLength": 1296, + "uri": "concave_trimesh0.bin" + } + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "mesh": 0, + "type": "trimesh" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider" + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + } + ], + "meshes": [ + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 2, + "POSITION": 0, + "TANGENT": 1, + "TEXCOORD_0": 3 + }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1, + 2 + ], + "name": "ConcaveTrimesh" + }, + { + "extensions": {}, + "mesh": 0, + "name": "BoxMeshInstance" + }, + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "ConcaveTrimeshCollider" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_collider/examples/trimesh/concave_trimesh0.bin b/extensions/2.0/Vendor/OMI_collider/examples/trimesh/concave_trimesh0.bin new file mode 100644 index 0000000000..969920a004 Binary files /dev/null and b/extensions/2.0/Vendor/OMI_collider/examples/trimesh/concave_trimesh0.bin differ diff --git a/extensions/2.0/Vendor/OMI_collider/examples/trimesh/concave_trimesh_only.gltf b/extensions/2.0/Vendor/OMI_collider/examples/trimesh/concave_trimesh_only.gltf new file mode 100644 index 0000000000..3b6ab2f06e --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/examples/trimesh/concave_trimesh_only.gltf @@ -0,0 +1,110 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 36, + "max": [ + 0.5, + 0.5, + 0.5 + ], + "min": [ + -0.5, + -0.5, + -0.5 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 35 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 432, + "byteOffset": 0 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 432 + } + ], + "buffers": [ + { + "byteLength": 576, + "uri": "concave_trimesh_only0.bin" + } + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "mesh": 0, + "type": "trimesh" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider" + ], + "meshes": [ + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "POSITION": 0 + }, + "indices": 1, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1 + ], + "name": "ConcaveTrimeshOnly" + }, + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "ConcaveTrimeshCollider" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_collider/examples/trimesh/concave_trimesh_only0.bin b/extensions/2.0/Vendor/OMI_collider/examples/trimesh/concave_trimesh_only0.bin new file mode 100644 index 0000000000..a8baead4d7 Binary files /dev/null and b/extensions/2.0/Vendor/OMI_collider/examples/trimesh/concave_trimesh_only0.bin differ diff --git a/extensions/2.0/Vendor/OMI_collider/schema/collider.schema.json b/extensions/2.0/Vendor/OMI_collider/schema/collider.schema.json new file mode 100644 index 0000000000..3da619516b --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/schema/collider.schema.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_collider Collider", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of collider this node represents.", + "enum": [ + "box", + "sphere", + "capsule", + "cylinder", + "hull", + "trimesh" + ] + }, + "isTrigger": { + "type": "boolean", + "description": "When true this collider will not be solid to physics bodies in the scene, and instead the shape will act as a trigger detection area.", + "default": false + } + }, + "oneOf": [ + { + "required": [ + "type", + "size" + ], + "properties": { + "type": { + "const": "box" + }, + "size": { + "type": "array", + "description": "Three number array representing the width, height, and depth of the box (x, y, z)." + } + } + }, + { + "required": [ + "type", + "radius" + ], + "properties": { + "type": { + "const": "sphere" + }, + "radius": { + "type": "number", + "description": "The radius to use for the sphere shape." + } + } + }, + { + "required": [ + "type", + "radius", + "height" + ], + "properties": { + "type": { + "const": "capsule" + }, + "radius": { + "type": "number", + "description": "The radius to use for the capsule shape." + }, + "height": { + "type": "number", + "description": "The full height of the capsule shape." + } + } + }, + { + "required": [ + "type", + "radius", + "height" + ], + "properties": { + "type": { + "const": "cylinder" + }, + "radius": { + "type": "number", + "description": "The radius to use for the cylinder shape." + }, + "height": { + "type": "number", + "description": "The height of the cylinder shape." + } + } + }, + { + "required": [ + "type", + "mesh" + ], + "properties": { + "type": { + "const": "trimesh" + }, + "mesh": { + "description": "A reference to the mesh in the glTF meshes array to use for this concave trimesh shape. The mesh MUST be a trimesh and have at least one triangle.", + "allOf": [ + { + "$ref": "glTFid.schema.json" + } + ] + } + } + }, + { + "required": [ + "type", + "mesh" + ], + "properties": { + "type": { + "const": "hull" + }, + "mesh": { + "description": "A reference to the mesh in the glTF meshes array to use for this concave trimesh shape. The mesh MUST be a trimesh and have at least one triangle. The hull computed from this mesh should have no more than 255 points in total.", + "allOf": [ + { + "$ref": "glTFid.schema.json" + } + ] + } + } + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_collider/schema/glTF.OMI_collider.schema.json b/extensions/2.0/Vendor/OMI_collider/schema/glTF.OMI_collider.schema.json new file mode 100644 index 0000000000..5b37e24ff8 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/schema/glTF.OMI_collider.schema.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_collider glTF Document Extension", + "type": "object", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "properties": { + "colliders": { + "description": "An array of colliders that can be referenced by nodes.", + "type": "array", + "items": { + "type": "object", + "$ref": "collider.schema.json" + }, + "minItems": 1 + }, + "extensions": {}, + "extras": {} + }, + "required": [ + "colliders" + ] +} diff --git a/extensions/2.0/Vendor/OMI_collider/schema/node.OMI_collider.schema.json b/extensions/2.0/Vendor/OMI_collider/schema/node.OMI_collider.schema.json new file mode 100644 index 0000000000..1ff34efc1d --- /dev/null +++ b/extensions/2.0/Vendor/OMI_collider/schema/node.OMI_collider.schema.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_collider glTF Node Extension", + "type": "object", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "properties": { + "collider": { + "description": "The id of the collider referenced by this node.", + "allOf": [ + { + "$ref": "glTFid.schema.json" + } + ] + }, + "extensions": {}, + "extras": {} + }, + "required": [ + "collider" + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_body/README.md b/extensions/2.0/Vendor/OMI_physics_body/README.md new file mode 100644 index 0000000000..2452d6fc76 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_body/README.md @@ -0,0 +1,181 @@ +# OMI_physics_body + +## Contributors + +* Aaron Franke, The Mirror Megaverse Inc. +* Mauve Signweaver, Mauve Software Inc. + +## Status + +Open Metaverse Interoperability Group Stage 1 Proposal + +## Dependencies + +Written against the glTF 2.0 spec. + +Depends on the `OMI_collider` spec to be useful. + +## Overview + +This extension allows for specifying the type of physics body in glTF scenes. + +Physics bodies are defined with a type and a mass. Nodes with collider shapes defined using the `OMI_collider` spec should be added as direct children of physics bodies. In order to be associated with a `OMI_physics_body` glTF node, `OMI_collider` glTF nodes must be direct children, not indirect children. + +Each glTF node with `OMI_collider` may be associated with zero or one `OMI_physics_body` glTF node as its direct parent. Each glTF node with `OMI_physics_body` should have one or many `OMI_collider` glTF node direct children (zero is valid but not recommended, since physics bodies have no function if they have zero collider shape children). Multiple `OMI_collider` direct children of a body with the same `isTrigger` setting may be treated as a single "compound collider" in game engines that support them. + +### Example: + +This example defines a static body node which has a single box collider as a child: + +```json +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [ + 1, + 1, + 1 + ], + "type": "box" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body" + ], + "nodes": [ + { + "children": [ + 1 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "StaticBox" + }, + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "StaticShape" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} +``` + +More example assets can be found in the [examples/](examples/) folder. All of these examples use both `OMI_collider` and `OMI_physics_body`. + +## glTF Schema Updates + +This extension consists of a new `OMI_physics_body` data structure which can be added to a glTF node. + +The extension must also be added to the glTF's `extensionsUsed` array and because it is optional, it does not need to be added to the `extensionsRequired` array. + +The extension is intended to be used together with `OMI_collider`. Physics bodies without collision shapes on them will not have any function. + +### Property Summary + +| | Type | Description | Default value | +| ------------------- | ----------- | ---------------------------------------------------------------- | -------------------- | +| **type** | `string` | The type of the physics body as a string. | Required, no default | +| **mass** | `number` | The mass of the physics body in kilograms. | 1.0 | +| **linearVelocity** | `number[3]` | The initial linear velocity of the body in meters per second. | [0.0, 0.0, 0.0] | +| **angularVelocity** | `number[3]` | The initial angular velocity of the body in radians per second. | [0.0, 0.0, 0.0] | +| **inertiaTensor** | `number[9]` | The inertia tensor 3x3 matrix in kilogram meter squared (kg⋅m²). | [0.0, ..., 0.0] | + +### Physics Body Types + +The `"type"` property is a lowercase string that defines what type of physics body this is. Different types of physics bodies have different interactions with physics systems and other bodies within a scene. + +Here is a table listing the mapping between the `OMI_physics_body` type and the equivalent types in major game engines. + +| Body Type | Unity | Godot 3 | Godot 4 | Unreal | +| --------- | --------------------- | ------------- | ---------------- | -------------------------------------- | +| Static | Collider | StaticBody | StaticBody3D | WorldStatic, Simulate Physics = false | +| Kinematic | Rigidbody.isKinematic | KinematicBody | AnimatableBody3D | WorldDynamic, Simulate Physics = false | +| Character | Rigidbody.isKinematic | KinematicBody | CharacterBody3D | Pawn, Simulate Physics = false | +| Rigid | Rigidbody | RigidBody | RigidBody3D | PhysicsBody, Simulate Physics = true | +| Vehicle | Rigidbody | VehicleBody | VehicleBody3D | Vehicle, Simulate Physics = true | +| Trigger | Collider.isTrigger | Area | Area3D | Generate Overlap Events = true | + +#### Static + +Static bodies can be collided with, but do not move. They are usually used for level geometry. + +#### Kinematic + +Kinematic bodies collide with other bodies, and can be moved using scripts or animations. They can be used for moving platforms. + +#### Character + +Character bodies are like kinematic bodies, except are designed for characters. If an engine does not have a dedicated character type, treat this as kinematic instead. + +#### Rigid + +Rigid bodies collide with other bodies, and move around on their own in the physics simulation. They are affected by gravity. They can be used for props that move around in the world. + +#### Vehicle + +Vehicle bodies are like rigid bodies, except are designed for vehicles. If an engine does not have a dedicated vehicle type, treat this as rigid instead. + +#### Trigger + +Trigger bodies do not collide with other objects, but can generate events when another physics body "enters" them. For example, a "goal" area which triggers whenever a ball gets thrown into it. + +If an `OMI_collider`'s `"isTrigger"` setting does not match the body it's a part of, implementations should ensure the per-collider setting is preserved. + +### Mass + +The `"mass"` property is a number that defines how much mass this physics body has in kilograms. Not all body types can make use of mass, such as triggers or non-moving bodies, in which case the mass can be ignored. If not specified, the default value is 1 kilogram. + +### Linear Velocity + +The `"linearVelocity"` property is an array of three numbers that defines how much linear velocity this physics body starts with in meters per second. Not all body types can make use of linear velocity, such as non-moving bodies, in which case the linear velocity can be ignored. If not specified, the default value is zero. + +### Angular Velocity + +The `"angularVelocity"` property is an array of three numbers that defines how much angular velocity this physics body starts with in radians per second. Not all body types can make use of angular velocity, such as non-moving bodies, in which case the angular velocity can be ignored. If not specified, the default value is zero. + +### Inertia Tensor + +The `"inertiaTensor"` property is an array of 9 numbers that defines the inertia tensor 3x3 matrix of the body in kilogram meter squared (kg⋅m²). We specify "tensor" in the name because this defines inertia in multiple directions and is different from linear momentum inertia. Only "rigid" and "vehicle" body types can make use of inertia. If zero or not specified, the inertia should be automatically calculated by the physics engine. + +The inertia tensor matrix is a symmetric matrix. The inertia matrix represents the mass distribution of the body and determines how hard the body is to rotate. The values on the diagonal represent the inertia around the 3 principle axes (X, Y, Z), while the values not on the diagonal represent the 3 coupling values between the axes (XY, XZ, YZ). For more information, refer to the Wikipedia article. + +Some engines only support specifying the inertia around the principle axes as a Vector3. In those engines, when importing a glTF file and reading the inertia matrix, only the diagonal principle axis values should be used, and the non-diagonal coupling values should be discarded. Similarly, when exporting a glTF file while writing the inertia matrix, write the Vector3 values to the matrix diagonal principle axis values, and set the non-diagonal coupling values to zero. + +### JSON Schema + +See [schema/node.OMI_physics_body.schema.json](schema/node.OMI_physics_body.schema.json). + +## Known Implementations + +* Godot Engine: https://github.com/godotengine/godot/pull/69266 + +## Resources: + +* Unity colliders: https://docs.unity3d.com/Manual/CollidersOverview.html +* Unreal Engine Physics: https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Physics/Collision/Overview/ +* Godot Physics Body: https://docs.godotengine.org/en/stable/classes/class_physicsbody.html +* Godot Area: https://docs.godotengine.org/en/stable/classes/class_area.html +* Godot RigidBody3D: https://docs.godotengine.org/en/latest/classes/class_rigidbody3d.html +* Wikipedia Moment of Inertia and Inertia Tensor https://en.wikipedia.org/wiki/Moment_of_inertia#Inertia_tensor diff --git a/extensions/2.0/Vendor/OMI_physics_body/examples/basic/static_box.gltf b/extensions/2.0/Vendor/OMI_physics_body/examples/basic/static_box.gltf new file mode 100644 index 0000000000..0df325b851 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_body/examples/basic/static_box.gltf @@ -0,0 +1,52 @@ +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [ + 1, + 1, + 1 + ], + "type": "box" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body" + ], + "nodes": [ + { + "children": [ + 1 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "StaticBox" + }, + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "StaticShape" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_body/examples/basic/trigger_box.gltf b/extensions/2.0/Vendor/OMI_physics_body/examples/basic/trigger_box.gltf new file mode 100644 index 0000000000..4b5289da98 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_body/examples/basic/trigger_box.gltf @@ -0,0 +1,53 @@ +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "isTrigger": true, + "size": [ + 1, + 1, + 1 + ], + "type": "box" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body" + ], + "nodes": [ + { + "children": [ + 1 + ], + "extensions": { + "OMI_physics_body": { + "type": "trigger" + } + }, + "name": "TriggerBox" + }, + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "TriggerShape" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_body/examples/basic/trigger_only_body.gltf b/extensions/2.0/Vendor/OMI_physics_body/examples/basic/trigger_only_body.gltf new file mode 100644 index 0000000000..fbf44b0305 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_body/examples/basic/trigger_only_body.gltf @@ -0,0 +1,52 @@ +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [ + 1, + 1, + 1 + ], + "type": "box" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body" + ], + "nodes": [ + { + "children": [ + 1 + ], + "extensions": { + "OMI_physics_body": { + "type": "trigger" + } + }, + "name": "TriggerBox" + }, + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "StaticShape" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_body/examples/basic/trigger_only_shape.gltf b/extensions/2.0/Vendor/OMI_physics_body/examples/basic/trigger_only_shape.gltf new file mode 100644 index 0000000000..63e3ba20c9 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_body/examples/basic/trigger_only_shape.gltf @@ -0,0 +1,53 @@ +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "isTrigger": true, + "size": [ + 1, + 1, + 1 + ], + "type": "box" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body" + ], + "nodes": [ + { + "children": [ + 1 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "StaticBox" + }, + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "TriggerShape" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_body/examples/complex/ball_pit.gltf b/extensions/2.0/Vendor/OMI_physics_body/examples/complex/ball_pit.gltf new file mode 100644 index 0000000000..5bd9fdfe5e --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_body/examples/complex/ball_pit.gltf @@ -0,0 +1,1633 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 4, + 0.05, + 4 + ], + "min": [ + -4, + -0.05, + -4 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 0.05, + 0.5, + 4 + ], + "min": [ + -0.05, + -0.5, + -4 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 8, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 9, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 10, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 0.05, + 0.5, + 4 + ], + "min": [ + -0.05, + -0.5, + -4 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 11, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 12, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 13, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 14, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 15, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 4, + 0.5, + 0.05 + ], + "min": [ + -4, + -0.5, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 16, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 17, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 18, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 19, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 20, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.499434, + 0.5, + 0.499434 + ], + "min": [ + -0.499434, + -0.5, + -0.499434 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 21, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 22, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.998868, + 1, + 0.998868 + ], + "min": [ + -0.998869, + -1, + -0.998867 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 23, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 24, + "byteOffset": 0, + "componentType": 5125, + "count": 12672, + "max": [ + 2209 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 25, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.499434, + 0.5, + 0.499434 + ], + "min": [ + -0.499434, + -0.5, + -0.499434 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 26, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 27, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.998868, + 1, + 0.998868 + ], + "min": [ + -0.998869, + -1, + -0.998867 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 28, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 29, + "byteOffset": 0, + "componentType": 5125, + "count": 12672, + "max": [ + 2209 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 30, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.499434, + 0.5, + 0.499434 + ], + "min": [ + -0.499434, + -0.5, + -0.499434 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 31, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 32, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.998868, + 1, + 0.998868 + ], + "min": [ + -0.998869, + -1, + -0.998867 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 33, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 34, + "byteOffset": 0, + "componentType": 5125, + "count": 12672, + "max": [ + 2209 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 35, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.499434, + 0.5, + 0.499434 + ], + "min": [ + -0.499434, + -0.5, + -0.499434 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 36, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 37, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.998868, + 1, + 0.998868 + ], + "min": [ + -0.998869, + -1, + -0.998867 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 38, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 39, + "byteOffset": 0, + "componentType": 5125, + "count": 12672, + "max": [ + 2209 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 40, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.499434, + 0.5, + 0.499434 + ], + "min": [ + -0.499434, + -0.5, + -0.499434 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 41, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 42, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.998868, + 1, + 0.998868 + ], + "min": [ + -0.998869, + -1, + -0.998867 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 43, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 44, + "byteOffset": 0, + "componentType": 5125, + "count": 12672, + "max": [ + 2209 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 0 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 288 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 672 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 960 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 1152 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 1296 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 1584 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 1968 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 2256 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 2448 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 2592 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 2880 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 3264 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 3552 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 3744 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 3888 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 4176 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 4560 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 4848 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 5040 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 5184 + }, + { + "buffer": 0, + "byteLength": 35360, + "byteOffset": 31704 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 67064 + }, + { + "buffer": 0, + "byteLength": 17680, + "byteOffset": 93584 + }, + { + "buffer": 0, + "byteLength": 50688, + "byteOffset": 111264 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 161952 + }, + { + "buffer": 0, + "byteLength": 35360, + "byteOffset": 188472 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 223832 + }, + { + "buffer": 0, + "byteLength": 17680, + "byteOffset": 250352 + }, + { + "buffer": 0, + "byteLength": 50688, + "byteOffset": 268032 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 318720 + }, + { + "buffer": 0, + "byteLength": 35360, + "byteOffset": 345240 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 380600 + }, + { + "buffer": 0, + "byteLength": 17680, + "byteOffset": 407120 + }, + { + "buffer": 0, + "byteLength": 50688, + "byteOffset": 424800 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 475488 + }, + { + "buffer": 0, + "byteLength": 35360, + "byteOffset": 502008 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 537368 + }, + { + "buffer": 0, + "byteLength": 17680, + "byteOffset": 563888 + }, + { + "buffer": 0, + "byteLength": 50688, + "byteOffset": 581568 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 632256 + }, + { + "buffer": 0, + "byteLength": 35360, + "byteOffset": 658776 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 694136 + }, + { + "buffer": 0, + "byteLength": 17680, + "byteOffset": 720656 + }, + { + "buffer": 0, + "byteLength": 50688, + "byteOffset": 738336 + } + ], + "buffers": [ + { + "byteLength": 789024, + "uri": "ball_pit0.bin" + } + ], + "cameras": [ + { + "perspective": { + "yfov": 1.30899691581726, + "zfar": 4000, + "znear": 0.0500000007450581 + }, + "type": "perspective" + } + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [ + 8, + 0.100000001490116, + 8 + ], + "type": "box" + }, + { + "size": [ + 0.100000001490116, + 1, + 8 + ], + "type": "box" + }, + { + "size": [ + 8, + 1, + 0.100000001490116 + ], + "type": "box" + }, + { + "radius": 0.5, + "type": "sphere" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body" + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + } + ], + "meshes": [ + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 2, + "POSITION": 0, + "TANGENT": 1, + "TEXCOORD_0": 3 + }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 7, + "POSITION": 5, + "TANGENT": 6, + "TEXCOORD_0": 8 + }, + "indices": 9, + "material": 1, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 12, + "POSITION": 10, + "TANGENT": 11, + "TEXCOORD_0": 13 + }, + "indices": 14, + "material": 2, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 17, + "POSITION": 15, + "TANGENT": 16, + "TEXCOORD_0": 18 + }, + "indices": 19, + "material": 3, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 22, + "POSITION": 20, + "TANGENT": 21, + "TEXCOORD_0": 23 + }, + "indices": 24, + "material": 4, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 27, + "POSITION": 25, + "TANGENT": 26, + "TEXCOORD_0": 28 + }, + "indices": 29, + "material": 5, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 32, + "POSITION": 30, + "TANGENT": 31, + "TEXCOORD_0": 33 + }, + "indices": 34, + "material": 6, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 37, + "POSITION": 35, + "TANGENT": 36, + "TEXCOORD_0": 38 + }, + "indices": 39, + "material": 7, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 42, + "POSITION": 40, + "TANGENT": 41, + "TEXCOORD_0": 43 + }, + "indices": 44, + "material": 8, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1, + 10, + 13, + 16, + 19, + 22, + 25 + ], + "extensions": {}, + "name": "BallPit" + }, + { + "children": [ + 2, + 4, + 6, + 8 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "Pit" + }, + { + "children": [ + 3 + ], + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "Floor" + }, + { + "extensions": {}, + "mesh": 0, + "name": "Mesh1" + }, + { + "children": [ + 5 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "WallEast", + "translation": [ + 4, + 0.5, + 0 + ] + }, + { + "extensions": {}, + "mesh": 1, + "name": "Mesh2" + }, + { + "children": [ + 7 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "WallWest", + "translation": [ + -4, + 0.5, + 0 + ] + }, + { + "extensions": {}, + "mesh": 2, + "name": "Mesh3" + }, + { + "children": [ + 9 + ], + "extensions": { + "OMI_collider": { + "collider": 2 + } + }, + "name": "WallNorth", + "translation": [ + 0, + 0.5, + -4 + ] + }, + { + "extensions": {}, + "mesh": 3, + "name": "Mesh4" + }, + { + "children": [ + 11 + ], + "extensions": { + "OMI_physics_body": { + "mass": 1, + "type": "rigid" + } + }, + "name": "Ball1", + "translation": [ + 0, + 1, + 0 + ] + }, + { + "children": [ + 12 + ], + "extensions": { + "OMI_collider": { + "collider": 3 + } + }, + "name": "SphereShape1" + }, + { + "extensions": {}, + "mesh": 4, + "name": "BallMesh1" + }, + { + "children": [ + 14 + ], + "extensions": { + "OMI_physics_body": { + "mass": 1, + "type": "rigid" + } + }, + "name": "Ball2", + "translation": [ + 0.5, + 2, + 0.5 + ] + }, + { + "children": [ + 15 + ], + "extensions": { + "OMI_collider": { + "collider": 3 + } + }, + "name": "SphereShape2" + }, + { + "extensions": {}, + "mesh": 5, + "name": "BallMesh2" + }, + { + "children": [ + 17 + ], + "extensions": { + "OMI_physics_body": { + "mass": 1, + "type": "rigid" + } + }, + "name": "Ball3", + "translation": [ + -0.5, + 2.5, + 0 + ] + }, + { + "children": [ + 18 + ], + "extensions": { + "OMI_collider": { + "collider": 3 + } + }, + "name": "SphereShape3" + }, + { + "extensions": {}, + "mesh": 6, + "name": "BallMesh3" + }, + { + "children": [ + 20 + ], + "extensions": { + "OMI_physics_body": { + "mass": 1, + "type": "rigid" + } + }, + "name": "Ball4", + "translation": [ + 0.25, + 3.5, + 0 + ] + }, + { + "children": [ + 21 + ], + "extensions": { + "OMI_collider": { + "collider": 3 + } + }, + "name": "SphereShape4" + }, + { + "extensions": {}, + "mesh": 7, + "name": "BallMesh4" + }, + { + "children": [ + 23 + ], + "extensions": { + "OMI_physics_body": { + "mass": 1, + "type": "rigid" + } + }, + "name": "Ball5", + "translation": [ + -0.5, + 4, + -0.5 + ] + }, + { + "children": [ + 24 + ], + "extensions": { + "OMI_collider": { + "collider": 3 + } + }, + "name": "SphereShape5" + }, + { + "extensions": {}, + "mesh": 8, + "name": "BallMesh5" + }, + { + "camera": 0, + "extensions": {}, + "name": "Camera", + "rotation": [ + -0.25881916284561, + 0, + 0, + 0.965925812721252 + ], + "translation": [ + 0, + 3, + 6 + ] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_body/examples/complex/ball_pit0.bin b/extensions/2.0/Vendor/OMI_physics_body/examples/complex/ball_pit0.bin new file mode 100644 index 0000000000..371e75441e Binary files /dev/null and b/extensions/2.0/Vendor/OMI_physics_body/examples/complex/ball_pit0.bin differ diff --git a/extensions/2.0/Vendor/OMI_physics_body/examples/complex/one_collider_trigger.gltf b/extensions/2.0/Vendor/OMI_physics_body/examples/complex/one_collider_trigger.gltf new file mode 100644 index 0000000000..6861fe4dfb --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_body/examples/complex/one_collider_trigger.gltf @@ -0,0 +1,66 @@ +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [ + 1, + 1, + 1 + ], + "type": "box" + }, + { + "isTrigger": true, + "radius": 2, + "type": "sphere" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body" + ], + "nodes": [ + { + "children": [ + 1, + 2 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "StaticBox" + }, + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "StaticCollider" + }, + { + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "TriggerCollider" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_body/examples/complex/rigid_with_velocity.gltf b/extensions/2.0/Vendor/OMI_physics_body/examples/complex/rigid_with_velocity.gltf new file mode 100644 index 0000000000..793de75a60 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_body/examples/complex/rigid_with_velocity.gltf @@ -0,0 +1,58 @@ +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "radius": 0.5, + "type": "sphere" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body" + ], + "nodes": [ + { + "children": [ + 1 + ], + "extensions": { + "OMI_physics_body": { + "angularVelocity": [ + 4, + 5, + 6 + ], + "linearVelocity": [ + 1, + 2, + 3 + ], + "type": "rigid" + } + }, + "name": "RigidWithVelocity" + }, + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "SphereCollider" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_body/examples/complex/two_boxes.gltf b/extensions/2.0/Vendor/OMI_physics_body/examples/complex/two_boxes.gltf new file mode 100644 index 0000000000..8dfd35175d --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_body/examples/complex/two_boxes.gltf @@ -0,0 +1,98 @@ +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [ + 1, + 1, + 1 + ], + "type": "box" + }, + { + "isTrigger": true, + "size": [ + 1, + 1, + 1 + ], + "type": "box" + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body" + ], + "nodes": [ + { + "children": [ + 1, + 3 + ], + "extensions": {}, + "name": "TwoBoxes" + }, + { + "children": [ + 2 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "StaticBox", + "translation": [ + -1, + 0, + 0 + ] + }, + { + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "StaticShape" + }, + { + "children": [ + 4 + ], + "extensions": { + "OMI_physics_body": { + "type": "trigger" + } + }, + "name": "TriggerBox", + "translation": [ + 1, + 0, + 0 + ] + }, + { + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "TriggerShape" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_body/schema/node.OMI_physics_body.schema.json b/extensions/2.0/Vendor/OMI_physics_body/schema/node.OMI_physics_body.schema.json new file mode 100644 index 0000000000..97dda06ecc --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_body/schema/node.OMI_physics_body.schema.json @@ -0,0 +1,42 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_physics_body glTF Node Extension", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The body type of this physics body as a string.", + "enum": [ + "static", + "kinematic", + "character", + "rigid", + "vehicle", + "trigger" + ] + }, + "mass": { + "type": "number", + "description": "The mass of this physics body in kilograms.", + "default": 1.0 + }, + "linearVelocity": { + "type": "array", + "description": "The initial linear velocity of the body in meters per second.", + "default": [0.0, 0.0, 0.0] + }, + "angularVelocity": { + "type": "array", + "description": "The initial angular velocity of the body in radians per second.", + "default": [0.0, 0.0, 0.0] + }, + "inertiaTensor": { + "type": "array", + "description": "The inertia tensor 3x3 symmetric matrix of the body in kilogram meter squared.", + "default": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] + } + } +} diff --git a/extensions/2.0/Vendor/OMI_physics_joint/README.md b/extensions/2.0/Vendor/OMI_physics_joint/README.md new file mode 100644 index 0000000000..af18e9004a --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_joint/README.md @@ -0,0 +1,200 @@ +# OMI_physics_joint + +## Contributors + +* Aaron Franke, The Mirror Megaverse Inc. + +## Status + +Open Metaverse Interoperability Group Stage 1 Proposal + +## Dependencies + +Written against the glTF 2.0 spec. + +Depends on the `OMI_physics_body` spec, which depends on the `OMI_collider` spec. + +## Overview + +This extension allows defining a glTF node as a physics joint for constraining rigid bodies. + +Each physics joint node is a separate node that references the two bodies it joints together. At least one of the bodies must be a rigid body (`OMI_physics_body` "rigid" or "vehicle") for the joint to function. One or zero of the connected nodes may be a solid body that joints cannot move (`OMI_physics_body` "static", "kinematic", "character"). A joint cannot be connected to a trigger body, and cannot be connected to a non-`OMI_physics_body` glTF node. + +Each physics joint node must reference one or more joint constraints defined in the document-level joint constraints array. + +A joint should be on its own glTF node, it should not be on the same node as a mesh, camera, light, collider, physics body, etc. + +### Example: + +This example defines 2 rigid bodies that are connected with a joint that constrains linearly on a fixed point, also known as a "pin" joint. This example JSON is a subset of the [examples/simple_joint.gltf](examples/simple_joint.gltf) file. + +```json +{ + "asset": { + "version": "2.0" + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body", + "OMI_physics_joint" + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "height": 0.5, + "radius": 0.05, + "type": "capsule" + } + ] + }, + "OMI_physics_joint": { + "constraints": [ + { + "linearAxes": [0, 1, 2] + } + ] + } + }, + "nodes": [ + { + "extensions": { + "OMI_physics_joint": { + "constraints": [0], + "nodeA": 1, + "nodeB": 2 + } + }, + "name": "PinJoint", + "translation": [-0.23, 0.6, 0.0] + }, + { + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "BodyA", + "rotation": [0.0, 0.0, -0.17364804446697, 0.984807789325714], + "translation": [-0.45, 0.68, 0.0] + }, + { + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "BodyB", + "translation": [0.0, 0.6, 0.0] + } + ] +} +``` + +More example assets can be found in the [examples/](examples/) folder. + +## glTF Schema Updates + +This extension consists of three new data structures for defining joints. A glTF file with joints should have a document-level `"OMI_physics_joint"` object added to the document `"extensions"` which contains an array of joint constraints. Each joint constraint is an object defined as the below spec. Then, the key `"OMI_physics_joint"` can be added to the node-level `"extensions"` of a glTF node to define that node as a physics joint. Each joint node has an array of constraints that references the document-level constraints array by index, and each joint node also references 2 physics body nodes. + +The extension must also be added to the glTF's `extensionsUsed` array and because it is optional, it does not need to be added to the `extensionsRequired` array. + +### Joint Constraint Property Summary + +| | Type | Description | Default value | +| --------------- | -------------- | ----------------------------------------------------------------- | ---------------- | +| **linearAxes** | `number[0..3]` | The axes to constrain. Can only contain 0 (X), 1 (Y), or 2 (Z). | [] (empty array) | +| **angularAxes** | `number[0..3]` | The axes to constrain. Can only contain 0 (X), 1 (Y), or 2 (Z). | [] (empty array) | +| **lowerLimit** | `number` | The lower limit of the constraint, in meters or radians. | 0.0 | +| **upperLimit** | `number` | The lower limit of the constraint, in meters or radians. | 0.0 | +| **stiffness** | `number` | The stiffness of the limits, how hard to spring back when beyond. | Infinity | +| **damping** | `number` | When beyond the limits, the damping of the springing back motion. | 1.0 | + +A joint constraint should define at least one linear axis or one angular axis, otherwise the joint constraint will not perform any constraints. + +The reason that joints constraints are defined at the document-level and referenced on nodes is because it's very common to have many joints with the same constraints. For example, a long rope using many bodies each with pin joints (linear axes constrained) would have the same joint constraints repeated many times, but with different nodes attached. + +#### Linear Axes + +The `"linearAxes"` property defines a list of linear axes to constrain. Can only contain 3 possible values, 0 (X), 1 (Y), or 2 (Z). If empty or not specified, this joint constraint does not constrain linearly. + +#### Angular Axes + +The `"angularAxes"` property defines a list of angular axes to constrain. Can only contain 3 possible values, 0 (X), 1 (Y), or 2 (Z). If empty or not specified, this joint constraint does not constrain angularly. + +#### Lower Limit + +The `"lowerLimit"` property defines the lower limit of the constraint in meters or radians, depending on whether the constraint is linear or angular. If not specified, the default value is 0.0. + +The lower limit must be less than or equal to the upper limit, otherwise the constraint is invalid. If the lower and upper limits are equal, the constraint is fixed on that value. + +#### Upper Limit + +The `"upperLimit"` property defines the upper limit of the constraint in meters or radians, depending on whether the constraint is linear or angular. If not specified, the default value is 0.0. + +The upper limit must be greater than or equal to the lower limit, otherwise the constraint is invalid. If the lower and upper limits are equal, the constraint is fixed on that value. + +#### Stiffness + +The `"stiffness"` property defines how soft or hard the limits are, and how much force should be applied to the bodies to spring back once they surpasses the limits. Must be positive. If not specified, the default value is infinity. + +A lower value indicates a softer limit, while a higher value indicades a harder limit. A value of infinity means the limits should be completely hard and may not be surpassed. Implementations are expected to clamp this to within the limits of the physics engine. For example, if a physics engine cannot handle an infinite stiffness, it should be set to a high value, since an extremely stiff joint is close enough to an infinitely stiff joint. For more information, see the Wikipedia article on stiffness. + +#### Damping + +The `"damping"` property defines the amount of damping the bodies should experience while the bodies surpasses the limits and are springing back to be within them. Damping must not be applied when within the limits. Must be non-negative. If not specified, the default value is 1.0. + +### Node Property Summary + +| | Type | Description | Default value | +| --------------- | ---------- | -------------------------------------------------------------------------- | -------------------- | +| **constraints** | `number[]` | Array of indices in the document-level constraint array. Must be integers. | Required, no default | +| **nodeA** | `number` | Node index of one physics body used by the joint. Must be an integer. | Required, no default | +| **nodeB** | `number` | Node index of one physics body used by the joint. Must be an integer. | Required, no default | + +#### Constraints + +The `"constraints"` property defines the joint constraints to use for this joint. Must be an array of integers which are the index of the constraint in the document-level array. + +If a joint node has multiple joint constraints that overlap each other, later constraints should override the previous constraints. + +#### Node A and Node B + +Each of these properties defines one of two bodies used by the joint. Must be an integer which is the index of the glTF node, and that node must be a physics body defined using the `OMI_physics_body` spec. + +At least one of the connected nodes must be a physics body using rigid body physics, meaning `OMI_physics_body` set to "rigid" or "vehicle". If neither node is using rigid body physics, the joints will not work. When physics body nodes are joined, they should not collide with each other. One or zero of the nodes can be a solid body that cannot be moved by joints, meaning `OMI_physics_body` set to "static", "kinematic" or "character". A connected node cannot be null, cannot be a non-body, and cannot be a trigger body. + +The position on the body on which the joint operates is determined by the position of the joint relative to each body node. As such, the initial position of the joint node does matter. + +### Document Property Summary + +| | Type | Description | Default value | +| --------------- | ---------- | ---------------------------------- | -------------------- | +| **constraints** | `object[]` | Array of joint constraint objects. | Required, no default | + +### Special Cases + +While a generic joint type is very useful and extensible, it's also worth defining when a generic joint is equivalent to a special-purpose joint. These mappings can be used to convert to more optimized joint types if supported in a physics engine, or as simply a friendly name to display to a user. + +In this chart, "fixed" means "constrained with lower and upper limits set to zero", and "free" means "not constrained". + +| Special case name | Description | +| ------------------ | -------------------------------------------------------------------------------------------------------------------------------- | +| Fixed / Weld Joint | All axes fixed. | +| Pin Joint | All linear axes fixed, all angular axes free. | +| Hinge Joint | One angular axis constrained with non-equal lower and upper limits, the rest are fixed. | +| Slider Joint | One linear axis and optionally the angular axis around it constrained with non-equal lower and upper limits, the rest are fixed. | + +### JSON Schema + +See [schema/joint_constraint.schema.json](schema/joint_constraint.schema.json), [schema/node.OMI_physics_joint.schema.json](schema/node.OMI_physics_joint.schema.json), and [schema/glTF.OMI_physics_joint.schema.json](schema/glTF.OMI_physics_joint.schema.json) for the schemas. + +## Known Implementations + +* Godot Engine add-on + +## Resources: + +* Godot Joint3D https://docs.godotengine.org/en/latest/classes/class_generic6dofjoint3d.html +* Unity Joints https://docs.unity3d.com/Manual/Joints.html +* Wikipedia Stiffness https://en.wikipedia.org/wiki/Stiffness diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/hanging_rope.gltf b/extensions/2.0/Vendor/OMI_physics_joint/examples/hanging_rope.gltf new file mode 100644 index 0000000000..f8d444bfe3 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_joint/examples/hanging_rope.gltf @@ -0,0 +1,877 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 0.25, + 0.25, + 0.25 + ], + "min": [ + -0.25, + -0.25, + -0.25 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.25, + 0.05 + ], + "min": [ + -0.05, + -0.25, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 8, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 9, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 10, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.25, + 0.05 + ], + "min": [ + -0.05, + -0.25, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 11, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 12, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 13, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 14, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 15, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.25, + 0.05 + ], + "min": [ + -0.05, + -0.25, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 16, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 17, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 18, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 19, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "generator": "Godot Engine v4.1.dev.custom_build@9f12e7b52d944281a39b7d3a33de6700c76cc23a", + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 0 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 288 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 672 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 960 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 1152 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 1296 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 24696 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 55896 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 79296 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 94896 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 136368 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 159768 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 190968 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 214368 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 229968 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 271440 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 294840 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 326040 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 349440 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 365040 + } + ], + "buffers": [ + { + "byteLength": 406512, + "uri": "hanging_rope0.bin" + } + ], + "cameras": [ + { + "perspective": { + "yfov": 1.30899691581726, + "zfar": 4000, + "znear": 0.0500000007450581 + }, + "type": "perspective" + } + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [ + 0.5, + 0.5, + 0.5 + ], + "type": "box" + }, + { + "height": 0.5, + "radius": 0.0500000007450581, + "type": "capsule" + } + ] + }, + "OMI_physics_joint": { + "constraints": [ + { + "linearAxes": [ + 0, + 1, + 2 + ], + "stiffness": 0.300000011920929 + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body", + "OMI_physics_joint" + ], + "materials": [ + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + } + ], + "meshes": [ + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 2, + "POSITION": 0, + "TANGENT": 1, + "TEXCOORD_0": 3 + }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 7, + "POSITION": 5, + "TANGENT": 6, + "TEXCOORD_0": 8 + }, + "indices": 9, + "material": 1, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 12, + "POSITION": 10, + "TANGENT": 11, + "TEXCOORD_0": 13 + }, + "indices": 14, + "material": 2, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 17, + "POSITION": 15, + "TANGENT": 16, + "TEXCOORD_0": 18 + }, + "indices": 19, + "material": 3, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1, + 4, + 5, + 8, + 9, + 12, + 13, + 16 + ], + "extensions": {}, + "name": "HangingRope" + }, + { + "children": [ + 2 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "Ceiling", + "translation": [ + 0.00000000000208164995657567, + 1.5, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 3 + ], + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "CeilingCollider" + }, + { + "extensions": {}, + "mesh": 0, + "name": "CeilingMesh" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0 + ], + "nodeA": 5, + "nodeB": 1 + } + }, + "name": "PinJoint1", + "translation": [ + -0.0000000279397, + 1.25, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 6 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "RopeSegmentTop", + "rotation": [ + 0.000000000000000213587655926077, + 0.000000000000000123314960753772, + 0.258819162845612, + 0.965925812721252 + ], + "translation": [ + -0.17000000178814, + 1.14999997615814, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 7 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "RopeColliderTop", + "rotation": [ + 0.000000000000000246629630339969, + 0.00000000000000000000000935848017, + 0.70710676908493, + 0.70710676908493 + ] + }, + { + "extensions": {}, + "mesh": 1, + "name": "RopeMeshTop" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0 + ], + "nodeA": 9, + "nodeB": 5 + } + }, + "name": "PinJoint2", + "translation": [ + -0.37000000476837, + 1.02999997138977, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 10 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "RopeSegmentMiddle", + "rotation": [ + 0.000000000000000202027284087501, + 0.000000000000000141460709354785, + 0.173648044466972, + 0.984807789325714 + ], + "translation": [ + -0.5799999833107, + 0.949999988079071, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 11 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "RopeColliderMiddle", + "rotation": [ + 0.000000000000000246629630339969, + 0.00000000000000000000000935848017, + 0.70710676908493, + 0.70710676908493 + ] + }, + { + "extensions": {}, + "mesh": 2, + "name": "RopeMeshMiddle" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0 + ], + "nodeA": 13, + "nodeB": 9 + } + }, + "name": "PinJoint3", + "translation": [ + -0.80000001192093, + 0.870000004768372, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 14 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "RopeSegmentBottom", + "translation": [ + -1.02999997138977, + 0.870000004768372, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 15 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "RopeColliderBottom", + "rotation": [ + 0.000000000000000246629630339969, + 0.00000000000000000000000935848017, + 0.70710676908493, + 0.70710676908493 + ] + }, + { + "extensions": {}, + "mesh": 3, + "name": "RopeMeshBottom" + }, + { + "camera": 0, + "extensions": {}, + "name": "Camera", + "translation": [ + 0.00000000000208164995657567, + 0.600000023841858, + 1.5 + ] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/hanging_rope0.bin b/extensions/2.0/Vendor/OMI_physics_joint/examples/hanging_rope0.bin new file mode 100644 index 0000000000..4c654f4f9b Binary files /dev/null and b/extensions/2.0/Vendor/OMI_physics_joint/examples/hanging_rope0.bin differ diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/pendulum_balls.gltf b/extensions/2.0/Vendor/OMI_physics_joint/examples/pendulum_balls.gltf new file mode 100644 index 0000000000..8e030e87b3 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_joint/examples/pendulum_balls.gltf @@ -0,0 +1,1333 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0.1, + 0.1 + ], + "min": [ + -1, + -0.1, + -0.1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.249717, + 0.25, + 0.249717 + ], + "min": [ + -0.249717, + -0.25, + -0.249717 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.998868, + 1, + 0.998868 + ], + "min": [ + -0.998869, + -1, + -0.998867 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 8, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 9, + "byteOffset": 0, + "componentType": 5125, + "count": 12672, + "max": [ + 2209 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 10, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.5, + 0.05 + ], + "min": [ + -0.05, + -0.5, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 11, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 12, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 13, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 14, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 15, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.249717, + 0.25, + 0.249717 + ], + "min": [ + -0.249717, + -0.25, + -0.249717 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 16, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 17, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.998868, + 1, + 0.998868 + ], + "min": [ + -0.998869, + -1, + -0.998867 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 18, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 19, + "byteOffset": 0, + "componentType": 5125, + "count": 12672, + "max": [ + 2209 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 20, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.5, + 0.05 + ], + "min": [ + -0.05, + -0.5, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 21, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 22, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 23, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 24, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 25, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.249717, + 0.25, + 0.249717 + ], + "min": [ + -0.249717, + -0.25, + -0.249717 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 26, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 27, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.998868, + 1, + 0.998868 + ], + "min": [ + -0.998869, + -1, + -0.998867 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 28, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 29, + "byteOffset": 0, + "componentType": 5125, + "count": 12672, + "max": [ + 2209 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 30, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.5, + 0.05 + ], + "min": [ + -0.05, + -0.5, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 31, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 32, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 33, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 34, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "generator": "Godot Engine v4.1.dev.custom_build@9f12e7b52d944281a39b7d3a33de6700c76cc23a", + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 0 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 288 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 672 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 960 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 1152 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 1296 + }, + { + "buffer": 0, + "byteLength": 35360, + "byteOffset": 27816 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 63176 + }, + { + "buffer": 0, + "byteLength": 17680, + "byteOffset": 89696 + }, + { + "buffer": 0, + "byteLength": 50688, + "byteOffset": 107376 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 158064 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 181464 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 212664 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 236064 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 251664 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 293136 + }, + { + "buffer": 0, + "byteLength": 35360, + "byteOffset": 319656 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 355016 + }, + { + "buffer": 0, + "byteLength": 17680, + "byteOffset": 381536 + }, + { + "buffer": 0, + "byteLength": 50688, + "byteOffset": 399216 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 449904 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 473304 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 504504 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 527904 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 543504 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 584976 + }, + { + "buffer": 0, + "byteLength": 35360, + "byteOffset": 611496 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 646856 + }, + { + "buffer": 0, + "byteLength": 17680, + "byteOffset": 673376 + }, + { + "buffer": 0, + "byteLength": 50688, + "byteOffset": 691056 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 741744 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 765144 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 796344 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 819744 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 835344 + } + ], + "buffers": [ + { + "byteLength": 876816, + "uri": "pendulum_balls0.bin" + } + ], + "cameras": [ + { + "perspective": { + "yfov": 1.30899691581726, + "zfar": 4000, + "znear": 0.0500000007450581 + }, + "type": "perspective" + } + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [ + 2, + 0.200000002980232, + 0.200000002980232 + ], + "type": "box" + }, + { + "radius": 0.25, + "type": "sphere" + } + ] + }, + "OMI_physics_joint": { + "constraints": [ + { + "linearAxes": [ + 0, + 1, + 2 + ], + "stiffness": 0.300000011920929 + }, + { + "angularAxes": [ + 0, + 1 + ], + "stiffness": 0.300000011920929 + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body", + "OMI_physics_joint" + ], + "materials": [ + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + } + ], + "meshes": [ + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 2, + "POSITION": 0, + "TANGENT": 1, + "TEXCOORD_0": 3 + }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 7, + "POSITION": 5, + "TANGENT": 6, + "TEXCOORD_0": 8 + }, + "indices": 9, + "material": 1, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 12, + "POSITION": 10, + "TANGENT": 11, + "TEXCOORD_0": 13 + }, + "indices": 14, + "material": 2, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 17, + "POSITION": 15, + "TANGENT": 16, + "TEXCOORD_0": 18 + }, + "indices": 19, + "material": 3, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 22, + "POSITION": 20, + "TANGENT": 21, + "TEXCOORD_0": 23 + }, + "indices": 24, + "material": 4, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 27, + "POSITION": 25, + "TANGENT": 26, + "TEXCOORD_0": 28 + }, + "indices": 29, + "material": 5, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 32, + "POSITION": 30, + "TANGENT": 31, + "TEXCOORD_0": 33 + }, + "indices": 34, + "material": 6, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1, + 4, + 5, + 9, + 10, + 14, + 15, + 19 + ], + "extensions": {}, + "name": "PendulumBalls" + }, + { + "children": [ + 2 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "TopBody", + "translation": [ + 0.00000000000208164995657567, + 1, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 3 + ], + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "TopBodyShape" + }, + { + "extensions": {}, + "mesh": 0, + "name": "TopBodyMesh" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0, + 1 + ], + "nodeA": 1, + "nodeB": 5 + } + }, + "name": "HingeJoint1", + "translation": [ + 0.00000000000208164995657567, + 0.899999976158142, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 6, + 8 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "Ball1", + "translation": [ + 0.00000000000208164995657567, + -0.25, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 7 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "BallShape1" + }, + { + "extensions": {}, + "mesh": 1, + "name": "BallMesh1" + }, + { + "extensions": {}, + "mesh": 2, + "name": "BallStringMesh1", + "translation": [ + 0.00000000000208164995657567, + 0.699999988079071, + 0.00000000000208164995657567 + ] + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0, + 1 + ], + "nodeA": 1, + "nodeB": 10 + } + }, + "name": "HingeJoint2", + "translation": [ + -0.44999998807907, + 0.899999976158142, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 11, + 13 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "Ball2", + "rotation": [ + 0.000000000000000094381003489835, + 0.000000000000000227855912687686, + -0.38268345594406, + 0.923879563808441 + ], + "translation": [ + -1.26317000389099, + 0.0868272036314011, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 12 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "BallShape2" + }, + { + "extensions": {}, + "mesh": 3, + "name": "BallMesh2" + }, + { + "extensions": {}, + "mesh": 4, + "name": "BallStringMesh2", + "translation": [ + 0.00000000000208164995657567, + 0.699999988079071, + 0.00000000000208164995657567 + ] + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0, + 1 + ], + "nodeA": 1, + "nodeB": 15 + } + }, + "name": "HingeJoint3", + "rotation": [ + 0.000000000000000213587655926077, + 0.000000000000000123314960753772, + 0.258819162845612, + 0.965925812721252 + ], + "translation": [ + 0.449999988079071, + 0.899999976158142, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 16, + 18 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "Ball3", + "rotation": [ + 0.000000000000000440183937976967, + -0, + 0.991444885730743, + 0.130526155233383 + ], + "translation": [ + 0.747641980648041, + 2.01080989837646, + 0.00000000000208192989757661 + ] + }, + { + "children": [ + 17 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "BallShape22" + }, + { + "extensions": {}, + "mesh": 5, + "name": "BallMesh22" + }, + { + "extensions": {}, + "mesh": 6, + "name": "BallStringMesh22", + "translation": [ + 0.00000000000208164995657567, + 0.699999988079071, + 0.00000000000208164995657567 + ] + }, + { + "camera": 0, + "extensions": {}, + "name": "Camera", + "translation": [ + 0.00000000000208164995657567, + 0.00000000000208164995657567, + 1.5 + ] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/pendulum_balls0.bin b/extensions/2.0/Vendor/OMI_physics_joint/examples/pendulum_balls0.bin new file mode 100644 index 0000000000..fc06e65e02 Binary files /dev/null and b/extensions/2.0/Vendor/OMI_physics_joint/examples/pendulum_balls0.bin differ diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/rope_railing.gltf b/extensions/2.0/Vendor/OMI_physics_joint/examples/rope_railing.gltf new file mode 100644 index 0000000000..644cb6577e --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_joint/examples/rope_railing.gltf @@ -0,0 +1,1480 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 0.075, + 0.55, + 0.075 + ], + "min": [ + -0.075, + -0.55, + -0.075 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.25, + 0.05 + ], + "min": [ + -0.05, + -0.25, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 8, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 9, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 10, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.25, + 0.05 + ], + "min": [ + -0.05, + -0.25, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 11, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 12, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 13, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 14, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 15, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.25, + 0.05 + ], + "min": [ + -0.05, + -0.25, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 16, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 17, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 18, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 19, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 20, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.25, + 0.05 + ], + "min": [ + -0.05, + -0.25, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 21, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 22, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 23, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 24, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 25, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.25, + 0.05 + ], + "min": [ + -0.05, + -0.25, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 26, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 27, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 28, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 29, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 30, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 0.075, + 0.55, + 0.075 + ], + "min": [ + -0.075, + -0.55, + -0.075 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 31, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 32, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 33, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 34, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "generator": "Godot Engine v4.1.dev.custom_build@9f12e7b52d944281a39b7d3a33de6700c76cc23a", + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 0 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 288 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 672 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 960 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 1152 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 1296 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 24696 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 55896 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 79296 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 94896 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 136368 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 159768 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 190968 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 214368 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 229968 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 271440 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 294840 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 326040 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 349440 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 365040 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 406512 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 429912 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 461112 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 484512 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 500112 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 541584 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 564984 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 596184 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 619584 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 635184 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 676656 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 676944 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 677328 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 677616 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 677808 + } + ], + "buffers": [ + { + "byteLength": 677952, + "uri": "rope_railing0.bin" + } + ], + "cameras": [ + { + "perspective": { + "yfov": 1.30899691581726, + "zfar": 4000, + "znear": 0.0500000007450581 + }, + "type": "perspective" + } + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [ + 0.150000005960464, + 1.10000002384186, + 0.150000005960464 + ], + "type": "box" + }, + { + "height": 0.5, + "radius": 0.0500000007450581, + "type": "capsule" + } + ] + }, + "OMI_physics_joint": { + "constraints": [ + { + "linearAxes": [ + 0, + 1, + 2 + ], + "stiffness": 0.300000011920929 + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body", + "OMI_physics_joint" + ], + "materials": [ + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + } + ], + "meshes": [ + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 2, + "POSITION": 0, + "TANGENT": 1, + "TEXCOORD_0": 3 + }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 7, + "POSITION": 5, + "TANGENT": 6, + "TEXCOORD_0": 8 + }, + "indices": 9, + "material": 1, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 12, + "POSITION": 10, + "TANGENT": 11, + "TEXCOORD_0": 13 + }, + "indices": 14, + "material": 2, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 17, + "POSITION": 15, + "TANGENT": 16, + "TEXCOORD_0": 18 + }, + "indices": 19, + "material": 3, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 22, + "POSITION": 20, + "TANGENT": 21, + "TEXCOORD_0": 23 + }, + "indices": 24, + "material": 4, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 27, + "POSITION": 25, + "TANGENT": 26, + "TEXCOORD_0": 28 + }, + "indices": 29, + "material": 5, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 32, + "POSITION": 30, + "TANGENT": 31, + "TEXCOORD_0": 33 + }, + "indices": 34, + "material": 6, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1, + 4, + 5, + 8, + 9, + 12, + 13, + 16, + 17, + 20, + 21, + 24, + 25, + 28 + ], + "extensions": {}, + "name": "RopeRailing" + }, + { + "children": [ + 2 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "PoleLeft", + "translation": [ + -1.10000002384186, + 0.550000011920929, + 0.00000000000208164735449046 + ] + }, + { + "children": [ + 3 + ], + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "PoleColliderLeft" + }, + { + "extensions": {}, + "mesh": 0, + "name": "PoleMeshLeft" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0 + ], + "nodeA": 1, + "nodeB": 5 + } + }, + "name": "PinJoint1", + "translation": [ + -1.02999997138977, + 0.980000019073486, + 0.00000000000208164735449046 + ] + }, + { + "children": [ + 6 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "RopeSegmentLeft", + "rotation": [ + 0.000000000000000123314947518882, + 0.000000000000000213587655926077, + -0.25881916284561, + 0.965925812721252 + ], + "translation": [ + -0.86000001430511, + 0.879999995231628, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 7 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "RopeColliderLeft", + "rotation": [ + 0.000000000000000246629630339969, + 0.00000000000000000000000935848017, + 0.70710676908493, + 0.70710676908493 + ] + }, + { + "extensions": {}, + "mesh": 1, + "name": "RopeMeshLeft" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0 + ], + "nodeA": 5, + "nodeB": 9 + } + }, + "name": "PinJoint2", + "translation": [ + -0.66000002622604, + 0.759999990463257, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 10 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "RopeSegmentLeftMiddle", + "rotation": [ + 0.000000000000000141460722589675, + 0.000000000000000202027284087501, + -0.17364804446697, + 0.984807789325714 + ], + "translation": [ + -0.44999998807907, + 0.680000007152557, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 11 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "RopeColliderLeftMiddle", + "rotation": [ + 0.000000000000000246629630339969, + 0.00000000000000000000000935848017, + 0.70710676908493, + 0.70710676908493 + ] + }, + { + "extensions": {}, + "mesh": 2, + "name": "RopeMeshLeftMiddle" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0 + ], + "nodeA": 9, + "nodeB": 13 + } + }, + "name": "PinJoint3", + "translation": [ + -0.23000000417233, + 0.600000023841858, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 14 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "RopeSegmentMiddle", + "translation": [ + 0.00000000000208164995657567, + 0.600000023841858, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 15 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "RopeColliderMiddle", + "rotation": [ + 0.000000000000000246629630339969, + 0.00000000000000000000000935848017, + 0.70710676908493, + 0.70710676908493 + ] + }, + { + "extensions": {}, + "mesh": 3, + "name": "RopeMeshMiddle" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0 + ], + "nodeA": 13, + "nodeB": 17 + } + }, + "name": "PinJoint4", + "translation": [ + 0.230000004172325, + 0.600000023841858, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 18 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "RopeSegmentRightMiddle", + "rotation": [ + 0.000000000000000202027284087501, + 0.000000000000000141460709354785, + 0.173648044466972, + 0.984807789325714 + ], + "translation": [ + 0.449999988079071, + 0.680000007152557, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 19 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "RopeColliderRightMiddle", + "rotation": [ + 0.000000000000000246629630339969, + 0.00000000000000000000000935848017, + 0.70710676908493, + 0.70710676908493 + ] + }, + { + "extensions": {}, + "mesh": 4, + "name": "RopeMeshRightMiddle" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0 + ], + "nodeA": 17, + "nodeB": 21 + } + }, + "name": "PinJoint5", + "translation": [ + 0.660000026226044, + 0.759999990463257, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 22 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "RopeSegmentRight", + "rotation": [ + 0.000000000000000213587655926077, + 0.000000000000000123314960753772, + 0.258819162845612, + 0.965925812721252 + ], + "translation": [ + 0.860000014305115, + 0.879999995231628, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 23 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "RopeColliderRight", + "rotation": [ + 0.000000000000000246629630339969, + 0.00000000000000000000000935848017, + 0.70710676908493, + 0.70710676908493 + ] + }, + { + "extensions": {}, + "mesh": 5, + "name": "RopeMeshRight" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0 + ], + "nodeA": 21, + "nodeB": 25 + } + }, + "name": "PinJoint6", + "translation": [ + 1.02999997138977, + 0.980000019073486, + 0.00000000000208164735449046 + ] + }, + { + "children": [ + 26 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "PoleRight", + "translation": [ + 1.10000002384186, + 0.550000011920929, + 0.00000000000208164735449046 + ] + }, + { + "children": [ + 27 + ], + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "PoleColliderRight" + }, + { + "extensions": {}, + "mesh": 6, + "name": "PoleMeshRight" + }, + { + "camera": 0, + "extensions": {}, + "name": "Camera", + "translation": [ + 0.00000000000208164995657567, + 0.600000023841858, + 1.5 + ] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/rope_railing0.bin b/extensions/2.0/Vendor/OMI_physics_joint/examples/rope_railing0.bin new file mode 100644 index 0000000000..bf45c6c7ca Binary files /dev/null and b/extensions/2.0/Vendor/OMI_physics_joint/examples/rope_railing0.bin differ diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/simple_joint.gltf b/extensions/2.0/Vendor/OMI_physics_joint/examples/simple_joint.gltf new file mode 100644 index 0000000000..208313a69e --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_joint/examples/simple_joint.gltf @@ -0,0 +1,588 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.25, + 0.05 + ], + "min": [ + -0.05, + -0.25, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.25, + 0.05 + ], + "min": [ + -0.05, + -0.25, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 8, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 9, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 10, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 0.5, + 0.125, + 0.5 + ], + "min": [ + -0.5, + -0.125, + -0.5 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 11, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 12, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 13, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 14, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "generator": "Godot Engine v4.1.dev.custom_build@9f12e7b52d944281a39b7d3a33de6700c76cc23a", + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 0 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 23400 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 54600 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 78000 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 93600 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 135072 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 158472 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 189672 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 213072 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 228672 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 270144 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 270432 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 270816 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 271104 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 271296 + } + ], + "buffers": [ + { + "byteLength": 271440, + "uri": "simple_joint0.bin" + } + ], + "cameras": [ + { + "perspective": { + "yfov": 1.30899691581726, + "zfar": 4000, + "znear": 0.0500000007450581 + }, + "type": "perspective" + } + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "height": 0.5, + "radius": 0.05, + "type": "capsule" + }, + { + "size": [1, 0.25, 1], + "type": "box" + } + ] + }, + "OMI_physics_joint": { + "constraints": [ + { + "linearAxes": [0, 1, 2] + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body", + "OMI_physics_joint" + ], + "materials": [ + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + } + ], + "meshes": [ + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 2, + "POSITION": 0, + "TANGENT": 1, + "TEXCOORD_0": 3 + }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 7, + "POSITION": 5, + "TANGENT": 6, + "TEXCOORD_0": 8 + }, + "indices": 9, + "material": 1, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 12, + "POSITION": 10, + "TANGENT": 11, + "TEXCOORD_0": 13 + }, + "indices": 14, + "material": 2, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "extensions": { + "OMI_physics_joint": { + "constraints": [0], + "nodeA": 1, + "nodeB": 2 + } + }, + "name": "PinJoint", + "translation": [-0.23, 0.6, 0.0] + }, + { + "children": [4], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "BodyA", + "rotation": [0.0, 0.0, -0.17364804446697, 0.984807789325714], + "translation": [-0.45, 0.68, 0.0] + }, + { + "children": [6], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "BodyB", + "translation": [0.0, 0.6, 0.0] + }, + { + "children": [0, 1, 2, 8, 11], + "extensions": {}, + "name": "SimpleJoint" + }, + { + "children": [5], + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "ColliderA", + "rotation": [0.0, 0.0, 0.70710676908493, 0.70710676908493] + }, + { + "extensions": {}, + "mesh": 0, + "name": "MeshA" + }, + { + "children": [7], + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "ColliderB", + "rotation": [0.0, 0.0, 0.70710676908493, 0.70710676908493] + }, + { + "extensions": {}, + "mesh": 1, + "name": "MeshB" + }, + { + "children": [9], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "FloorBody", + "translation": [0.1, 0.0, 0.0] + }, + { + "children": [10], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "FloorShape" + }, + { + "extensions": {}, + "mesh": 2, + "name": "FloorMesh" + }, + { + "camera": 0, + "extensions": {}, + "name": "Camera", + "translation": [0.0, 0.5, 1.5] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [3] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/simple_joint0.bin b/extensions/2.0/Vendor/OMI_physics_joint/examples/simple_joint0.bin new file mode 100644 index 0000000000..e55afe0020 Binary files /dev/null and b/extensions/2.0/Vendor/OMI_physics_joint/examples/simple_joint0.bin differ diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/slider_ball.gltf b/extensions/2.0/Vendor/OMI_physics_joint/examples/slider_ball.gltf new file mode 100644 index 0000000000..ddd65cb045 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_joint/examples/slider_ball.gltf @@ -0,0 +1,490 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0.05, + 0.05 + ], + "min": [ + -1, + -0.05, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.249717, + 0.25, + 0.249717 + ], + "min": [ + -0.249717, + -0.25, + -0.249717 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.998868, + 1, + 0.998868 + ], + "min": [ + -0.998869, + -1, + -0.998867 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 8, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 9, + "byteOffset": 0, + "componentType": 5125, + "count": 12672, + "max": [ + 2209 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "generator": "Godot Engine v4.1.dev.custom_build@9f12e7b52d944281a39b7d3a33de6700c76cc23a", + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 0 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 288 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 672 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 960 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 1152 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 1296 + }, + { + "buffer": 0, + "byteLength": 35360, + "byteOffset": 27816 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 63176 + }, + { + "buffer": 0, + "byteLength": 17680, + "byteOffset": 89696 + }, + { + "buffer": 0, + "byteLength": 50688, + "byteOffset": 107376 + } + ], + "buffers": [ + { + "byteLength": 158064, + "uri": "slider_ball0.bin" + } + ], + "cameras": [ + { + "perspective": { + "yfov": 1.30899691581726, + "zfar": 4000, + "znear": 0.0500000007450581 + }, + "type": "perspective" + } + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [ + 2, + 0.100000001490116, + 0.100000001490116 + ], + "type": "box" + }, + { + "radius": 0.25, + "type": "sphere" + } + ] + }, + "OMI_physics_joint": { + "constraints": [ + { + "damping": 0.5, + "linearAxes": [ + 0 + ], + "lowerLimit": -1.75, + "stiffness": 1, + "upperLimit": 0.25 + }, + { + "linearAxes": [ + 1, + 2 + ], + "stiffness": 1 + }, + { + "angularAxes": [ + 0 + ], + "damping": 0, + "stiffness": 1 + }, + { + "angularAxes": [ + 1, + 2 + ], + "stiffness": 1 + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body", + "OMI_physics_joint" + ], + "materials": [ + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + } + ], + "meshes": [ + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 2, + "POSITION": 0, + "TANGENT": 1, + "TEXCOORD_0": 3 + }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 7, + "POSITION": 5, + "TANGENT": 6, + "TEXCOORD_0": 8 + }, + "indices": 9, + "material": 1, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1, + 4, + 5, + 8 + ], + "extensions": {}, + "name": "PendulumBalls" + }, + { + "children": [ + 2 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "SliderLine" + }, + { + "children": [ + 3 + ], + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "SliderLineShape" + }, + { + "extensions": {}, + "mesh": 0, + "name": "SliderLineMesh" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0, + 1, + 2, + 3 + ], + "nodeA": 5, + "nodeB": 1 + } + }, + "name": "SliderJoint", + "translation": [ + -0.75, + 0.00000000000208164995657567, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 6 + ], + "extensions": { + "OMI_physics_body": { + "angularVelocity": [ + 0.0174532998353243, + 0.0174532998353243, + 0.0174532998353243 + ], + "linearVelocity": [ + 1, + 0.00000000000208164995657567, + 0.00000000000208164995657567 + ], + "type": "rigid" + } + }, + "name": "Ball", + "translation": [ + -0.75, + 0.00000000000208164995657567, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 7 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "BallShape" + }, + { + "extensions": {}, + "mesh": 1, + "name": "BallMesh" + }, + { + "camera": 0, + "extensions": {}, + "name": "Camera", + "translation": [ + 0.00000000000208164995657567, + 0.00000000000208164995657567, + 1.5 + ] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/slider_ball0.bin b/extensions/2.0/Vendor/OMI_physics_joint/examples/slider_ball0.bin new file mode 100644 index 0000000000..c75c0d74e3 Binary files /dev/null and b/extensions/2.0/Vendor/OMI_physics_joint/examples/slider_ball0.bin differ diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/swing_and_slide.gltf b/extensions/2.0/Vendor/OMI_physics_joint/examples/swing_and_slide.gltf new file mode 100644 index 0000000000..21e4b06b45 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_joint/examples/swing_and_slide.gltf @@ -0,0 +1,635 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0.05, + 0.05 + ], + "min": [ + -1, + -0.05, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.249717, + 0.25, + 0.249717 + ], + "min": [ + -0.249717, + -0.25, + -0.249717 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 0.998868, + 1, + 0.998868 + ], + "min": [ + -0.998869, + -1, + -0.998867 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 8, + "byteOffset": 0, + "componentType": 5126, + "count": 2210, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 9, + "byteOffset": 0, + "componentType": 5125, + "count": 12672, + "max": [ + 2209 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 10, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.5, + 0.05 + ], + "min": [ + -0.05, + -0.5, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 11, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 12, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 13, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 14, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "generator": "Godot Engine v4.1.dev.custom_build@9f12e7b52d944281a39b7d3a33de6700c76cc23a", + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 0 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 288 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 672 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 960 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 1152 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 1296 + }, + { + "buffer": 0, + "byteLength": 35360, + "byteOffset": 27816 + }, + { + "buffer": 0, + "byteLength": 26520, + "byteOffset": 63176 + }, + { + "buffer": 0, + "byteLength": 17680, + "byteOffset": 89696 + }, + { + "buffer": 0, + "byteLength": 50688, + "byteOffset": 107376 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 158064 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 181464 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 212664 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 236064 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 251664 + } + ], + "buffers": [ + { + "byteLength": 293136, + "uri": "swing_and_slide0.bin" + } + ], + "cameras": [ + { + "perspective": { + "yfov": 1.30899691581726, + "zfar": 4000, + "znear": 0.0500000007450581 + }, + "type": "perspective" + } + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "size": [ + 2, + 0.100000001490116, + 0.100000001490116 + ], + "type": "box" + }, + { + "radius": 0.25, + "type": "sphere" + } + ] + }, + "OMI_physics_joint": { + "constraints": [ + { + "linearAxes": [ + 0 + ], + "lowerLimit": -0.25, + "stiffness": 0.699999988079071, + "upperLimit": 1.75 + }, + { + "linearAxes": [ + 1, + 2 + ], + "stiffness": 0.699999988079071 + }, + { + "angularAxes": [ + 0, + 1 + ], + "stiffness": 0.5 + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body", + "OMI_physics_joint" + ], + "materials": [ + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + } + ], + "meshes": [ + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 2, + "POSITION": 0, + "TANGENT": 1, + "TEXCOORD_0": 3 + }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 7, + "POSITION": 5, + "TANGENT": 6, + "TEXCOORD_0": 8 + }, + "indices": 9, + "material": 1, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 12, + "POSITION": 10, + "TANGENT": 11, + "TEXCOORD_0": 13 + }, + "indices": 14, + "material": 2, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1, + 4, + 5, + 9 + ], + "extensions": {}, + "name": "SwingAndSlide" + }, + { + "children": [ + 2 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "TopBody", + "translation": [ + 0.00000000000208164995657567, + 1, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 3 + ], + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "TopBodyShape" + }, + { + "extensions": {}, + "mesh": 0, + "name": "TopBodyMesh" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [ + 0, + 1, + 2 + ], + "nodeA": 1, + "nodeB": 5 + } + }, + "name": "CustomJoint", + "translation": [ + -0.75, + 1, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 6, + 8 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "Ball", + "rotation": [ + 0.000000000000000094381003489835, + 0.000000000000000227855912687686, + -0.38268345594406, + 0.923879563808441 + ], + "translation": [ + -1.60000002384186, + 0.150000005960464, + 0.00000000000208164995657567 + ] + }, + { + "children": [ + 7 + ], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "BallShape" + }, + { + "extensions": {}, + "mesh": 1, + "name": "BallMesh" + }, + { + "extensions": {}, + "mesh": 2, + "name": "BallStringMesh", + "translation": [ + 0.00000000000208164995657567, + 0.699999988079071, + 0.00000000000208164995657567 + ] + }, + { + "camera": 0, + "extensions": {}, + "name": "Camera", + "translation": [ + 0.00000000000208164995657567, + 0.00000000000208164995657567, + 1.5 + ] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/swing_and_slide0.bin b/extensions/2.0/Vendor/OMI_physics_joint/examples/swing_and_slide0.bin new file mode 100644 index 0000000000..807678c764 Binary files /dev/null and b/extensions/2.0/Vendor/OMI_physics_joint/examples/swing_and_slide0.bin differ diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/weld_joint.gltf b/extensions/2.0/Vendor/OMI_physics_joint/examples/weld_joint.gltf new file mode 100644 index 0000000000..6500356b0a --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_joint/examples/weld_joint.gltf @@ -0,0 +1,599 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.25, + 0.05 + ], + "min": [ + -0.05, + -0.25, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 0.05, + 0.25, + 0.05 + ], + "min": [ + -0.05, + -0.25, + -0.05 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000022, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 8, + "byteOffset": 0, + "componentType": 5126, + "count": 1950, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 9, + "byteOffset": 0, + "componentType": 5125, + "count": 10368, + "max": [ + 1949 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 10, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 0.5, + 0.125, + 0.5 + ], + "min": [ + -0.5, + -0.125, + -0.5 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 11, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 0, + 1, + 1 + ], + "min": [ + -1, + -0.000015, + -1, + 1 + ], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 12, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 13, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [ + 1, + 1 + ], + "min": [ + 0, + 0 + ], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 14, + "byteOffset": 0, + "componentType": 5125, + "count": 36, + "max": [ + 23 + ], + "min": [ + 0 + ], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "generator": "Godot Engine v4.1.dev.custom_build@9f12e7b52d944281a39b7d3a33de6700c76cc23a", + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 0 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 23400 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 54600 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 78000 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 93600 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 135072 + }, + { + "buffer": 0, + "byteLength": 31200, + "byteOffset": 158472 + }, + { + "buffer": 0, + "byteLength": 23400, + "byteOffset": 189672 + }, + { + "buffer": 0, + "byteLength": 15600, + "byteOffset": 213072 + }, + { + "buffer": 0, + "byteLength": 41472, + "byteOffset": 228672 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 270144 + }, + { + "buffer": 0, + "byteLength": 384, + "byteOffset": 270432 + }, + { + "buffer": 0, + "byteLength": 288, + "byteOffset": 270816 + }, + { + "buffer": 0, + "byteLength": 192, + "byteOffset": 271104 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 271296 + } + ], + "buffers": [ + { + "byteLength": 271440, + "uri": "weld_joint0.bin" + } + ], + "cameras": [ + { + "perspective": { + "yfov": 1.30899691581726, + "zfar": 4000, + "znear": 0.0500000007450581 + }, + "type": "perspective" + } + ], + "extensions": { + "OMI_collider": { + "colliders": [ + { + "height": 0.5, + "radius": 0.0500000007450581, + "type": "capsule" + }, + { + "size": [ + 1, + 0.25, + 1 + ], + "type": "box" + } + ] + }, + "OMI_physics_joint": { + "constraints": [ + { + "linearAxes": [0, 1, 2], + "angularAxes": [0, 1, 2] + } + ] + } + }, + "extensionsUsed": [ + "OMI_collider", + "OMI_physics_body", + "OMI_physics_joint" + ], + "materials": [ + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "extensions": {}, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.99999988079071, + 0.99999988079071, + 0.99999988079071, + 1 + ], + "metallicFactor": 0, + "roughnessFactor": 1 + } + } + ], + "meshes": [ + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 2, + "POSITION": 0, + "TANGENT": 1, + "TEXCOORD_0": 3 + }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 7, + "POSITION": 5, + "TANGENT": 6, + "TEXCOORD_0": 8 + }, + "indices": 9, + "material": 1, + "mode": 4 + } + ] + }, + { + "extras": { + "targetNames": [] + }, + "primitives": [ + { + "attributes": { + "NORMAL": 12, + "POSITION": 10, + "TANGENT": 11, + "TEXCOORD_0": 13 + }, + "indices": 14, + "material": 2, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [1, 4, 5, 8, 11], + "extensions": {}, + "name": "SimpleJoint" + }, + { + "children": [2], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "BodyA", + "rotation": [0.000859406718518585, 0.000151536631165072, -0.17364810407162, 0.984807372093201], + "translation": [-0.45, 0.68, 0.0] + }, + { + "children": [3], + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "ColliderA", + "rotation": [0.0, 0.0, 0.70710676908493, 0.70710676908493] + }, + { + "extensions": {}, + "mesh": 0, + "name": "MeshA" + }, + { + "extensions": { + "OMI_physics_joint": { + "constraints": [0], + "nodeA": 1, + "nodeB": 5 + } + }, + "name": "WeldJoint", + "translation": [-0.23, 0.6, 0.0] + }, + { + "children": [ + 6 + ], + "extensions": { + "OMI_physics_body": { + "type": "rigid" + } + }, + "name": "BodyB", + "translation": [0.0, 0.6, 0.0] + }, + { + "children": [ + 7 + ], + "extensions": { + "OMI_collider": { + "collider": 0 + } + }, + "name": "ColliderB", + "rotation": [0.0, 0.0, 0.70710676908493, 0.70710676908493] + }, + { + "extensions": {}, + "mesh": 1, + "name": "MeshB" + }, + { + "children": [ + 9 + ], + "extensions": { + "OMI_physics_body": { + "type": "static" + } + }, + "name": "FloorBody", + "translation": [0.1, 0.0, 0.0] + }, + { + "children": [10], + "extensions": { + "OMI_collider": { + "collider": 1 + } + }, + "name": "FloorShape" + }, + { + "extensions": {}, + "mesh": 2, + "name": "FloorMesh" + }, + { + "camera": 0, + "extensions": {}, + "name": "Camera", + "translation": [0.0, 0.5, 1.5] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [0] + } + ] +} diff --git a/extensions/2.0/Vendor/OMI_physics_joint/examples/weld_joint0.bin b/extensions/2.0/Vendor/OMI_physics_joint/examples/weld_joint0.bin new file mode 100644 index 0000000000..e55afe0020 Binary files /dev/null and b/extensions/2.0/Vendor/OMI_physics_joint/examples/weld_joint0.bin differ diff --git a/extensions/2.0/Vendor/OMI_physics_joint/schema/glTF.OMI_physics_joint.schema.json b/extensions/2.0/Vendor/OMI_physics_joint/schema/glTF.OMI_physics_joint.schema.json new file mode 100644 index 0000000000..b16e0070cc --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_joint/schema/glTF.OMI_physics_joint.schema.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_physics_joint glTF Document Extension", + "type": "object", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "required": [ + "constraints" + ], + "properties": { + "constraints": { + "description": "An array of physics joint constraints that can be referenced by nodes.", + "type": "array", + "items": { + "type": "object", + "$ref": "joint_constraint.schema.json" + }, + "minItems": 1 + } + } +} diff --git a/extensions/2.0/Vendor/OMI_physics_joint/schema/joint_constraint.schema.json b/extensions/2.0/Vendor/OMI_physics_joint/schema/joint_constraint.schema.json new file mode 100644 index 0000000000..ac0f713c85 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_joint/schema/joint_constraint.schema.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_physics_joint Joint Constraint", + "type": "object", + "required": [ + "type" + ], + "properties": { + "linearAxes": { + "type": "array", + "description": "The linear axes to constrain. Can only contain 0 (X), 1 (Y), or 2 (Z).", + "default": [] + }, + "angularAxes": { + "type": "array", + "description": "The angular axes to constrain. Can only contain 0 (X), 1 (Y), or 2 (Z).", + "default": [] + }, + "lowerLimit": { + "type": "number", + "description": "The lower limit of the constraint, in meters or radians.", + "default": 0.0 + }, + "upperLimit": { + "type": "number", + "description": "The upper limit of the constraint, in meters or radians.", + "default": 0.0 + }, + "stiffness": { + "type": "number", + "description": "When beyond the limits, the stiffness of springing back.", + "default": "Infinity" + }, + "damping": { + "type": "number", + "description": "When beyond the limits, the damping of the springing back motion.", + "default": 1.0 + } + } +} diff --git a/extensions/2.0/Vendor/OMI_physics_joint/schema/node.OMI_physics_joint.schema.json b/extensions/2.0/Vendor/OMI_physics_joint/schema/node.OMI_physics_joint.schema.json new file mode 100644 index 0000000000..75fdcdfeb4 --- /dev/null +++ b/extensions/2.0/Vendor/OMI_physics_joint/schema/node.OMI_physics_joint.schema.json @@ -0,0 +1,34 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_physics_joint glTF Node Extension", + "type": "object", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "required": [ + "constraints" + ], + "properties": { + "constraints": { + "description": "An array of ids of joint constraints that are applied to the node.", + "type": "array", + "items": { + "type": "number", + "$ref": "glTFid.schema.json" + }, + "minItems": 1 + }, + "nodeA": { + "description": "The id of the first node.", + "type": "number", + "$ref": "glTFid.schema.json" + }, + "nodeB": { + "description": "The id of the second node.", + "type": "number", + "$ref": "glTFid.schema.json" + } + } +} diff --git a/extensions/README.md b/extensions/README.md index ad14ca2480..862f7d9578 100644 --- a/extensions/README.md +++ b/extensions/README.md @@ -69,6 +69,8 @@ Vendor extensions are not covered by the Khronos IP framework. * [MSFT_packing_normalRoughnessMetallic](2.0/Vendor/MSFT_packing_normalRoughnessMetallic/README.md) * [MSFT_packing_occlusionRoughnessMetallic](2.0/Vendor/MSFT_packing_occlusionRoughnessMetallic/README.md) * [MSFT_texture_dds](2.0/Vendor/MSFT_texture_dds/README.md) +* [OMI_collider](2.0/Vendor/OMI_collider/README.md) +* [OMI_physics_body](2.0/Vendor/OMI_physics_body/README.md) ### Archived Extensions for glTF 2.0