diff --git a/extensions/2.0/KHR_audio_emitter/examples/boom_box/textures/boom_box_emission.png b/extensions/2.0/KHR_audio_emitter/examples/boom_box/textures/boom_box_emission.png index 23371ae..474fd6e 100644 Binary files a/extensions/2.0/KHR_audio_emitter/examples/boom_box/textures/boom_box_emission.png and b/extensions/2.0/KHR_audio_emitter/examples/boom_box/textures/boom_box_emission.png differ 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 index 13a76dc..ad5aff2 100644 Binary files a/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_roughness.png and b/extensions/2.0/OMI_physics_gravity/examples/earth_millionth_scale/earth_roughness.png differ diff --git a/extensions/2.0/OMI_physics_shape/README.md b/extensions/2.0/OMI_physics_shape/README.md index 20e721b..c56a7e3 100644 --- a/extensions/2.0/OMI_physics_shape/README.md +++ b/extensions/2.0/OMI_physics_shape/README.md @@ -63,18 +63,18 @@ The extension must also be added to the glTF's `extensionsUsed` array and becaus The main data structure `glTF.OMI_physics_shape.shape.schema.json` defines a type property. -| | Type | Description | Default value | -| --------------| ----------- | -------------------------------------------------------------------------- | -------------------- | -| **type** | `string` | The type of the physics shape as a string. | Required, no default | +| | Type | Description | Default value | +| -------- | -------- | ------------------------------------------ | -------------------- | +| **type** | `string` | The type of the physics shape as a string. | Required, no default | 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 | -| --------------| ----------- | -------------------------------------------------------------------------- | -------------------- | ------------------------- | -| **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 mesh shape. | -1 | Trimesh, convex | +| | Type | Description | Default value | Valid on | +| ---------------- | ----------- | ------------------------------------------------------------------ | --------------- | ------------------------- | +| **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 mesh shape. | -1 | Trimesh, convex | If a key for the type is missing, or a sub-JSON key is missing, implementations should use the default value. A mesh index of -1 means invalid. @@ -109,7 +109,9 @@ Capsule shapes describe a "pill" shape. They have a `radius` and `height` proper #### 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 it's desired 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.0`. +Cylinder shapes describe a "tall circle" shape. They are similar in structure to capsules, they have a `radius` and `height` property. If the `radius` property is omitted, the default radius is `0.5`, and if the `height` property is omitted, the default height is `2.0`. + +The `height` property of a cylinder describes the total height, the distance between the center of the bottom disc and the center of the top disc. The height is aligned with the node's local vertical axis. If it's desired to align it along a different axis, rotate the glTF node. 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. @@ -131,14 +133,14 @@ Avoid using a trimesh shape for most objects, they are the slowest shapes to cal The following JSON pointers are defined representing mutable properties defined by this extension, for use with the glTF Object Model including extensions such as `KHR_animation_pointer` and `KHR_interactivity`. -| JSON Pointer | Object Model Type | -| --------------------------------------------------------- | ----------------- | -| `/extensions/OMI_physics_shape/shapes/{}/box/size` | `float3` | -| `/extensions/OMI_physics_shape/shapes/{}/sphere/radius` | `float` | -| `/extensions/OMI_physics_shape/shapes/{}/capsule/radius` | `float` | -| `/extensions/OMI_physics_shape/shapes/{}/capsule/height` | `float` | -| `/extensions/OMI_physics_shape/shapes/{}/cylinder/radius` | `float` | -| `/extensions/OMI_physics_shape/shapes/{}/cylinder/height` | `float` | +| JSON Pointer | Object Model Type | +| --------------------------------------------------------------- | ----------------- | +| `/extensions/OMI_physics_shape/shapes/{}/box/size` | `float3` | +| `/extensions/OMI_physics_shape/shapes/{}/sphere/radius` | `float` | +| `/extensions/OMI_physics_shape/shapes/{}/capsule/height` | `float` | +| `/extensions/OMI_physics_shape/shapes/{}/capsule/radius` | `float` | +| `/extensions/OMI_physics_shape/shapes/{}/cylinder/height` | `float` | +| `/extensions/OMI_physics_shape/shapes/{}/cylinder/radius` | `float` | Additionally, the following JSON pointers are defined for read-only properties: diff --git a/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.schema.json b/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.schema.json index 4f58102..28ee67f 100644 --- a/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.schema.json +++ b/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.schema.json @@ -8,10 +8,10 @@ "properties": { "shapes": { "type": "array", - "description": "An array of shapes that can be referenced by nodes.", + "description": "An array of physics shape resources that can be referenced by nodes.", "items": { "type": "object", - "$ref": "shape.schema.json" + "$ref": "glTF.OMI_physics_shape.shape.schema.json" }, "minItems": 1 }, diff --git a/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.box.schema.json b/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.box.schema.json index 37961c4..b98caf6 100644 --- a/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.box.schema.json +++ b/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.box.schema.json @@ -8,7 +8,14 @@ "properties": { "size": { "type": "array", - "description": "Three number array representing the width, height, and depth of the box (x, y, z)." + "description": "Three number array representing the width, height, and depth of the box (x, y, z).", + "items": { + "type": "number", + "exclusiveMinimum": 0.0 + }, + "minItems": 3, + "maxItems": 3, + "default": [ 1.0, 1.0, 1.0 ] }, "extensions": { }, "extras": { } diff --git a/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.capsule.schema.json b/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.capsule.schema.json index 27e9d96..1cc12c6 100644 --- a/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.capsule.schema.json +++ b/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.capsule.schema.json @@ -6,13 +6,17 @@ "description": "Parameters describing a capsule physics shape.", "allOf": [ { "$ref": "glTFProperty.schema.json" } ], "properties": { - "radius": { + "height": { "type": "number", - "description": "The radius to use for the capsule shape." + "description": "The full height of the capsule shape in meters.", + "exclusiveMinimum": 0.0, + "default": 2.0 }, - "height": { + "radius": { "type": "number", - "description": "The full height of the capsule shape." + "description": "The radius of the capsule in meters.", + "minimum": 0.0, + "default": 0.5 }, "extensions": { }, "extras": { } diff --git a/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.cylinder.schema.json b/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.cylinder.schema.json index bfa0d87..1cc31dd 100644 --- a/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.cylinder.schema.json +++ b/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.cylinder.schema.json @@ -6,13 +6,17 @@ "description": "Parameters describing a cylinder physics shape.", "allOf": [ { "$ref": "glTFProperty.schema.json" } ], "properties": { - "radius": { + "height": { "type": "number", - "description": "The radius to use for the cylinder shape." + "description": "The height of the cylinder shape in meters, the distance between the centers of the two capping discs.", + "exclusiveMinimum": 0.0, + "default": 2.0 }, - "height": { + "radius": { "type": "number", - "description": "The height of the cylinder shape." + "description": "The radius of the cylinder in meters.", + "minimum": 0.0, + "default": 0.5 }, "extensions": { }, "extras": { } diff --git a/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.schema.json b/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.schema.json index 4e7d41f..317ac17 100644 --- a/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.schema.json +++ b/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.schema.json @@ -3,12 +3,12 @@ "$id": "glTF.OMI_physics_shape.shape.schema.json", "title": "OMI_physics_shape Shape Resource", "type": "object", - "description": "Defines a physics shape resource.", + "description": "Defines a physics shape resource that can be referenced by nodes.", "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ], "properties": { "type": { "type": "string", - "description": "The type of shape this node represents.", + "description": "Specifies the shape type of this physics shape.", "enum": [ "box", "sphere", diff --git a/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.sphere.schema.json b/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.sphere.schema.json index d06edc7..c33aad1 100644 --- a/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.sphere.schema.json +++ b/extensions/2.0/OMI_physics_shape/schema/glTF.OMI_physics_shape.shape.sphere.schema.json @@ -8,7 +8,9 @@ "properties": { "radius": { "type": "number", - "description": "The radius to use for the sphere shape." + "description": "The radius to use for the sphere shape in meters.", + "minimum": 0.0, + "default": 0.5 }, "extensions": { }, "extras": { }