@vgai/engine 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -11
- package/package.json +10 -6
- package/schemas/engine-api.json +1 -68
- package/schemas/engine-api.md +1 -32
- package/schemas/engine-capabilities.json +30 -42
- package/schemas/{vgai-game.schema.json → vgai-project.schema.json} +52 -34
- package/src/adapter/adapter-surface.ts +5 -5
- package/src/adapter/authoring.ts +168 -226
- package/src/adapter/colyseus-networking-adapter.ts +44 -5
- package/src/adapter/first-party-systems.ts +156 -42
- package/src/adapter/host-context.ts +177 -46
- package/src/adapter/index.ts +47 -51
- package/src/adapter/ingest/game-contract.ts +2 -2
- package/src/adapter/ingest/scene-capture.ts +18 -19
- package/src/adapter/ingest/structural-ids.ts +127 -0
- package/src/adapter/ingest/upstream-pin.ts +9 -12
- package/src/adapter/loop-gate-report.ts +11 -11
- package/src/adapter/rapier-physics-adapter.ts +27 -9
- package/src/adapter/root-adapter.ts +217 -0
- package/src/adapter/{vgai-scene-game-adapter.ts → setup-three-root-adapter.ts} +173 -351
- package/src/adapter/system-adapter.ts +80 -63
- package/src/ai/navigation.ts +1 -1
- package/src/animation/animation-clock.ts +1 -1
- package/src/animation/camera-ownership.ts +1 -2
- package/src/animation/cubic-spline-interpolant.ts +132 -0
- package/src/animation/theatre-clock-binding.ts +2 -2
- package/src/animation/theatre-object-binding.ts +4 -4
- package/src/animation/xstate-animation-binding.ts +75 -5
- package/src/{scene/schema → asset-formats}/camera.ts +2 -5
- package/src/{scene/schema → asset-formats}/collider.ts +2 -5
- package/src/asset-formats/index.ts +54 -0
- package/src/{scene/schema → asset-formats}/instances.ts +10 -6
- package/src/{scene/schema → asset-formats}/light.ts +3 -6
- package/src/{scene/schema → asset-formats}/material.ts +4 -7
- package/src/{scene/schema → asset-formats}/mesh.ts +4 -7
- package/src/asset-formats/parse.ts +39 -0
- package/src/{scene/schema → asset-formats}/particles.ts +3 -6
- package/src/{scene/schema/environment.ts → asset-formats/render-env.ts} +23 -86
- package/src/{scene/schema → asset-formats}/tuples.ts +1 -1
- package/src/{scene/asset-loaders.ts → asset-loaders.ts} +8 -9
- package/src/asset-parse-error.ts +33 -0
- package/src/{scene/asset-registry.ts → asset-registry.ts} +1 -1
- package/src/assets.ts +1 -1
- package/src/audio/wav-encode.ts +9 -9
- package/src/canvas-react/engine-bridge.ts +59 -0
- package/src/canvas-react/index.ts +50 -0
- package/src/canvas-react/pixi-primitive.tsx +202 -0
- package/src/canvas-react/pixi-react-adapter.tsx +290 -0
- package/src/canvas-react/pixi-react-root-factory.tsx +88 -0
- package/src/canvas-react/world-context.ts +328 -0
- package/src/core/frame-pacing.ts +100 -0
- package/src/core/game-loop.ts +50 -28
- package/src/core/seeded-random.ts +7 -7
- package/src/core/sim-clock.ts +388 -0
- package/src/core/system-runner.ts +17 -63
- package/src/core/types.ts +34 -15
- package/src/data/data-asset.ts +3 -3
- package/src/data/data-check-core.ts +6 -7
- package/src/data/data-ref.ts +11 -11
- package/src/data/vite-plugin-data.ts +10 -10
- package/src/{scene/defaults.ts → defaults.ts} +18 -40
- package/src/dev/render-debug-adapter.ts +1 -1
- package/src/dev/webgl-frame-capture.ts +1 -1
- package/src/ecs/scene-index.ts +439 -0
- package/src/ecs/scene-query.ts +43 -0
- package/src/{scene → ecs}/user-data.ts +17 -36
- package/src/index.ts +7 -9
- package/src/input/input-manager.ts +29 -32
- package/src/input/input-types.ts +2 -2
- package/src/input/schema.ts +5 -5
- package/src/loader.ts +57 -0
- package/src/manifest/editor-port.ts +69 -0
- package/src/manifest/filename.ts +49 -0
- package/src/manifest/index.ts +8 -2
- package/src/manifest/load-file.ts +11 -0
- package/src/manifest/load.ts +65 -77
- package/src/manifest/locate.ts +55 -0
- package/src/manifest/schema.ts +400 -233
- package/src/{scene → physics}/collider-dimensions.ts +3 -3
- package/src/physics/physics-registry.ts +1 -1
- package/src/{world2d/authoring-2d.ts → pixi/authoring.ts} +24 -11
- package/src/pixi/index.ts +43 -0
- package/src/{world2d/ingest-iframe-2d.ts → pixi/ingest-iframe.ts} +9 -9
- package/src/{world2d/ingest2d.ts → pixi/ingest.ts} +28 -28
- package/src/{world2d/physics2d-registry.ts → pixi/physics-registry.ts} +1 -1
- package/src/{world2d/scene-capture-2d.ts → pixi/scene-capture.ts} +3 -3
- package/src/{world2d/system-adapters-2d.ts → pixi/system-adapters.ts} +2 -2
- package/src/react/unmanaged-root-detector.ts +26 -1
- package/src/react/use-data.ts +5 -5
- package/src/react/use-selection.tsx +15 -42
- package/src/react/{game-state.tsx → world-state.tsx} +44 -46
- package/src/render/auto-batcher.ts +1 -2
- package/src/{scene → render}/instance-mesh.ts +1 -1
- package/src/{scene → render}/light-camera-factory.ts +14 -13
- package/src/render/lod.ts +17 -0
- package/src/{scene → render}/material-factory.ts +8 -7
- package/src/{scene → render}/particles-factory.ts +62 -12
- package/src/render/render-batch-system.ts +14 -41
- package/src/render/render-features.ts +1 -1
- package/src/render/render-settings.ts +1 -2
- package/src/render/spark-renderer-lifecycle.ts +1 -1
- package/src/runtime/create-runtime.ts +352 -463
- package/src/runtime/debug-bridge.ts +148 -93
- package/src/runtime/debug-registry.ts +79 -54
- package/src/runtime/dev-layers.ts +40 -0
- package/src/runtime/frame-selector-cache.ts +4 -4
- package/src/runtime/game.ts +618 -369
- package/src/runtime/gameplay-rng-trap.ts +6 -7
- package/src/runtime/input-router.ts +11 -11
- package/src/runtime/mount-game.ts +54 -55
- package/src/runtime/mount-manifest.ts +154 -150
- package/src/runtime/presentation.ts +141 -0
- package/src/runtime/render-audio-control.ts +64 -53
- package/src/runtime/render-control.ts +45 -51
- package/src/runtime/render-seed.ts +3 -4
- package/src/runtime/state-bridge.ts +17 -18
- package/src/runtime/types.ts +94 -61
- package/src/setup/setup-renderer.ts +11 -6
- package/src/world3d-react/engine-bridge.ts +46 -33
- package/src/world3d-react/index.ts +31 -26
- package/src/world3d-react/r3f-adapter.tsx +211 -96
- package/src/world3d-react/r3f-root-factory.tsx +91 -0
- package/src/world3d-react/renderer-config.ts +137 -0
- package/src/world3d-react/world-context.ts +141 -111
- package/schemas/entity2d.schema.json +0 -468
- package/schemas/prefab.schema.json +0 -9992
- package/schemas/scn2d.schema.json +0 -494
- package/schemas/vscn.schema.json +0 -10851
- package/src/adapter/game-adapter.ts +0 -164
- package/src/adapter/ingest/overlay-applier.ts +0 -207
- package/src/adapter/ingest/overlay-apply.ts +0 -168
- package/src/adapter/ingest/overlay-file.ts +0 -126
- package/src/adapter/ingest/overlay-report.ts +0 -176
- package/src/animation/gsap-registration.ts +0 -184
- package/src/audio/audio-introspection.ts +0 -290
- package/src/audio/index.ts +0 -39
- package/src/audio/tone-clock-binding.ts +0 -98
- package/src/audio/tone-context.ts +0 -175
- package/src/audio/tone-offline-render.ts +0 -167
- package/src/ecs/component-manager.ts +0 -814
- package/src/ecs/game-component.ts +0 -260
- package/src/ecs/hmr-swap-report.ts +0 -65
- package/src/physics/trigger-dispatch.ts +0 -97
- package/src/react/root-adapter.tsx +0 -49
- package/src/scene/asset-paths.ts +0 -121
- package/src/scene/asset-ref-check.ts +0 -248
- package/src/scene/component-registry.ts +0 -51
- package/src/scene/parse.ts +0 -204
- package/src/scene/scene-apply.ts +0 -407
- package/src/scene/scene-diff-schema.ts +0 -115
- package/src/scene/scene-diff-types.ts +0 -29
- package/src/scene/scene-loader.ts +0 -1526
- package/src/scene/scene-query.ts +0 -63
- package/src/scene/scene-types.ts +0 -33
- package/src/scene/scene-version.ts +0 -40
- package/src/scene/schema/animation.ts +0 -46
- package/src/scene/schema/audio.ts +0 -25
- package/src/scene/schema/entity-ref.ts +0 -78
- package/src/scene/schema/entity.ts +0 -189
- package/src/scene/schema/index.ts +0 -51
- package/src/scene/schema/joint.ts +0 -26
- package/src/scene/schema/physics.ts +0 -49
- package/src/scene/schema/scene-file.ts +0 -292
- package/src/scene/schema/shadow.ts +0 -24
- package/src/scene/schema/spline.ts +0 -21
- package/src/world2d/asset-paths2d.ts +0 -44
- package/src/world2d/capture-to-scene2d.ts +0 -52
- package/src/world2d/collision-2d.ts +0 -99
- package/src/world2d/entity2d-asset.ts +0 -22
- package/src/world2d/index.ts +0 -91
- package/src/world2d/physics2d-transform.ts +0 -173
- package/src/world2d/physics2d-units.ts +0 -10
- package/src/world2d/pixi-game-adapter.ts +0 -439
- package/src/world2d/pixi-surface.ts +0 -78
- package/src/world2d/scene2d-identity.ts +0 -49
- package/src/world2d/scene2d-loader.ts +0 -433
- package/src/world2d/schema/entity2d.ts +0 -163
- package/src/world2d/schema/physics2d.ts +0 -64
- package/src/world2d/schema/sprite.ts +0 -99
- package/src/world2d/schema/tilemap.ts +0 -39
- package/src/world2d/schema/tuples2d.ts +0 -25
- package/src/world2d/transform-writer-2d.ts +0 -42
- package/src/world2d/types.ts +0 -74
- package/src/world3d-react/behavior.tsx +0 -146
- /package/src/{scene → render}/mesh-shadow.ts +0 -0
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$comment": "AUTO-GENERATED by scripts/generate-schema.ts — do not edit manually",
|
|
3
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"properties": {
|
|
6
|
-
"version": {
|
|
7
|
-
"type": "number",
|
|
8
|
-
"const": 1,
|
|
9
|
-
"description": "2D entity asset format version"
|
|
10
|
-
},
|
|
11
|
-
"name": {
|
|
12
|
-
"type": "string",
|
|
13
|
-
"description": "Reusable 2D entity asset display name"
|
|
14
|
-
},
|
|
15
|
-
"root": {
|
|
16
|
-
"description": "Native Entity2D subtree copied into a Scene2D document",
|
|
17
|
-
"$ref": "#/$defs/__schema0"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"required": [
|
|
21
|
-
"version",
|
|
22
|
-
"name",
|
|
23
|
-
"root"
|
|
24
|
-
],
|
|
25
|
-
"additionalProperties": false,
|
|
26
|
-
"description": "A reusable native 2D entity asset (.entity2d.json)",
|
|
27
|
-
"$defs": {
|
|
28
|
-
"__schema0": {
|
|
29
|
-
"type": "object",
|
|
30
|
-
"properties": {
|
|
31
|
-
"id": {
|
|
32
|
-
"description": "Unique entity ID. Auto-generated if omitted",
|
|
33
|
-
"type": "string"
|
|
34
|
-
},
|
|
35
|
-
"name": {
|
|
36
|
-
"type": "string",
|
|
37
|
-
"description": "Human-readable entity name (shown in hierarchy panel)"
|
|
38
|
-
},
|
|
39
|
-
"surface": {
|
|
40
|
-
"description": "Render surface that instantiates this entity. Default 'world2d' in a Scene2D file. The 'world3d' value is REJECTED at parse (T4.1): declared but has no runtime reader — authoring surface: 'world3d' throws. Do not author it ('world2d', the default, is fine).",
|
|
41
|
-
"type": "string",
|
|
42
|
-
"enum": [
|
|
43
|
-
"world2d",
|
|
44
|
-
"world3d"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"visible": {
|
|
48
|
-
"description": "Whether the entity and its children are rendered",
|
|
49
|
-
"type": "boolean"
|
|
50
|
-
},
|
|
51
|
-
"locked": {
|
|
52
|
-
"description": "Prevent selection and editing in the native 2D scene editor",
|
|
53
|
-
"type": "boolean"
|
|
54
|
-
},
|
|
55
|
-
"tags": {
|
|
56
|
-
"description": "Arbitrary string tags for runtime queries. REJECTED at parse (T4.1): declared but has no runtime reader — authoring this field throws. Do not author.",
|
|
57
|
-
"type": "array",
|
|
58
|
-
"items": {
|
|
59
|
-
"type": "string"
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
"transform2d": {
|
|
63
|
-
"description": "Local 2D transform relative to parent",
|
|
64
|
-
"type": "object",
|
|
65
|
-
"properties": {
|
|
66
|
-
"position": {
|
|
67
|
-
"description": "Local position [x, y] in world2d pixels",
|
|
68
|
-
"type": "array",
|
|
69
|
-
"prefixItems": [
|
|
70
|
-
{
|
|
71
|
-
"type": "number"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"type": "number"
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
"rotation": {
|
|
79
|
-
"description": "Rotation in radians about the Z axis. Default 0",
|
|
80
|
-
"type": "number"
|
|
81
|
-
},
|
|
82
|
-
"scale": {
|
|
83
|
-
"description": "Scale per axis [x, y]. Default [1, 1]",
|
|
84
|
-
"type": "array",
|
|
85
|
-
"prefixItems": [
|
|
86
|
-
{
|
|
87
|
-
"type": "number"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"type": "number"
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
"pivot": {
|
|
95
|
-
"description": "Local pivot point [x, y] (center of rotation/scale)",
|
|
96
|
-
"type": "array",
|
|
97
|
-
"prefixItems": [
|
|
98
|
-
{
|
|
99
|
-
"type": "number"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"type": "number"
|
|
103
|
-
}
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"additionalProperties": false
|
|
108
|
-
},
|
|
109
|
-
"pivot": {
|
|
110
|
-
"description": "Local-space pivot point [x, y]",
|
|
111
|
-
"type": "array",
|
|
112
|
-
"prefixItems": [
|
|
113
|
-
{
|
|
114
|
-
"type": "number"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"type": "number"
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
},
|
|
121
|
-
"sprite": {
|
|
122
|
-
"description": "2D sprite appearance",
|
|
123
|
-
"type": "object",
|
|
124
|
-
"properties": {
|
|
125
|
-
"texture": {
|
|
126
|
-
"description": "Texture asset URL (loaded via PIXI.Assets). Omit for a tintable 1x1 white texture",
|
|
127
|
-
"type": "string"
|
|
128
|
-
},
|
|
129
|
-
"frame": {
|
|
130
|
-
"description": "Spritesheet frame/sub-texture name when `texture` is a spritesheet atlas",
|
|
131
|
-
"type": "string",
|
|
132
|
-
"minLength": 1
|
|
133
|
-
},
|
|
134
|
-
"animation": {
|
|
135
|
-
"description": "Named spritesheet animation from `texture` (PIXI.Spritesheet.animations); mutually exclusive with `frame`",
|
|
136
|
-
"type": "string",
|
|
137
|
-
"minLength": 1
|
|
138
|
-
},
|
|
139
|
-
"anchor": {
|
|
140
|
-
"description": "Normalized anchor [x, y] (0..1). Default [0.5, 0.5]",
|
|
141
|
-
"type": "array",
|
|
142
|
-
"prefixItems": [
|
|
143
|
-
{
|
|
144
|
-
"type": "number"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"type": "number"
|
|
148
|
-
}
|
|
149
|
-
]
|
|
150
|
-
},
|
|
151
|
-
"tint": {
|
|
152
|
-
"description": "Tint color as hex string (e.g. '#ff8800'). Default white",
|
|
153
|
-
"type": "string"
|
|
154
|
-
},
|
|
155
|
-
"alpha": {
|
|
156
|
-
"description": "Opacity 0..1. Default 1",
|
|
157
|
-
"type": "number",
|
|
158
|
-
"minimum": 0,
|
|
159
|
-
"maximum": 1
|
|
160
|
-
},
|
|
161
|
-
"width": {
|
|
162
|
-
"description": "Explicit display width in pixels (overrides texture size)",
|
|
163
|
-
"type": "number"
|
|
164
|
-
},
|
|
165
|
-
"height": {
|
|
166
|
-
"description": "Explicit display height in pixels (overrides texture size)",
|
|
167
|
-
"type": "number"
|
|
168
|
-
},
|
|
169
|
-
"blendMode": {
|
|
170
|
-
"description": "PixiJS blend mode. Default normal",
|
|
171
|
-
"type": "string",
|
|
172
|
-
"enum": [
|
|
173
|
-
"normal",
|
|
174
|
-
"add",
|
|
175
|
-
"multiply",
|
|
176
|
-
"screen"
|
|
177
|
-
]
|
|
178
|
-
},
|
|
179
|
-
"interactive": {
|
|
180
|
-
"description": "Enable federated pointer events (eventMode=static) so this sprite can be picked",
|
|
181
|
-
"type": "boolean"
|
|
182
|
-
},
|
|
183
|
-
"filter": {
|
|
184
|
-
"description": "Apply a PixiJS filter (BlurFilter / ColorMatrix desaturate). Default none",
|
|
185
|
-
"type": "string",
|
|
186
|
-
"enum": [
|
|
187
|
-
"none",
|
|
188
|
-
"blur",
|
|
189
|
-
"desaturate"
|
|
190
|
-
]
|
|
191
|
-
},
|
|
192
|
-
"fps": {
|
|
193
|
-
"description": "AnimatedSprite playback speed in frames/sec. Default 8",
|
|
194
|
-
"type": "number",
|
|
195
|
-
"exclusiveMinimum": 0
|
|
196
|
-
},
|
|
197
|
-
"loop": {
|
|
198
|
-
"description": "Whether the named spritesheet animation loops. Default true",
|
|
199
|
-
"type": "boolean"
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
"additionalProperties": false
|
|
203
|
-
},
|
|
204
|
-
"text": {
|
|
205
|
-
"description": "World-space text label",
|
|
206
|
-
"type": "object",
|
|
207
|
-
"properties": {
|
|
208
|
-
"text": {
|
|
209
|
-
"type": "string",
|
|
210
|
-
"description": "The string to display"
|
|
211
|
-
},
|
|
212
|
-
"fontSize": {
|
|
213
|
-
"description": "Font size in pixels. Default 24",
|
|
214
|
-
"type": "number"
|
|
215
|
-
},
|
|
216
|
-
"fill": {
|
|
217
|
-
"description": "Text color as hex string. Default '#ffffff'",
|
|
218
|
-
"type": "string"
|
|
219
|
-
},
|
|
220
|
-
"anchor": {
|
|
221
|
-
"description": "Normalized anchor [x, y] (0..1). Default [0.5, 0.5]",
|
|
222
|
-
"type": "array",
|
|
223
|
-
"prefixItems": [
|
|
224
|
-
{
|
|
225
|
-
"type": "number"
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"type": "number"
|
|
229
|
-
}
|
|
230
|
-
]
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
"required": [
|
|
234
|
-
"text"
|
|
235
|
-
],
|
|
236
|
-
"additionalProperties": false
|
|
237
|
-
},
|
|
238
|
-
"tilemap": {
|
|
239
|
-
"description": "2D tilemap (CompositeTilemap)",
|
|
240
|
-
"type": "object",
|
|
241
|
-
"properties": {
|
|
242
|
-
"frames": {
|
|
243
|
-
"minItems": 1,
|
|
244
|
-
"type": "array",
|
|
245
|
-
"items": {
|
|
246
|
-
"type": "string",
|
|
247
|
-
"minLength": 1
|
|
248
|
-
},
|
|
249
|
-
"description": "Ordered Pixi spritesheet frame names used as tile indices"
|
|
250
|
-
},
|
|
251
|
-
"texture": {
|
|
252
|
-
"type": "string",
|
|
253
|
-
"minLength": 1,
|
|
254
|
-
"description": "URL or project path to a Pixi spritesheet JSON asset"
|
|
255
|
-
},
|
|
256
|
-
"tileSize": {
|
|
257
|
-
"type": "number",
|
|
258
|
-
"exclusiveMinimum": 0,
|
|
259
|
-
"description": "Positive square tile width/height in pixels"
|
|
260
|
-
},
|
|
261
|
-
"tiles": {
|
|
262
|
-
"type": "array",
|
|
263
|
-
"items": {
|
|
264
|
-
"type": "array",
|
|
265
|
-
"items": {
|
|
266
|
-
"type": "integer",
|
|
267
|
-
"minimum": -9007199254740991,
|
|
268
|
-
"maximum": 9007199254740991
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
"description": "Row-major grid of frame indices; -1 is an empty cell (each row is an array of tile indices)"
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
"required": [
|
|
275
|
-
"frames",
|
|
276
|
-
"texture",
|
|
277
|
-
"tileSize",
|
|
278
|
-
"tiles"
|
|
279
|
-
],
|
|
280
|
-
"additionalProperties": false
|
|
281
|
-
},
|
|
282
|
-
"physics2d": {
|
|
283
|
-
"description": "2D physics rigid body + collider",
|
|
284
|
-
"type": "object",
|
|
285
|
-
"properties": {
|
|
286
|
-
"bodyType": {
|
|
287
|
-
"type": "string",
|
|
288
|
-
"enum": [
|
|
289
|
-
"dynamic",
|
|
290
|
-
"fixed",
|
|
291
|
-
"kinematicVelocity",
|
|
292
|
-
"kinematicPosition"
|
|
293
|
-
],
|
|
294
|
-
"description": "Rapier 2D rigid-body type. A body of any type nested below a dynamic or kinematic body is rejected: Rapier has no parent/child body relationship. Nesting below a fixed or physics-less transformed parent is supported for fixed bodies. Dynamic and kinematic bodies additionally require a conformal parent chain (uniform scale plus rotation/reflection), because later body rotation cannot round-trip through non-uniform parent scale without shearing the Pixi visual."
|
|
295
|
-
},
|
|
296
|
-
"collider": {
|
|
297
|
-
"oneOf": [
|
|
298
|
-
{
|
|
299
|
-
"type": "object",
|
|
300
|
-
"properties": {
|
|
301
|
-
"shape": {
|
|
302
|
-
"type": "string",
|
|
303
|
-
"const": "cuboid",
|
|
304
|
-
"description": "Box collider aligned to the rigid-body rotation"
|
|
305
|
-
},
|
|
306
|
-
"halfExtents": {
|
|
307
|
-
"type": "array",
|
|
308
|
-
"prefixItems": [
|
|
309
|
-
{
|
|
310
|
-
"type": "number"
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
"type": "number"
|
|
314
|
-
}
|
|
315
|
-
],
|
|
316
|
-
"description": "Half-width and half-height [hx, hy] in pixels"
|
|
317
|
-
}
|
|
318
|
-
},
|
|
319
|
-
"required": [
|
|
320
|
-
"shape",
|
|
321
|
-
"halfExtents"
|
|
322
|
-
],
|
|
323
|
-
"additionalProperties": false
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
"type": "object",
|
|
327
|
-
"properties": {
|
|
328
|
-
"shape": {
|
|
329
|
-
"type": "string",
|
|
330
|
-
"const": "ball",
|
|
331
|
-
"description": "Circle collider"
|
|
332
|
-
},
|
|
333
|
-
"radius": {
|
|
334
|
-
"type": "number",
|
|
335
|
-
"description": "Radius in pixels"
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
"required": [
|
|
339
|
-
"shape",
|
|
340
|
-
"radius"
|
|
341
|
-
],
|
|
342
|
-
"additionalProperties": false
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
"type": "object",
|
|
346
|
-
"properties": {
|
|
347
|
-
"shape": {
|
|
348
|
-
"type": "string",
|
|
349
|
-
"const": "capsule",
|
|
350
|
-
"description": "Capsule collider (vertical)"
|
|
351
|
-
},
|
|
352
|
-
"halfHeight": {
|
|
353
|
-
"type": "number",
|
|
354
|
-
"description": "Half the straight segment length"
|
|
355
|
-
},
|
|
356
|
-
"radius": {
|
|
357
|
-
"type": "number",
|
|
358
|
-
"description": "Cap radius"
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
"required": [
|
|
362
|
-
"shape",
|
|
363
|
-
"halfHeight",
|
|
364
|
-
"radius"
|
|
365
|
-
],
|
|
366
|
-
"additionalProperties": false
|
|
367
|
-
}
|
|
368
|
-
],
|
|
369
|
-
"description": "Collider shape attached to the body. Its pose and dimensions use the composed parent transform at spawn. Cuboids support non-uniform scale; ball/capsule colliders reject non-uniform scale because Rapier cannot represent an ellipse."
|
|
370
|
-
},
|
|
371
|
-
"sensor": {
|
|
372
|
-
"description": "If true, a sensor (trigger) collider — overlaps fire onTriggerEnter/Exit, no solid response",
|
|
373
|
-
"type": "boolean"
|
|
374
|
-
},
|
|
375
|
-
"density": {
|
|
376
|
-
"description": "Collider density (drives mass). Default 1",
|
|
377
|
-
"type": "number"
|
|
378
|
-
},
|
|
379
|
-
"friction": {
|
|
380
|
-
"description": "Coefficient of friction. Default 0.5",
|
|
381
|
-
"type": "number"
|
|
382
|
-
},
|
|
383
|
-
"restitution": {
|
|
384
|
-
"description": "Bounciness 0..1. Default 0",
|
|
385
|
-
"type": "number"
|
|
386
|
-
},
|
|
387
|
-
"linearDamping": {
|
|
388
|
-
"description": "Linear velocity damping. Default 0",
|
|
389
|
-
"type": "number"
|
|
390
|
-
},
|
|
391
|
-
"gravityScale": {
|
|
392
|
-
"description": "Per-body gravity multiplier. Default 1",
|
|
393
|
-
"type": "number"
|
|
394
|
-
},
|
|
395
|
-
"lockRotations": {
|
|
396
|
-
"description": "Lock the body so it cannot rotate. Default false",
|
|
397
|
-
"type": "boolean"
|
|
398
|
-
}
|
|
399
|
-
},
|
|
400
|
-
"required": [
|
|
401
|
-
"bodyType",
|
|
402
|
-
"collider"
|
|
403
|
-
],
|
|
404
|
-
"additionalProperties": false
|
|
405
|
-
},
|
|
406
|
-
"components": {
|
|
407
|
-
"description": "User-defined components (validated against the world2d component registry)",
|
|
408
|
-
"type": "object",
|
|
409
|
-
"propertyNames": {
|
|
410
|
-
"type": "string"
|
|
411
|
-
},
|
|
412
|
-
"additionalProperties": {
|
|
413
|
-
"type": "object",
|
|
414
|
-
"propertyNames": {
|
|
415
|
-
"type": "string"
|
|
416
|
-
},
|
|
417
|
-
"additionalProperties": {
|
|
418
|
-
"anyOf": [
|
|
419
|
-
{
|
|
420
|
-
"anyOf": [
|
|
421
|
-
{
|
|
422
|
-
"type": "number"
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
"type": "string"
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
"type": "boolean"
|
|
429
|
-
}
|
|
430
|
-
]
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
"type": "array",
|
|
434
|
-
"items": {
|
|
435
|
-
"type": "number"
|
|
436
|
-
}
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
"type": "array",
|
|
440
|
-
"items": {
|
|
441
|
-
"type": "string"
|
|
442
|
-
}
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
"type": "array",
|
|
446
|
-
"items": {
|
|
447
|
-
"type": "boolean"
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
]
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
},
|
|
454
|
-
"children": {
|
|
455
|
-
"description": "Child entities",
|
|
456
|
-
"type": "array",
|
|
457
|
-
"items": {
|
|
458
|
-
"$ref": "#/$defs/__schema0"
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
|
-
"required": [
|
|
463
|
-
"name"
|
|
464
|
-
],
|
|
465
|
-
"additionalProperties": false
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|