diff --git a/README.md b/README.md index b87bb9b..d1ac4c5 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ The extension has been submitted and merged as an OMI vendor extension. Alternat - [OMI_link](extensions/2.0/OMI_link) - [OMI_personality](extensions/2.0/OMI_personality) - [OMI_physics_body](extensions/2.0/OMI_physics_body/README.md) +- [OMI_physics_gravity](extensions/2.0/OMI_physics_gravity/README.md) - [OMI_physics_joint](extensions/2.0/OMI_physics_joint/README.md) - [OMI_physics_shape](extensions/2.0/OMI_physics_shape/README.md) - [OMI_spawn_point](extensions/2.0/OMI_spawn_point) @@ -234,6 +235,27 @@ The extension has been submitted and merged as an OMI vendor extension. Alternat ❌ ❌ + + + + OMI_physics_gravity + + + Stage 1 + ❌ + ❌ + ❌ + ❌ + ❌ + 🚧🧩 + 🚧🧩 + ❌ + ❌ + ❌ + ❌ + ❌ + ❌ + diff --git a/extensions/2.0/OMI_physics_gravity/README.md b/extensions/2.0/OMI_physics_gravity/README.md new file mode 100644 index 0000000..808e227 --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/README.md @@ -0,0 +1,257 @@ +# OMI_physics_gravity + +## Contributors + +- Aaron Franke, Godot Engine. + +## Status + +Open Metaverse Interoperability Group Stage 1 Proposal + +## Dependencies + +Written against the glTF 2.0 spec. + +Depends on the `OMI_physics_body` and `OMI_physics_shape` specs for per-node gravity volumes. + +## Overview + +This extension allows specifying gravity volumes on trigger glTF nodes and specifying the global world gravity at the document level. + +Global world gravity is always directional. A document-level extension may define the magnitude and direction of the global world gravity. Only one or zero instanced glTF files should have the document-level extension. The intention is to use the document-level extension only on the main "map" glTF. If multiple glTF files have the document-level gravity extension, use the most recently instanced glTF model's gravity (when instancing, override the previous gravity). + +For a per-node gravity volume, the `OMI_physics_gravity` extension MUST be defined on an `OMI_physics_body` node that is a base trigger node. Meaning, the glTF node has a trigger property, does not have motion or collider properties, and must not be a child shape of a compound trigger, as only one gravity definition is allowed per compound trigger. The shape of where the gravity influence is experienced is defined by the trigger shapes. The details of which way the gravity points can be specified in a variety of types, which are described in more detail below. + +Whether or not a rigid body is influenced by a gravity volume is determined by the priority/replace/stop settings of each gravity volume the body is inside of. The priority integer determines the order in which gravity volumes are calculated, with higher values being calculated first, and the global world gravity is always calculated last. The replace boolean controls whether or not to keep gravity already calculated so far from higher priority nodes. The stop boolean controls whether or not to continue calculating gravity from any lower priority nodes and the global world gravity. If only the default settings are used, where replace and stop are both false, the gravity is combined from all gravity volumes and the global world gravity. + +### Example: + +This example defines a scene with a millionth-scale Earth planet in space. This is the same as [earth_millionth_scale.gltf](examples/earth_millionth_scale/earth_millionth_scale.gltf) except slimmed down to only a single glTF node, the one related to gravity. It is a fully complete file that can be loaded into any app that supports this extension. + +In this example, the global world gravity is set to zero to mimic space. There is an Earth object with point gravity and a radius of 6.37814. The gravity strength is 9.80665 at the unit distance of 6.37814. The area of effect is a sphere with a radius of 40 units, which means the gravity cuts off to zero at a distance of 40 units from the center. Dynamic objects overlapping this sphere will be pulled towards the center by an amount determined by their distance and the field's gravity and unit distance, following the inverse square law. + +```json +{ + "asset": { + "version": "2.0" + }, + "extensions": { + "OMI_physics_gravity": { + "gravity": 0.0 + }, + "OMI_physics_shape": { + "shapes": [ + { + "type": "sphere", + "radius": 40.0 + } + ] + } + }, + "extensionsUsed": [ + "OMI_physics_body", + "OMI_physics_gravity", + "OMI_physics_shape" + ], + "nodes": [ + { + "name": "EarthGravity", + "extensions": { + "OMI_physics_body": { + "trigger": { + "shape": 0 + } + }, + "OMI_physics_gravity": { + "gravity": 9.80665, + "point": { + "unitDistance": 6.37814 + }, + "type": "point" + } + } + } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }] +} +``` + +More example assets can be found in the [examples/](examples/) folder. + +## glTF Schema Updates + +This extension consists of two new data structures for defining gravity. + +- For the root glTF document, the key `"OMI_physics_gravity"` in the document-level `"extensions"` defines global gravity for the whole world, including the entire glTF scene and any other instanced scenes. The global gravity is always directional. + +- For a glTF node, the key `"OMI_physics_gravity"` in the node-level `"extensions"` defines gravity for a trigger volume as defined by `OMI_physics_body`. The area of effect is determined by the trigger volume's shapes. Objects in this volume may be affected by its gravity, depending on the priority, replace, and stop settings of gravity volumes affecting this part of space. The type of gravity determines which way the gravity points within the gravity field, and how strongly. + +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 following properties apply to the document-level extension defining the world gravity: + +| | Type | Description | Default value | Valid on | +| ------------- | ----------- | ----------------------------------------------------------------------------- | -------------------- | ------------ | +| **gravity** | `number` | The gravity amount in meters per second squared. Can be zero or negative. | Required, no default | Always valid | +| **direction** | `number[3]` | The normalized direction of the gravity. World gravity is always directional. | [0.0, -1.0, 0.0] | Always valid | + +Note: Only one or zero instanced glTF files should have the document-level gravity extension. The intention is to only use the document-level extension on the main "map" glTF. If multiple glTF files have the document-level gravity extension, use the most recently instanced glTF file's gravity. + +The following properties apply to the gravity of each node, and is a superset of the world gravity properties: + +| | Type | Description | Default value | Valid on | +| ------------ | --------- | ------------------------------------------------------------------------- | -------------------- | ------------ | +| **type** | `string` | The type of the gravity as a string. | Required, no default | Always valid | +| **gravity** | `number` | The gravity amount in meters per second squared. Can be zero or negative. | Required, no default | Always valid | +| **priority** | `number` | The process priority of this gravity node. Must be an integer. | 0 | Always valid | +| **replace** | `boolean` | If true, replace the current gravity instead of adding to it. | false | Always valid | +| **stop** | `boolean` | If true, stop checking more nodes for gravity. | false | Always valid | + +In addition to the type, a key with the same name as the type can be used to define a sub-JSON with the details of the shape. Which sub-properties are allowed depend on which shape type is being used. The possible properties are described in the following table. + +| | Type | Description | Default value | Valid on | +| ---------------- | ----------- | ----------------------------------------------------------------------------------------------------- | ---------------- | --------------- | +| **direction** | `number[3]` | The normalized direction of the gravity relative to this node's transform. | [0.0, -1.0, 0.0] | Directional | +| **unitDistance** | `number` | The distance from the nearest point at which the experienced gravity equals the **gravity** property. | 0.0 | Non-directional | +| **radius** | `number` | The radius of the circle to attract gravity towards. | 1.0 | Disc, torus | +| **points** | `number[]` | The points that make up the line segments of a line type gravity field. | [] | Line | +| **shape** | `number` | The integer ID of a physics shape used to define the gravity direction. | -1 | Shaped | + +### Type + +The `"type"` property is a string that defines the type of the gravity. This property is only valid on node gravity, for world gravity the type is always directional. + +The type value may be set to `"directional"`, `"point"`, `"disc"`, `"torus"`, `"line"`, or `"shaped"`. + +On a node, the type property must be set to one of the below values, otherwise the behavior is undefined. Further details of the gravity type are defined in a sub-JSON with the same name as the type. The possible properties in this sub-JSON are defined in the above table. If the sub-JSON is not present or is missing a property, the default value should be used. + +The type property is not to be confused with the shape of the gravity volume. The trigger body's shape nodes define the area in which the gravity will affect objects. The type property defines which way the gravity points and how it scales with distance. + +The directional and point gravity types are the easiest to implement and fastest to calculate. Preference should be given to these types when they are suitable for the desired use case. + +#### Directional + +`"directional"` gravity defines uniform parallel gravity with a given direction at the given strength. The direction is defined relative to the node's transform with the `"direction"` property. + +#### Point + +`"point"` gravity defines gravity that points towards a single point, the trigger volume's origin. The `"unitDistance"` property defines the distance from the center at which the actual gravity equals the `"gravity"` property, unless `"unitDistance"` is zero, in which case the gravity is constant regardless of distance. + +The vector to the trigger body's origin determines the direction of gravity. The gravity strength is determined by that vector and the `"unitDistance"` property, unless `"unitDistance"` is zero, in which case the gravity is constant regardless of distance. + +The point type can be used to define gravity for a spherical planet, with the unit distance property being set to the radius of the planet. + +#### Disc + +`"disc"` gravity defines gravity that points toward the nearest point in a filled circle. The `"radius"` property defines the radius of the circle. The orientation of the circle is flat on the local XZ plane of the node. + +The vector to the nearest point in the filled circle determines the direction of gravity. The gravity strength is determined by that vector and the `"unitDistance"` property, unless `"unitDistance"` is zero, in which case the gravity is constant regardless of distance. + +The disc type can be conceptually thought of as two directional gravity fields on either side of the circle, connected by a smooth semicircle transition on the edge. + +#### Torus + +`"torus"` gravity defines gravity that points toward the nearest point on the edge of a hollow circle. The `"radius"` property defines the radius of the circle. The orientation of the circle is flat on the local XZ plane of the node. + +The vector to the nearest point on the edge of the hollow circle determines the direction of gravity. The gravity strength is determined by that vector and the `"unitDistance"` property, unless `"unitDistance"` is zero, in which case the gravity is constant regardless of distance. + +The torus type can be used to define gravity for a toroidal planet, with the major radius of the torus being the radius property, and the minor radius of the torus being the unit distance property (or in the case of constant gravity, the minor radius does not need to be set to any parameter). + +#### Line + +`"line"` gravity defines gravity using series of line segments defined by a series of points. The `"points"` property is an array of numbers that defines these points relative to the node's transform. The size of `"points"` must be a multiple of 3 numbers and must contain at least 6 numbers. + +The vector to the nearest point on any of the line segments determines the direction of gravity. The gravity strength is determined by that vector and the `"unitDistance"` property, unless `"unitDistance"` is zero, in which case the gravity is constant regardless of distance. + +The line type is a flexible type that defines gravity towards arbitrary lines. It can be used with only 2 points to define simple shapes like gravity for cylinder or capsule planets, or with many points to define a complex snake-like gravity field. + +#### Shaped + +`"shaped"` gravity defines gravity towards the nearest point on a physics shape. This is not to be confused with the trigger shape that defines the area of effect. The `"shape"` property references the ID of a shape as defined by `OMI_physics_shape`. + +The vector to the nearest point on the shape determines the direction of gravity. The gravity strength is determined by that vector and the `"unitDistance"` property, unless `"unitDistance"` is zero, in which case the gravity is constant regardless of distance. + +The shaped type is a flexible type that can be used to create things like cube-shaped planets or giving gravity to arbitrary surfaces with minimal effort. + +### Gravity + +The `"gravity"` property is a number that defines the gravity strength in meters per second squared. Required. Can be zero or negative. If negative, the gravity points in the opposite direction of the direction vector in the case of directional gravity, or away from the nearest point of the other gravity types. + +### Direction + +The `"direction"` property is a vector as a three-number array. It is only valid for directional gravity. + +It defines the direction of the gravity relative to this node's transform. Should be normalized. If not specified, the default value is a unit vector pointing downwards, `[0.0, -1.0, 0.0]`. + +### Unit Distance + +The `"unitDistance"` property is a number that defines how gravity scales with distance. It is only valid for non-directional gravity. + +It defines how the gravity strength should scale based on the distance to the nearest point. If zero, the gravity is constant regardless of distance. This value should not be negative. If not specified, the default value is 0.0. + +If positive, it defines the distance from the center point in meters at which the actual gravity equals the gravity amount. The gravity should have squared falloff following the [inverse square law](https://en.wikipedia.org/wiki/Inverse-square_law). For example, if the unit distance is 10 meters and the physics body is 20 meters away, then the experienced gravity magnitude is one quarter of the gravity property. Similarly, if the unit distance is 10 meters and the physics body is 5 meters away, then the experienced gravity magnitude is four times the gravity property. + +### Radius + +The `"radius"` property is a number that defines the radius of the circle to attract gravity towards. It is only valid for disc and torus gravity. + +The orientation of the circle is flat on the local XZ plane of the node. If not specified, the default value is 1.0. + +### Points + +The `"points"` property is an array of vectors, each made of 3 numbers. It is only valid for line gravity. + +The size of `"points"` must be a multiple of 3 numbers and must contain at least 6 numbers. If not specified, the default value is an empty array, which is an invalid value and will have no effect. + +### Shape + +The `"shape"` property is an integer that defines the ID of a physics shape as defined by `OMI_physics_shape`. It is only valid for shaped gravity. + +Defines the shape which is used to determine the direction of gravity. If not specified, the default value is -1, meaning the shape is invalid and will have no effect. + +### Priority + +The `"priority"` property is an integer that defines the process order of this gravity node. Must be an integer. + +Higher priority gravity nodes are processed first. The world gravity is always processed last, after all gravity nodes. If not specified, the default value is 0. + +Asset creators are highly encouraged to use priority numbers with large gaps, such as thousands or hundreds. This allows for adding new priority values in-between later. For example, a glTF file could have gravity nodes with priorities 1000 and 2000, then another gravity node can later be inserted in-between with a priority of 1500 without changing the existing gravity nodes. This can be repeated for adding a gravity node between 1000 and 1500, etc. If there are small volumes expected to be processed first, they should have very high priority values (positive thousands), while maps and other large volumes that are expected to be processed last should have very low negative priority (negative thousands). + +### Replace + +The `"replace"` property is a boolean. If not specified, the default value is false. + +If true, the gravity of this gravity volume replaces the calculated gravity instead of adding to it. This discards all previously applied gravity of higher priority nodes. + +### Stop + +The `"stop"` property is a boolean. If not specified, the default value is false. + +If true, stop checking more gravity volume nodes for gravity. This means that lower priority gravity nodes will be ignored. This also ignores the world gravity, which is always calculated last. + +### Additional Examples + +The gravity types described above can be used in a variety of ways to create a wide variety of gravity types. Here are some examples of how to use the above gravity types to define other gravity shapes. + +| Example name | Description | +| ------------ | ------------------------------------------------------------------------------------------------------ | +| Capsule | Line gravity with 2 points where the line spans the mid-height and is fully inside the trigger volume. | +| Cylinder | Line gravity with 2 points where the line touches or surpasses the ends of the trigger volume. | +| Wedge | Line gravity with 2 points where the line is defined at the corner edge of a trigger volume. | +| Cone | Line gravity with 2 points, plus directional gravity pointing towards the large end of the cone. | + +### JSON Schema + +See [schema/glTF.OMI_physics_gravity.schema.json](schema/glTF.OMI_physics_gravity.schema.json) for document-level gravity, [schema/node.OMI_physics_gravity.schema.json](schema/node.OMI_physics_gravity.schema.json) for node-level gravity, and the `schema/node.OMI_physics_gravity.*.schema.json` files for the sub-JSON schemas for gravity types. + +## Known Implementations + +- Godot Engine add-on + +## Resources: + +- Godot Area3D: https://docs.godotengine.org/en/latest/classes/class_area3d.html +- Gravity in Super Mario Galaxy: https://www.youtube.com/watch?v=QLH_0T_xv3I diff --git a/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_color_4096.jpg b/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_color_4096.jpg new file mode 100644 index 0000000..04320f3 Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_color_4096.jpg differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_millionth_scale.bin b/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_millionth_scale.bin new file mode 100644 index 0000000..c8b0d80 Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_millionth_scale.bin differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_millionth_scale.glb b/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_millionth_scale.glb new file mode 100644 index 0000000..e8f1b9c Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_millionth_scale.glb differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_millionth_scale.gltf b/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_millionth_scale.gltf new file mode 100644 index 0000000..ccb690f --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_millionth_scale.gltf @@ -0,0 +1,216 @@ +{ + "asset": { + "extensions": { "KHR_xmp_json_ld": { "packet": 0 } }, + "generator": "Godot Engine v4.3.dev.custom_build", + "version": "2.0" + }, + "extensionsUsed": [ + "GODOT_single_root", + "KHR_xmp_json_ld", + "OMI_physics_body", + "OMI_physics_gravity", + "OMI_physics_shape" + ], + "extensions": { + "KHR_xmp_json_ld": { + "packets": [ + { + "@context": { "dc": "http://purl.org/dc/elements/1.1/" }, + "@id": "", + "dc:coverage": "Earth", + "dc:creator": { "@list": ["NASA", "aaronfranke"] }, + "dc:description": "This spectacular 'blue marble' image is the most detailed true-color image of the entire Earth to date. Using a collection of satellite-based observations, scientists and visualizers stitched together months of observations of the land surface, oceans, sea ice, and clouds into a seamless, true-color mosaic. This model is at a one-millionth scale.", + "dc:format": "model/gltf+json", + "dc:rights": "NASA Image Use Policy https://visibleearth.nasa.gov/image-use-policy", + "dc:source": "https://visibleearth.nasa.gov/images/57752/blue-marble-land-surface-shallow-water-and-shaded-topography/57754l", + "dc:subject": { "@set": ["Earth"] }, + "dc:title": "Blue Marble: Land Surface, Shallow Water, and Shaded Topography", + "dc:type": { "@set": ["Planet", "Demo", "Test"] } + } + ] + }, + "OMI_physics_gravity": { + "gravity": 0.0 + }, + "OMI_physics_shape": { + "shapes": [ + { + "type": "sphere", + "sphere": { + "radius": 40.0 + } + }, + { + "type": "sphere", + "sphere": { + "radius": 6.37814 + } + } + ] + } + }, + "nodes": [ + { + "name": "EarthMillionthScale", + "children": [1, 2, 3], + "extensions": { + "OMI_physics_body": { + "motion": { + "type": "static", + "mass": 5972200.0 + } + } + } + }, + { + "name": "EarthCollider", + "extensions": { + "OMI_physics_body": { + "collider": { + "shape": 1 + } + } + } + }, + { + "name": "EarthMesh", + "mesh": 0 + }, + { + "name": "EarthGravity", + "extensions": { + "OMI_physics_body": { + "trigger": { + "shape": 0 + } + }, + "OMI_physics_gravity": { + "gravity": 9.80665, + "point": { "unitDistance": 6.37814 }, + "type": "point" + } + } + } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }], + "materials": [ + { + "doubleSided": true, + "name": "EarthMaterial", + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + }, + "metallicFactor": 0, + "metallicRoughnessTexture": { + "index": 1 + } + } + } + ], + "meshes": [ + { + "name": "EarthMeshData", + "primitives": [ + { + "attributes": { + "POSITION": 0, + "NORMAL": 1, + "TEXCOORD_0": 2 + }, + "indices": 3, + "material": 0 + } + ] + } + ], + "textures": [ + { + "sampler": 0, + "source": 0 + }, + { + "sampler": 0, + "source": 1 + } + ], + "images": [ + { + "mimeType": "image/jpeg", + "name": "earth_color_4096", + "uri": "earth_color_4096.jpg" + }, + { + "mimeType": "image/png", + "name": "earth_roughness", + "uri": "earth_roughness.png" + } + ], + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 2447, + "max": [6.378139495849609, 6.378159999847412, 6.378159999847412], + "min": [-6.378159999847412, -6.378159999847412, -6.378159999847412], + "type": "VEC3" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 2447, + "type": "VEC3" + }, + { + "bufferView": 2, + "componentType": 5126, + "count": 2447, + "type": "VEC2" + }, + { + "bufferView": 3, + "componentType": 5123, + "count": 14400, + "type": "SCALAR" + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 29364, + "byteOffset": 0, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 29364, + "byteOffset": 29364, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 19576, + "byteOffset": 58728, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 28800, + "byteOffset": 78304, + "target": 34963 + } + ], + "samplers": [ + { + "magFilter": 9729, + "minFilter": 9987 + } + ], + "buffers": [ + { + "byteLength": 107104, + "uri": "earth_millionth_scale.bin" + } + ] +} diff --git a/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_roughness.png b/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_roughness.png new file mode 100644 index 0000000..13a76dc Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_roughness.png differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/moon_petavius_crater.glb b/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/moon_petavius_crater.glb new file mode 100644 index 0000000..cdb14ad Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/moon_petavius_crater.glb differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/moon_petavius_crater.gltf b/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/moon_petavius_crater.gltf new file mode 100644 index 0000000..9fd281c --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/moon_petavius_crater.gltf @@ -0,0 +1,1369 @@ +{ + "asset": { + "extensions": { "KHR_xmp_json_ld": { "packet": 0 } }, + "generator": "Godot Engine v4.3.dev.custom_build", + "version": "2.0" + }, + "extensionsUsed": ["KHR_xmp_json_ld", "OMI_physics_body", "OMI_physics_gravity", "OMI_physics_shape"], + "extensions": { + "KHR_xmp_json_ld": { + "packets": [ + { + "@context": { "dc": "http://purl.org/dc/elements/1.1/" }, + "@id": "", + "dc:coverage": "Petavius Crater, Earth's Moon", + "dc:creator": { "@list": ["SebastianSosnowski", "aaronfranke"] }, + "dc:description": "Moon Petavius Crater with OMI_physics_gravity playground as a test file for OMI_physics_gravity. Petavius is a large lunar impact crater located to the southeast of the Mare Fecunditatis, near the southeastern lunar limb. This model is at a ten-thousandth scale.", + "dc:format": "model/gltf+json", + "dc:rights": "CC-BY 4.0 Attribution", + "dc:source": "https://sketchfab.com/3d-models/moon-petavius-crater-ce9c009b517b421eab8c8429b536382f", + "dc:subject": { "@set": ["Space", "Moon", "Gravity"] }, + "dc:title": "Moon Petavius Crater with gravity", + "dc:type": { "@set": ["Map", "Demo", "Test"] } + } + ] + }, + "OMI_physics_gravity": { "gravity": 1.62 }, + "OMI_physics_shape": { + "shapes": [ + { "box": { "size": [3, 3, 3] }, "type": "box" }, + { "trimesh": { "mesh": 0 }, "type": "trimesh" }, + { "box": { "size": [2, 6, 2] }, "type": "box" }, + { "box": { "size": [2, 2, 2] }, "type": "box" }, + { "box": { "size": [16, 10, 10] }, "type": "box" }, + { "convex": { "mesh": 7 }, "type": "convex" }, + { "box": { "size": [40, 32, 44] }, "type": "box" }, + { "trimesh": { "mesh": 9 }, "type": "trimesh" }, + { "box": { "size": [20, 16, 16] }, "type": "box" }, + { "box": { "size": [20, 8, 10] }, "type": "box" }, + { "trimesh": { "mesh": 11 }, "type": "trimesh" }, + { "box": { "size": [8, 16, 8] }, "type": "box" }, + { "convex": { "mesh": 13 }, "type": "convex" }, + { "sphere": { "radius": 6 }, "type": "sphere" }, + { "sphere": { "radius": 2.5 }, "type": "sphere" }, + { "box": { "size": [10, 16, 16] }, "type": "box" }, + { "box": { "size": [10, 9, 16] }, "type": "box" }, + { "convex": { "mesh": 16 }, "type": "convex" } + ] + } + }, + "images": [ + { "uri": "textures/moon_petavius_crater_material_albedo000.jpg" }, + { "uri": "textures/moon_petavius_crater_material_orm000.jpg" }, + { "uri": "textures/moon_petavius_crater_material_normal000.jpg" } + ], + "materials": [ + { + "name": "MoonPetaviusCraterMaterial", + "normalTexture": { "index": 2, "scale": 1 }, + "occlusionTexture": { "index": 1 }, + "pbrMetallicRoughness": { + "baseColorFactor": [0.99999988079071, 0.99999988079071, 0.99999988079071, 1], + "baseColorTexture": { "index": 0 }, + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "doubleSided": true, + "name": "ZeroGravitySetZeroPedestalMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0, 0.600000500679016, 0.800000548362732, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "ZeroGravityAddUpMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0, 0, 0.800000548362732, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "SidewaysGravityLocalDownMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0.800000548362732, 0, 0, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "SidewaysGravityLocalWestMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0.800000548362732, 0.800000548362732, 0, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "DiscGravityMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0, 0.800000548362732, 0, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "TorusGravityMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0.800000548362732, 0.199999749660492, 0, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "LineGravityMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0.800000548362732, 0, 0.480000972747803, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [0.214041143655777, 0.522521495819092, 0.99999988079071, 1], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "doubleSided": true, + "name": "PointGravityMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0.39999982714653, 0, 0.800000548362732, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "ShapedGravityCubeMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0, 0.800000548362732, 0.299999475479126, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + } + ], + "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, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 9, "POSITION": 7, "TANGENT": 8, "TEXCOORD_0": 10 }, + "indices": 11, + "material": 1, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 14, "POSITION": 12, "TANGENT": 13, "TEXCOORD_0": 15 }, + "indices": 16, + "material": 2, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 19, "POSITION": 17, "TANGENT": 18, "TEXCOORD_0": 20 }, + "indices": 21, + "material": 3, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 24, "POSITION": 22, "TANGENT": 23, "TEXCOORD_0": 25 }, + "indices": 26, + "material": 4, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 29, "POSITION": 27, "TANGENT": 28, "TEXCOORD_0": 30 }, + "indices": 31, + "material": 5, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [{ "attributes": { "POSITION": 32 }, "indices": 33, "mode": 4 }] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 36, "POSITION": 34, "TANGENT": 35, "TEXCOORD_0": 37 }, + "indices": 38, + "material": 6, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [{ "attributes": { "POSITION": 39 }, "indices": 40, "mode": 4 }] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 43, "POSITION": 41, "TANGENT": 42, "TEXCOORD_0": 44 }, + "indices": 45, + "material": 7, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [{ "attributes": { "POSITION": 46 }, "indices": 47, "mode": 4 }] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 50, "POSITION": 48, "TANGENT": 49, "TEXCOORD_0": 51 }, + "indices": 52, + "material": 8, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [{ "attributes": { "POSITION": 53 }, "indices": 54, "mode": 4 }] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 57, "POSITION": 55, "TANGENT": 56, "TEXCOORD_0": 58 }, + "indices": 59, + "material": 9, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 62, "POSITION": 60, "TANGENT": 61, "TEXCOORD_0": 63 }, + "indices": 64, + "material": 10, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [{ "attributes": { "POSITION": 65 }, "indices": 66, "mode": 4 }] + } + ], + "nodes": [ + { + "children": [1, 2], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "MoonPetaviusCrater" + }, + { "extensions": { "OMI_physics_body": { "collider": { "shape": 1 } } }, "name": "MoonPetaviusCraterShape" }, + { "mesh": 1, "name": "MoonPetaviusCraterMesh" }, + { + "children": [4, 5, 6], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [4] } }, + "OMI_physics_gravity": { + "gravity": 0, + "replace": true, + "stop": true, + "type": "directional" + } + }, + "name": "ZeroGravityReplaceZero", + "translation": [10, 0, 3] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 2 } } }, + "name": "ZeroGravityReplaceZeroShape", + "translation": [0, 2, 0] + }, + { "mesh": 2, "name": "ZeroGravityReplaceZeroPedestalMesh" }, + { + "children": [7], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "ZeroGravityReplaceZeroPedestalCollider" + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 3 } } }, + "name": "ZeroGravityReplaceZeroPedestalShape", + "translation": [0, -1, 0] + }, + { + "children": [9, 10, 11], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [9] } }, + "OMI_physics_gravity": { + "directional": { "direction": [0, 1, 0] }, + "gravity": 1.62, + "type": "directional" + } + }, + "name": "ZeroGravityAddUp", + "translation": [10, 0, -0.5] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 2 } } }, + "name": "ZeroGravityAddUpShape", + "translation": [0, 2, 0] + }, + { "mesh": 3, "name": "ZeroGravityAddUpPedestalMesh" }, + { + "children": [12], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "ZeroGravityAddUpPedestalCollider" + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 3 } } }, + "name": "ZeroGravityAddUpPedestalShape", + "translation": [0, -1, 0] + }, + { + "children": [14, 15, 16], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [14] } }, + "OMI_physics_gravity": { "gravity": 1.62, "type": "directional" } + }, + "name": "SidewaysGravityLocalDown", + "rotation": [0.0695864856243134, -0.1205275952816, -0.49513384699821, 0.857597410678864], + "translation": [-9, 0.3, -0.5] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 2 } } }, + "name": "SidewaysGravityLocalDownShape", + "rotation": [0, 0, 0.258819341659546, 0.965925753116608] + }, + { + "mesh": 4, + "name": "SidewaysGravityLocalDownPedestalMesh", + "rotation": [0, 0, 0.258819162845612, 0.965925812721252] + }, + { + "children": [17], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "SidewaysGravityLocalDownPedestalCollider", + "rotation": [0, 0, 0.258819162845612, 0.965925812721252] + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 3 } } }, + "name": "SidewaysGravityLocalDownPedestalShape", + "translation": [0, -1, 0] + }, + { + "children": [19, 20, 21], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [19] } }, + "OMI_physics_gravity": { + "directional": { "direction": [-1, 0, 0] }, + "gravity": 0.935, + "type": "directional" + } + }, + "name": "SidewaysGravityLocalWest", + "rotation": [0, 0.139172896742821, 0, 0.990268111228943], + "translation": [-8.5, 0, 4] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 2 } } }, + "name": "SidewaysGravityLocalWestShape", + "rotation": [0, 0, -0.25881916284561, 0.965925812721252] + }, + { + "mesh": 5, + "name": "SidewaysGravityLocalWestPedestalMesh", + "rotation": [0, 0, -0.25881916284561, 0.965925812721252] + }, + { + "children": [22], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "SidewaysGravityLocalWestPedestalCollider", + "rotation": [0, 0, -0.25881916284561, 0.965925812721252] + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 3 } } }, + "name": "SidewaysGravityLocalWestPedestalShape", + "translation": [0, -1, 0] + }, + { + "children": [24, 25, 26], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [24] } }, + "OMI_physics_gravity": { + "disc": { "radius": 3 }, + "gravity": 2, + "replace": true, + "stop": true, + "type": "disc" + } + }, + "name": "DiscGravity", + "translation": [-6, 0, 22] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 4 } } }, + "name": "DiscGravityShape", + "translation": [0, 0, 2] + }, + { "mesh": 6, "name": "DiscGravityMesh" }, + { + "children": [27], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "DiscGravityCollider" + }, + { "extensions": { "OMI_physics_body": { "collider": { "shape": 5 } } }, "name": "DiscGravityColliderShape" }, + { + "children": [29, 30, 31], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [29] } }, + "OMI_physics_gravity": { + "gravity": 2, + "replace": true, + "stop": true, + "torus": { "radius": 10 }, + "type": "torus" + } + }, + "name": "TorusGravity", + "translation": [-34, 0, 2] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 6 } } }, + "name": "TorusGravityShape1", + "translation": [-5, 0, 0] + }, + { "mesh": 8, "name": "TorusGravityMesh" }, + { + "children": [32], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "TorusGravityCollider" + }, + { "extensions": { "OMI_physics_body": { "collider": { "shape": 7 } } }, "name": "TorusGravityColliderShape" }, + { + "children": [34, 35, 36, 37], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [34, 35] } }, + "OMI_physics_gravity": { + "gravity": 2, + "line": { + "points": [0, 0, 3, 0, 0, -3, -5.196, 0, -6] + }, + "replace": true, + "stop": true, + "type": "line" + } + }, + "name": "LineGravityCapsule", + "translation": [-10, -1, -22] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 8 } } }, + "name": "LineGravityCapsuleShape1", + "translation": [-3, 0, -5] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 9 } } }, + "name": "LineGravityCapsuleShape2", + "translation": [-3, -4, 8] + }, + { "mesh": 10, "name": "LineGravityCapsuleMesh" }, + { + "children": [38], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "LineGravityCapsuleCollider" + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 10 } } }, + "name": "LineGravityCapsuleColliderShape" + }, + { + "children": [40, 41, 42], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [40] } }, + "OMI_physics_gravity": { + "gravity": 2.8, + "line": { + "points": [0, -10, 0, 0, 10, 0] + }, + "type": "line" + } + }, + "name": "LineGravityCone", + "translation": [20, 0, -7] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 11 } } }, + "name": "LineGravityConeShape", + "translation": [0, 6, 0] + }, + { + "mesh": 12, + "name": "LineGravityConeMesh", + "translation": [0, 2, 0] + }, + { + "children": [43], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "LineGravityConeCollider" + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 12 } } }, + "name": "LineGravityConeColliderShape", + "translation": [0, 2, 0] + }, + { + "children": [45, 46, 47], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [45] } }, + "OMI_physics_gravity": { "gravity": 2, "replace": true, "stop": true, "type": "point" } + }, + "name": "PointGravity", + "translation": [7, 5, -15] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 13 } } }, + "name": "PointGravityShape", + "translation": [0, 2.5, 0] + }, + { "mesh": 14, "name": "PointGravitySphereMesh" }, + { + "children": [48], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "PointGravityCollider" + }, + { "extensions": { "OMI_physics_body": { "collider": { "shape": 14 } } }, "name": "PointGravityColliderShape" }, + { + "children": [50, 51, 52, 53], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [50, 51] } }, + "OMI_physics_gravity": { + "gravity": 3, + "replace": true, + "shaped": { "shape": 0 }, + "stop": true, + "type": "shaped" + } + }, + "name": "ShapedGravityCube", + "translation": [20, -2, 12] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 15 } } }, + "name": "ShapedGravityCubeShape1", + "translation": [4, 0, 0] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 16 } } }, + "name": "ShapedGravityCubeShape2", + "translation": [-6, -3.5, 0] + }, + { "mesh": 15, "name": "ShapedGravityCubeMesh" }, + { + "children": [54], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "ShapedGravityCubeCollider" + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 17 } } }, + "name": "ShapedGravityCubeColliderShape" + } + ], + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 29259, + "max": [19, 1.30579996109009, 19.0009002685547], + "min": [-19, -1.38950002193451, -19.00020027160645], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5123, + "count": 29259, + "max": [29258], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 5106, + "max": [19, 1.30579996109009, 19.0008983612061], + "min": [-19, -1.38953995704651, -19.00020027160645], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 5106, + "max": [1, 0.983123898506165, 0.269449949264526, -1], + "min": [0.0377098880708218, -0.76375699043274, -0.88739860057831, -1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5126, + "count": 5106, + "max": [0.750136017799377, 0.999999046325684, 0.819615840911865], + "min": [-0.98061925172806, 0.182534545660019, -0.75767570734024], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 5106, + "max": [0.974990487098694, 0.975005745887756], + "min": [0.0249942783266306, 0.0249790195375681], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5123, + "count": 29259, + "max": [5043], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 0, 0.999979496002197], + "min": [-1, -2, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 8, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 0.0000736713409423828, 1], + "min": [-1, -0.00003045622725, -0.00003057986032, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 9, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 1], + "min": [-1, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 10, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.874998092651367, 1], + "min": [0.12498664855957, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 11, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 12, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 0, 0.999979496002197], + "min": [-1, -2, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 13, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 0.0000736713409423828, 1], + "min": [-1, -0.00003045622725, -0.00003057986032, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 14, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 1], + "min": [-1, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 15, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.874998092651367, 1], + "min": [0.12498664855957, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 16, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 17, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 0, 0.999979496002197], + "min": [-1, -2, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 18, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 0.0000736713409423828, 1], + "min": [-1, -0.00003045622725, -0.00003057986032, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 19, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 1], + "min": [-1, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 20, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.874998092651367, 1], + "min": [0.12498664855957, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 21, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 22, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 0, 0.999979496002197], + "min": [-1, -2, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 23, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 0.0000736713409423828, 1], + "min": [-1, -0.00003045622725, -0.00003057986032, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 24, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 1], + "min": [-1, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 25, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.874998092651367, 1], + "min": [0.12498664855957, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 26, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 27, + "byteOffset": 0, + "componentType": 5126, + "count": 1250, + "max": [3.49990320205688, 0.5, 3.5], + "min": [-3.5, -0.5, -3.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 28, + "byteOffset": 0, + "componentType": 5126, + "count": 1250, + "max": [1, 0.277228564023972, 1, 1], + "min": [-1, -0.09738609194756, -1.00000011920929, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 29, + "byteOffset": 0, + "componentType": 5126, + "count": 1250, + "max": [1, 0.999985158443451, 1], + "min": [-1, -0.99987101554871, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 30, + "byteOffset": 0, + "componentType": 5126, + "count": 1250, + "max": [1, 0.749996185302734], + "min": [0, 0.249988555908203], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 31, + "byteOffset": 0, + "componentType": 5123, + "count": 6516, + "max": [1104], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 32, + "byteOffset": 0, + "componentType": 5126, + "count": 6516, + "max": [3.49990010261536, 0.5, 3.5], + "min": [-3.5, -0.5, -3.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 33, + "byteOffset": 0, + "componentType": 5123, + "count": 6516, + "max": [6515], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 34, + "byteOffset": 0, + "componentType": 5126, + "count": 8593, + "max": [13.1995973587036, 3.20000004768372, 13.1999998092651], + "min": [-13.19999980926514, -3.20000004768372, -13.19999980926514], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 35, + "byteOffset": 0, + "componentType": 5126, + "count": 8593, + "max": [1, 0.658829808235168, 1, 1], + "min": [-1, -0.74816966056824, -1.00000011920929, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 36, + "byteOffset": 0, + "componentType": 5126, + "count": 8593, + "max": [1, 0.999999821186066, 1], + "min": [-1, -0.99999982118607, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 37, + "byteOffset": 0, + "componentType": 5126, + "count": 8593, + "max": [1, 1], + "min": [0, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 38, + "byteOffset": 0, + "componentType": 5123, + "count": 49152, + "max": [8384], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 39, + "byteOffset": 0, + "componentType": 5126, + "count": 49152, + "max": [13.1996002197266, 3.20000004768372, 13.1999998092651], + "min": [-13.19999980926514, -3.20000004768372, -13.19999980926514], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 40, + "byteOffset": 0, + "componentType": 5123, + "count": 49152, + "max": [49151], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 41, + "byteOffset": 0, + "componentType": 5126, + "count": 4618, + "max": [1.99985980987549, 1.99994897842407, 4.99997043609619], + "min": [-7.1950798034668, -2, -7.99892997741699], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 42, + "byteOffset": 0, + "componentType": 5126, + "count": 4618, + "max": [1, 1.00000023841858, 0.944491326808929, 1], + "min": [-1, -1.00000011920929, -0.86602449417114, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 43, + "byteOffset": 0, + "componentType": 5126, + "count": 4618, + "max": [0.999702334403992, 0.999702036380768, 1], + "min": [-0.99970126152039, -0.99970179796219, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 44, + "byteOffset": 0, + "componentType": 5126, + "count": 4618, + "max": [1, 0.999984741210938], + "min": [0, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 45, + "byteOffset": 0, + "componentType": 5123, + "count": 24576, + "max": [4415], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 46, + "byteOffset": 0, + "componentType": 5126, + "count": 24576, + "max": [1.99989998340607, 1.99989998340607, 5], + "min": [-7.19509983062744, -2, -7.99889993667603], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 47, + "byteOffset": 0, + "componentType": 5123, + "count": 24576, + "max": [24575], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 48, + "byteOffset": 0, + "componentType": 5126, + "count": 456, + "max": [3.46399998664856, 3, 3.46399998664856], + "min": [-3.46399998664856, -3, -3.46399998664856], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 49, + "byteOffset": 0, + "componentType": 5126, + "count": 456, + "max": [1, 0, 1, 1], + "min": [-1, -0.00002157951531, -1, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 50, + "byteOffset": 0, + "componentType": 5126, + "count": 456, + "max": [0.866026937961578, 0.500042736530304, 0.866026937961578], + "min": [-0.86604118347168, -1, -0.86601793766022], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 51, + "byteOffset": 0, + "componentType": 5126, + "count": 456, + "max": [1, 1], + "min": [0, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 52, + "byteOffset": 0, + "componentType": 5123, + "count": 2112, + "max": [455], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 53, + "byteOffset": 0, + "componentType": 5126, + "count": 522, + "max": [3.46399998664856, 3, 3.46399998664856], + "min": [-3.44772005081177, -3, -3.46399998664856], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 54, + "byteOffset": 0, + "componentType": 5123, + "count": 522, + "max": [521], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 55, + "byteOffset": 0, + "componentType": 5126, + "count": 755, + "max": [2.5, 2.5, 2.5], + "min": [-2.5, -2.5, -2.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 56, + "byteOffset": 0, + "componentType": 5126, + "count": 755, + "max": [0.999899983406067, 0.311829507350922, 1, 1], + "min": [-0.9998996257782, -0.31187635660172, -1, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 57, + "byteOffset": 0, + "componentType": 5126, + "count": 755, + "max": [0.999997138977051, 1, 1], + "min": [-0.99999707937241, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 58, + "byteOffset": 0, + "componentType": 5126, + "count": 755, + "max": [1, 1], + "min": [0, 0.527611196041107], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 59, + "byteOffset": 0, + "componentType": 5123, + "count": 3840, + "max": [728], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 60, + "byteOffset": 0, + "componentType": 5126, + "count": 2006, + "max": [2.5, 2.5, 2.5], + "min": [-2.5, -2.5, -2.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 61, + "byteOffset": 0, + "componentType": 5126, + "count": 2006, + "max": [1, 1.00000011920929, 0.737568855285645, 1], + "min": [-1, -0.76894599199295, -0.86604261398315, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 62, + "byteOffset": 0, + "componentType": 5126, + "count": 2006, + "max": [1, 1, 1], + "min": [-1, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 63, + "byteOffset": 0, + "componentType": 5126, + "count": 2006, + "max": [0.874998092651367, 1], + "min": [0.12498664855957, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 64, + "byteOffset": 0, + "componentType": 5123, + "count": 2916, + "max": [1943], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 65, + "byteOffset": 0, + "componentType": 5126, + "count": 2916, + "max": [2.5, 2.5, 2.5], + "min": [-2.5, -2.5, -2.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 66, + "byteOffset": 0, + "componentType": 5123, + "count": 2916, + "max": [2915], + "min": [0], + "normalized": false, + "type": "SCALAR" + } + ], + "bufferViews": [ + { "buffer": 0, "byteLength": 351108, "byteOffset": 0, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 58518, "byteOffset": 351108, "target": 34963 }, + { "buffer": 0, "byteLength": 61272, "byteOffset": 409628, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 81696, "byteOffset": 470900, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 61272, "byteOffset": 552596, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 40848, "byteOffset": 613868, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 58518, "byteOffset": 654716, "target": 34963 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 713236, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 713524, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 713908, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 714196, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 714388, "target": 34963 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 714460, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 714748, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 715132, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 715420, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 715612, "target": 34963 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 715684, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 715972, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 716356, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 716644, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 716836, "target": 34963 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 716908, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 717196, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 717580, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 717868, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 718060, "target": 34963 }, + { "buffer": 0, "byteLength": 15000, "byteOffset": 718132, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 20000, "byteOffset": 733132, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 15000, "byteOffset": 753132, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 10000, "byteOffset": 768132, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 13032, "byteOffset": 778132, "target": 34963 }, + { "buffer": 0, "byteLength": 78192, "byteOffset": 791164, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 13032, "byteOffset": 869356, "target": 34963 }, + { "buffer": 0, "byteLength": 103116, "byteOffset": 882388, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 137488, "byteOffset": 985504, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 103116, "byteOffset": 1122992, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 68744, "byteOffset": 1226108, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 98304, "byteOffset": 1294852, "target": 34963 }, + { "buffer": 0, "byteLength": 589824, "byteOffset": 1393156, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 98304, "byteOffset": 1982980, "target": 34963 }, + { "buffer": 0, "byteLength": 55416, "byteOffset": 2081284, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 73888, "byteOffset": 2136700, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 55416, "byteOffset": 2210588, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 36944, "byteOffset": 2266004, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 49152, "byteOffset": 2302948, "target": 34963 }, + { "buffer": 0, "byteLength": 294912, "byteOffset": 2352100, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 49152, "byteOffset": 2647012, "target": 34963 }, + { "buffer": 0, "byteLength": 5472, "byteOffset": 2696164, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 7296, "byteOffset": 2701636, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 5472, "byteOffset": 2708932, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 3648, "byteOffset": 2714404, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 4224, "byteOffset": 2718052, "target": 34963 }, + { "buffer": 0, "byteLength": 6264, "byteOffset": 2722276, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 1044, "byteOffset": 2728540, "target": 34963 }, + { "buffer": 0, "byteLength": 9060, "byteOffset": 2729584, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 12080, "byteOffset": 2738644, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 9060, "byteOffset": 2750724, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 6040, "byteOffset": 2759784, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 7680, "byteOffset": 2765824, "target": 34963 }, + { "buffer": 0, "byteLength": 24072, "byteOffset": 2773504, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 32096, "byteOffset": 2797576, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 24072, "byteOffset": 2829672, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 16048, "byteOffset": 2853744, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 5832, "byteOffset": 2869792, "target": 34963 }, + { "buffer": 0, "byteLength": 34992, "byteOffset": 2875624, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 5832, "byteOffset": 2910616, "target": 34963 } + ], + "buffers": [{ "byteLength": 2916448, "uri": "moon_petavius_crater0.bin" }], + "samplers": [{ "magFilter": 9729, "minFilter": 9987, "wrapS": 10497, "wrapT": 10497 }], + "scene": 0, + "scenes": [{ "name": "MoonPetaviusCraterScene", "nodes": [0, 3, 8, 13, 18, 23, 28, 33, 39, 44, 49] }], + "textures": [ + { "sampler": 0, "source": 0 }, + { "sampler": 0, "source": 1 }, + { "sampler": 0, "source": 2 } + ] +} diff --git a/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/moon_petavius_crater0.bin b/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/moon_petavius_crater0.bin new file mode 100644 index 0000000..e4610ea Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/moon_petavius_crater0.bin differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/textures/moon_petavius_crater_material_albedo000.jpg b/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/textures/moon_petavius_crater_material_albedo000.jpg new file mode 100644 index 0000000..dc39b65 Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/textures/moon_petavius_crater_material_albedo000.jpg differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/textures/moon_petavius_crater_material_normal000.jpg b/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/textures/moon_petavius_crater_material_normal000.jpg new file mode 100644 index 0000000..160df5e Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/textures/moon_petavius_crater_material_normal000.jpg differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/textures/moon_petavius_crater_material_orm000.jpg b/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/textures/moon_petavius_crater_material_orm000.jpg new file mode 100644 index 0000000..7d08d7b Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/moon_petavius_crater/textures/moon_petavius_crater_material_orm000.jpg differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/ramp/ramp_gravity.glb b/extensions/2.0/OMI_physics_gravity/examples/ramp/ramp_gravity.glb new file mode 100644 index 0000000..d2f80e4 Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/ramp/ramp_gravity.glb differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/ramp/ramp_gravity.gltf b/extensions/2.0/OMI_physics_gravity/examples/ramp/ramp_gravity.gltf new file mode 100644 index 0000000..3f0bb6a --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/examples/ramp/ramp_gravity.gltf @@ -0,0 +1,158 @@ +{ + "asset": { + "generator": "Godot Engine v4.3.dev.custom_build", + "version": "2.0" + }, + "extensionsUsed": ["GODOT_single_root", "OMI_physics_body", "OMI_physics_gravity", "OMI_physics_shape"], + "extensions": { + "OMI_physics_shape": { + "shapes": [ + { "box": { "size": [6, 4, 3] }, "type": "box" }, + { "box": { "size": [2, 7, 5] }, "type": "box" }, + { "trimesh": { "mesh": 1 }, "type": "trimesh" } + ] + } + }, + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorFactor": [1, 1, 1, 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": { "POSITION": 5 }, "indices": 6, "mode": 4 }] + } + ], + "nodes": [ + { + "children": [1, 2, 3], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [1] } }, + "OMI_physics_gravity": { + "gravity": -9.8, + "shaped": { "shape": 0 }, + "stop": true, + "type": "shaped" + } + }, + "name": "RampGravity" + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 1 } } }, + "name": "RampGravityShape", + "translation": [0, -1.5, -2] + }, + { + "mesh": 0, + "name": "RampGravityMesh", + "translation": [0, -5, 0.5] + }, + { + "children": [4], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "RampGravityCollider", + "translation": [0, -5, 0.5] + }, + { "extensions": { "OMI_physics_body": { "collider": { "shape": 2 } } }, "name": "RampGravityColliderShape" } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }], + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 136, + "max": [0.999979496002197, 7, -0.00006628036499], + "min": [-1, 0, -5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 136, + "max": [1, 0.0000152590218931437, 0.999698579311371, 1], + "min": [-0.00013981414668, -0.99970042705536, -0.00001525865719, -1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 136, + "max": [0.0000841021610540338, 1, 1], + "min": [-0.00014381069923, 0, 0.0000239175878959941], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 136, + "max": [0.749996185302734, 0.499992370605469], + "min": [0.499992370605469, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5123, + "count": 204, + "max": [135], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 204, + "max": [1, 7, -0.00009999999747], + "min": [-1, 0, -5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5123, + "count": 204, + "max": [203], + "min": [0], + "normalized": false, + "type": "SCALAR" + } + ], + "bufferViews": [ + { "buffer": 0, "byteLength": 1632, "byteOffset": 0, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 2176, "byteOffset": 1632, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 1632, "byteOffset": 3808, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 1088, "byteOffset": 5440, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 408, "byteOffset": 6528, "target": 34963 }, + { "buffer": 0, "byteLength": 2448, "byteOffset": 6936, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 408, "byteOffset": 9384, "target": 34963 } + ], + "buffers": [{ "byteLength": 9792, "uri": "ramp_gravity0.bin" }] +} diff --git a/extensions/2.0/OMI_physics_gravity/examples/ramp/ramp_gravity0.bin b/extensions/2.0/OMI_physics_gravity/examples/ramp/ramp_gravity0.bin new file mode 100644 index 0000000..6dd93a9 Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/ramp/ramp_gravity0.bin differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/rounded_cube/rounded_cube.bin b/extensions/2.0/OMI_physics_gravity/examples/rounded_cube/rounded_cube.bin new file mode 100644 index 0000000..f01cc76 Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/rounded_cube/rounded_cube.bin differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/rounded_cube/rounded_cube.glb b/extensions/2.0/OMI_physics_gravity/examples/rounded_cube/rounded_cube.glb new file mode 100644 index 0000000..5dc2acb Binary files /dev/null and b/extensions/2.0/OMI_physics_gravity/examples/rounded_cube/rounded_cube.glb differ diff --git a/extensions/2.0/OMI_physics_gravity/examples/rounded_cube/rounded_cube.gltf b/extensions/2.0/OMI_physics_gravity/examples/rounded_cube/rounded_cube.gltf new file mode 100644 index 0000000..7234946 --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/examples/rounded_cube/rounded_cube.gltf @@ -0,0 +1,142 @@ +{ + "asset": { + "version": "2.0" + }, + "extensionsUsed": [ + "OMI_physics_body", + "OMI_physics_gravity", + "OMI_physics_shape" + ], + "extensions": { + "OMI_physics_shape": { + "shapes": [ + { + "type": "box", + "box": { + "size": [6, 6, 6] + } + }, + { + "type": "box", + "box": { + "size": [1, 1, 1] + } + }, + { + "type": "convex", + "convex": { + "mesh": 0 + } + } + ] + } + }, + "nodes": [ + { + "name": "RoundedCube", + "children": [1, 2, 3], + "extensions": { + "OMI_physics_body": { + "motion": { + "type": "static" + } + } + } + }, + { + "name": "RoundedCubeGravity", + "extensions": { + "OMI_physics_body": { + "trigger": { + "shape": 0 + } + }, + "OMI_physics_gravity": { + "type": "shaped", + "gravity": 9.80665, + "stop": true, + "shaped": { + "shape": 1 + } + } + } + }, + { + "name": "RoundedCubeMesh", + "mesh": 0 + }, + { + "name": "RoundedCubeShape", + "extensions": { + "OMI_physics_body": { + "collider": { + "shape": 2 + } + } + } + } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }], + "accessors": [ + { + "type": "VEC3", + "componentType": 5126, + "count": 1844, + "max": [0.75, 0.75, 0.75], + "min": [-0.75, -0.75, -0.75], + "bufferView": 0, + "byteOffset": 0 + }, + { + "type": "VEC3", + "componentType": 5126, + "count": 1844, + "bufferView": 0, + "byteOffset": 12 + }, + { + "type": "SCALAR", + "componentType": 5123, + "count": 10344, + "bufferView": 1, + "byteOffset": 0 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteOffset": 0, + "byteLength": 44256, + "byteStride": 24, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 44256, + "byteLength": 20688, + "target": 34963 + } + ], + "buffers": [ + { + "uri": "rounded_cube.bin", + "byteLength": 64944 + } + ], + "meshes": [ + { + "name": "RoundedCubeMeshData", + "primitives": [ + { + "attributes": { + "POSITION": 0, + "NORMAL": 1 + }, + "mode": 4, + "indices": 2 + } + ] + } + ] +} diff --git a/extensions/2.0/OMI_physics_gravity/schema/glTF.OMI_physics_gravity.schema.json b/extensions/2.0/OMI_physics_gravity/schema/glTF.OMI_physics_gravity.schema.json new file mode 100644 index 0000000..9bf532b --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/schema/glTF.OMI_physics_gravity.schema.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_physics_gravity glTF Document Extension", + "type": "object", + "required": [ + "gravity" + ], + "properties": { + "gravity": { + "type": "number", + "description": "The gravity amount in meters per second squared. Can be zero or negative. Required." + }, + "direction": { + "type": "array", + "description": "The direction of the global gravity. Should be normalized.", + "default": [0.0, -1.0, 0.0], + "minItems": 3, + "maxItems": 3 + } + } +} diff --git a/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.directional.schema.json b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.directional.schema.json new file mode 100644 index 0000000..2faa057 --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.directional.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_physics_gravity Directional Gravity", + "type": "object", + "properties": { + "direction": { + "type": "array", + "description": "The normalized direction of gravity relative to this node's transform.", + "default": [0.0, -1.0, 0.0], + "minItems": 3, + "maxItems": 3 + }, + "extensions": { }, + "extras": { } + } +} diff --git a/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.disc.schema.json b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.disc.schema.json new file mode 100644 index 0000000..ff44aff --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.disc.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_physics_gravity Disc Gravity", + "type": "object", + "properties": { + "radius": { + "type": "number", + "description": "The radius to use for the circle used in the disc gravity type.", + "default": 1.0 + }, + "unitDistance": { + "type": "number", + "description": "The distance from the nearest point at which the gravity equals the gravity property. If zero or not specified, the gravity strength is constant.", + "default": 0.0 + }, + "extensions": { }, + "extras": { } + } +} diff --git a/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.line.schema.json b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.line.schema.json new file mode 100644 index 0000000..9026749 --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.line.schema.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_physics_gravity Line Gravity", + "type": "object", + "required": [ + "points" + ], + "properties": { + "points": { + "type": "array", + "description": "The points that make up the line segments of a line type gravity field. Each set of 3 numbers is a vector. Must have a size be at least 6 and be a multiple of 3.", + "default": [], + "minItems": 6 + }, + "unitDistance": { + "type": "number", + "description": "The distance from the nearest point at which the gravity equals the gravity property. If zero or not specified, the gravity strength is constant.", + "default": 0.0 + }, + "extensions": { }, + "extras": { } + } +} diff --git a/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.point.schema.json b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.point.schema.json new file mode 100644 index 0000000..5941116 --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.point.schema.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_physics_gravity Point Gravity", + "type": "object", + "properties": { + "unitDistance": { + "type": "number", + "description": "The distance from the origin point at which the gravity equals the gravity property. If zero or not specified, the gravity strength is constant.", + "default": 0.0 + }, + "extensions": { }, + "extras": { } + } +} diff --git a/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.schema.json b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.schema.json new file mode 100644 index 0000000..b655c81 --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.schema.json @@ -0,0 +1,136 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_physics_gravity glTF Node Extension", + "type": "object", + "required": [ + "type", + "gravity" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of gravity of this node as a string. Required.", + "enum": [ + "directional", + "disc", + "line", + "point", + "shaped", + "torus" + ] + }, + "gravity": { + "type": "number", + "description": "The gravity amount in meters per second squared. Can be zero or negative. Required." + }, + "priority": { + "type": "number", + "description": "The process priority of this gravity node. Must be an integer. Higher priority gravity nodes are processed first. The world gravity is processed last.", + "default": 0 + }, + "replace": { + "type": "boolean", + "description": "If true, the gravity amount replaces the current gravity amount instead of adding to it.", + "default": false + }, + "stop": { + "type": "boolean", + "description": "If true, stop checking more nodes for gravity. This means that lower priority gravity nodes will be ignored. If priority is non-negative, this also means the world gravity is ignored.", + "default": false + }, + "extensions": { }, + "extras": { } + }, + "oneOf": [ + { + "required": [ + "type", + "directional" + ], + "properties": { + "type": { + "const": "directional" + }, + "directional": { + "type": "object", + "$ref": "node.OMI_physics_gravity.directional.schema.json" + } + } + }, + { + "required": [ + "type", + "disc" + ], + "properties": { + "type": { + "const": "disc" + }, + "disc": { + "type": "object", + "$ref": "node.OMI_physics_gravity.disc.schema.json" + } + } + }, + { + "required": [ + "type", + "line" + ], + "properties": { + "type": { + "const": "line" + }, + "line": { + "type": "object", + "$ref": "node.OMI_physics_gravity.line.schema.json" + } + } + }, + { + "required": [ + "type", + "point" + ], + "properties": { + "type": { + "const": "point" + }, + "point": { + "type": "object", + "$ref": "node.OMI_physics_gravity.point.schema.json" + } + } + }, + { + "required": [ + "type", + "shaped" + ], + "properties": { + "type": { + "const": "shaped" + }, + "shaped": { + "type": "object", + "$ref": "node.OMI_physics_gravity.shaped.schema.json" + } + } + }, + { + "required": [ + "type", + "torus" + ], + "properties": { + "type": { + "const": "torus" + }, + "torus": { + "type": "object", + "$ref": "node.OMI_physics_gravity.torus.schema.json" + } + } + } + ] +} diff --git a/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.shaped.schema.json b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.shaped.schema.json new file mode 100644 index 0000000..3a528a9 --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.shaped.schema.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_physics_gravity Shaped Gravity", + "type": "object", + "required": [ + "shape" + ], + "properties": { + "shape": { + "$ref": "glTFid.schema.json", + "description": "The ID of the shape defined by OMI_physics_shape which gravity points towards." + }, + "unitDistance": { + "type": "number", + "description": "The distance from the nearest point at which the gravity equals the gravity property. If zero or not specified, the gravity strength is constant.", + "default": 0.0 + }, + "extensions": { }, + "extras": { } + } +} diff --git a/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.torus.schema.json b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.torus.schema.json new file mode 100644 index 0000000..5156c9a --- /dev/null +++ b/extensions/2.0/OMI_physics_gravity/schema/node.OMI_physics_gravity.torus.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "OMI_physics_gravity Torus Gravity", + "type": "object", + "properties": { + "radius": { + "type": "number", + "description": "The radius to use for the circle used in the torus gravity type.", + "default": 1.0 + }, + "unitDistance": { + "type": "number", + "description": "The distance from the nearest point at which the gravity equals the gravity property. If zero or not specified, the gravity strength is constant.", + "default": 0.0 + }, + "extensions": { }, + "extras": { } + } +}