Skip to content

Commit cb4dee0

Browse files
committed
Vehicles: Add braking, add change rate, rename current to target
1 parent ca1d836 commit cb4dee0

File tree

10 files changed

+365
-144
lines changed

10 files changed

+365
-144
lines changed

extensions/2.0/OMI_vehicle_body/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,28 @@ The actual control scheme is implementation-defined. It may be <kbd>W</kbd> and
170170

171171
Aside from `"useThrottle"` determining how input affects activation, there is also the matter of how throttle affects the vehicle's thrust. If `"maxSpeed"` is non-negative, the throttle should be a ratio of that speed, with the thrust adjusting so that the vehicle meets the target speed. Otherwise, the throttle should be a ratio of the thrust power, allowing the throttle to control the ratio of the vehicle's acceleration power.
172172

173+
### glTF Object Model
174+
175+
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`:
176+
177+
| JSON Pointer | Object Model Type |
178+
| --------------------------------------------------------- | ----------------- |
179+
| `/nodes/{}/extensions/OMI_vehicle_body/angularActivation` | `float3` |
180+
| `/nodes/{}/extensions/OMI_vehicle_body/linearActivation` | `float3` |
181+
| `/nodes/{}/extensions/OMI_vehicle_body/gyroTorque` | `float3` |
182+
| `/nodes/{}/extensions/OMI_vehicle_body/maxSpeed` | `float` |
183+
| `/nodes/{}/extensions/OMI_vehicle_body/angularDampeners` | `boolean` |
184+
| `/nodes/{}/extensions/OMI_vehicle_body/linearDampeners` | `boolean` |
185+
| `/nodes/{}/extensions/OMI_vehicle_body/useThrottle` | `boolean` |
186+
173187
### JSON Schema
174188

175189
See [schema/node.OMI_vehicle_body.schema.json](schema/node.OMI_vehicle_body.schema.json).
176190

177191
## Known Implementations
178192

179-
- Godot Engine
193+
- Basis VR: https://github.com/BasisVR/Basis/pull/442
194+
- Godot Engine: https://github.com/omigroup/omi-godot/tree/main/addons/omi_extensions/vehicle
180195

181196
## Resources:
182197

extensions/2.0/OMI_vehicle_body/schema/node.OMI_vehicle_body.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
},
3737
"maxSpeed": {
3838
"type": "number",
39-
"description": "If non-negative, the speed in meters per second at which the vehicle should stop driving acceleration further.",
39+
"description": "If non-negative, the speed in meters per second at which the vehicle should stop driving acceleration further. If throttle is used, activation is a ratio of this speed if positive, or a ratio of thrust power if negative.",
4040
"default": -1.0
4141
},
4242
"pilotSeat": {
@@ -56,7 +56,7 @@
5656
},
5757
"useThrottle": {
5858
"type": "boolean",
59-
"description": "If true, the vehicle should use a throttle for forward movement. If maxSpeed is non-negative, the throttle should be a ratio of that speed, otherwise it should be a ratio of thrust power.",
59+
"description": "If true, the vehicle should use a throttle for linear movement. If maxSpeed is non-negative, the throttle should be a ratio of that speed, otherwise it should be a ratio of thrust power.",
6060
"default": false
6161
},
6262
"extensions": { },

extensions/2.0/OMI_vehicle_hover_thruster/README.md

Lines changed: 88 additions & 39 deletions
Large diffs are not rendered by default.

extensions/2.0/OMI_vehicle_hover_thruster/examples/hovercraft.gltf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@
128128
],
129129
"materials": [
130130
{
131-
"extensions": {},
132131
"name": "HovercraftMaterial",
133132
"pbrMetallicRoughness": {
134133
"baseColorFactor": [1, 1, 1, 1],
@@ -177,31 +176,31 @@
177176
"extensions": {
178177
"OMI_vehicle_hover_thruster": { "hoverThruster": 0 }
179178
},
180-
"name": "HoverThrusterBL",
179+
"name": "HoverThrusterRearLeft",
181180
"rotation": [-0.42660024762154, -0.33944433927536, -0.17670360207558, 0.81949108839035],
182181
"translation": [1.2, -0.25, -2.1]
183182
},
184183
{
185184
"extensions": {
186185
"OMI_vehicle_hover_thruster": { "hoverThruster": 0 }
187186
},
188-
"name": "HoverThrusterBR",
187+
"name": "HoverThrusterRearRight",
189188
"rotation": [-0.42660024762154, 0.33944433927536, 0.176703602075577, 0.81949108839035],
190189
"translation": [-1.2, -0.25, -2.1]
191190
},
192191
{
193192
"extensions": {
194193
"OMI_vehicle_hover_thruster": { "hoverThruster": 0 }
195194
},
196-
"name": "HoverThrusterFL",
195+
"name": "HoverThrusterFrontLeft",
197196
"rotation": [0.176703602075577, 0.81949108839035, 0.426600247621536, -0.33944433927536],
198197
"translation": [1.2, -0.25, 2.1]
199198
},
200199
{
201200
"extensions": {
202201
"OMI_vehicle_hover_thruster": { "hoverThruster": 0 }
203202
},
204-
"name": "HoverThrusterFR",
203+
"name": "HoverThrusterFrontRight",
205204
"rotation": [-0.17670360207558, 0.81949108839035, 0.426600247621536, 0.33944433927536],
206205
"translation": [-1.2, -0.25, 2.1]
207206
},

extensions/2.0/OMI_vehicle_hover_thruster/schema/glTF.OMI_vehicle_hover_thruster.thruster.schema.json

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,52 @@
44
"title": "OMI_vehicle_hover_thruster Hover Thruster Parameters",
55
"type": "object",
66
"properties": {
7-
"currentForceRatio": {
7+
"gimbalChangeRate": {
88
"type": "number",
9-
"description": "The ratio of the maximum hover energy the hover thruster is using for propulsion.",
10-
"default": 0.0
9+
"description": "The rate at which the hover thruster can change its gimbal angles, measured in radians per second (rad/s). If negative, the hover thruster instantly changes to the desired gimbal.",
10+
"default": 1.0
1111
},
12-
"currentGimbalRatio": {
13-
"type": "array",
14-
"description": "The ratio of the maximum gimbal angles the hover thruster is rotated to.",
15-
"items": {
16-
"type": "number"
17-
},
18-
"minItems": 2,
19-
"maxItems": 2,
20-
"default": [0.0, 0.0]
12+
"hoverEnergyChangeRate": {
13+
"type": "number",
14+
"description": "The rate at which the hover thruster can change its applied hover energy, measured in Newton-meters per second (N⋅m/s) or kilograms meters squared per second cubed (kg⋅m²/s³) in SI base units. If negative or not specified, the hover thruster instantly changes to the desired hover energy.",
15+
"default": -1.0
2116
},
22-
"maxHoverEnergy": {
17+
"linearGimbalAdjustRatio": {
2318
"type": "number",
24-
"description": "The maximum hover energy force in Newton-meters (N⋅m or kg⋅m²/s²) that the hover thruster can provide. Required."
19+
"description": "The maximum ratio of how a vehicle's linear activation should adjust the hover thruster's gimbal.",
20+
"default": 0.5,
21+
"maximum": 1.0,
22+
"minimum": 0.0
2523
},
2624
"maxGimbal": {
2725
"type": "array",
2826
"description": "The maximum angle the hover thruster can gimbal or rotate in radians.",
29-
"default": 0.0
27+
"default": 0.0,
28+
"maximum": 3.1415925,
29+
"minimum": 0.0
30+
},
31+
"maxHoverEnergy": {
32+
"type": "number",
33+
"description": "The maximum hover energy force in Newton-meters (N⋅m or kg⋅m²/s²) that the hover thruster can provide. Required.",
34+
"minimum": 0.0
35+
},
36+
"targetHoverRatio": {
37+
"type": "number",
38+
"description": "The ratio of the maximum hover energy the hover thruster is targeting for propulsion. MUST NOT be negative. Values greater than 1.0 have implementation-defined behavior.",
39+
"default": 0.0,
40+
"minimum": 0.0
41+
},
42+
"targetGimbalRatio": {
43+
"type": "array",
44+
"description": "The ratio of the maximum gimbal angles the hover thruster is targeting to be rotated to. MUST NOT have a length greater than 1.0.",
45+
"items": {
46+
"type": "number",
47+
"maximum": 1.0,
48+
"minimum": -1.0
49+
},
50+
"minItems": 2,
51+
"maxItems": 2,
52+
"default": [0.0, 0.0]
3053
},
3154
"extensions": { },
3255
"extras": { }

0 commit comments

Comments
 (0)