You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**type**|`string`| The type of the physics shape as a string. | Required, no default |
69
69
70
70
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.
|**size**|`number[3]`| The size of the box shape in meters. |[1.0, 1.0, 1.0]| Box |
75
+
|**radius**|`number`| The radius of the shape in meters. | 0.5 | Sphere, capsule, cylinder |
76
+
|**height**|`number`| The height of the shape in meters. | 2.0 | Capsule, cylinder |
77
+
|**mesh**|`number`| The index of the glTF mesh in the document to use as a mesh shape. | -1 | Trimesh, convex |
78
78
79
79
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.
80
80
@@ -109,7 +109,9 @@ Capsule shapes describe a "pill" shape. They have a `radius` and `height` proper
109
109
110
110
#### Cylinder
111
111
112
-
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`.
112
+
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`.
113
+
114
+
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.
113
115
114
116
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.
115
117
@@ -131,14 +133,14 @@ Avoid using a trimesh shape for most objects, they are the slowest shapes to cal
131
133
132
134
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`.
0 commit comments