@origingame/engine 0.3.0 → 0.4.0
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/dist/web/origin-engine.d.ts +38 -2
- package/dist/web/origin-engine.js +250 -10
- package/dist/web/origin-engine_bg.wasm +0 -0
- package/dist/web/origin-engine_bg.wasm.d.ts +14 -2
- package/dist/web-publish/origin-engine-lanes.js +255 -34
- package/dist/web-publish/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish/origin-engine.d.ts +39 -3
- package/dist/web-publish/origin-engine.js +253 -32
- package/dist/web-publish/origin-engine_bg.wasm +0 -0
- package/dist/web-publish/origin-engine_bg.wasm.d.ts +15 -3
- package/dist/web-publish-2d/origin-engine-lanes.js +253 -32
- package/dist/web-publish-2d/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine.d.ts +38 -2
- package/dist/web-publish-2d/origin-engine.js +250 -29
- package/dist/web-publish-2d/origin-engine_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine_bg.wasm.d.ts +14 -2
- package/knowledge/README.md +2 -1
- package/knowledge/guides/three-to-og.md +393 -0
- package/knowledge/knowledge.json +2 -1
- package/knowledge/package.json +3 -2
- package/knowledge/scaffold/origin-engine.json +2 -2
- package/knowledge/scaffold/template/package.json +1 -1
- package/knowledge/scaffold/template/project.ogt +1 -1
- package/knowledge/scripts/validate.ts +140 -21
- package/knowledge/skills/og-audio/SKILL.md +2 -2
- package/knowledge/skills/og-build/SKILL.md +22 -3
- package/knowledge/skills/og-core/SKILL.md +20 -5
- package/knowledge/skills/og-feel/SKILL.md +2 -2
- package/knowledge/skills/og-game/SKILL.md +481 -35
- package/knowledge/skills/og-i18n/SKILL.md +7 -7
- package/knowledge/skills/og-model/SKILL.md +374 -0
- package/knowledge/skills/og-platform-sdk/SKILL.md +1 -1
- package/knowledge/skills/og-ui/SKILL.md +15 -8
- package/knowledge/wiki/ai.md +20 -20
- package/knowledge/wiki/anim.md +63 -55
- package/knowledge/wiki/atmosphere.md +13 -13
- package/knowledge/wiki/audio.md +18 -18
- package/knowledge/wiki/camera.md +13 -13
- package/knowledge/wiki/commands.md +11 -11
- package/knowledge/wiki/debug.md +13 -13
- package/knowledge/wiki/game.md +8 -8
- package/knowledge/wiki/i18n.md +7 -7
- package/knowledge/wiki/index.md +57 -3
- package/knowledge/wiki/input.md +47 -47
- package/knowledge/wiki/load.md +57 -57
- package/knowledge/wiki/nav.md +34 -34
- package/knowledge/wiki/net.md +10 -10
- package/knowledge/wiki/path.md +14 -14
- package/knowledge/wiki/physics.md +95 -95
- package/knowledge/wiki/platform.md +44 -44
- package/knowledge/wiki/probe.md +86 -86
- package/knowledge/wiki/reflect.md +16 -4
- package/knowledge/wiki/render.md +1168 -170
- package/knowledge/wiki/rng.md +14 -14
- package/knowledge/wiki/shapes.md +727 -0
- package/knowledge/wiki/stream.md +15 -15
- package/knowledge/wiki/system.md +8 -8
- package/knowledge/wiki/systems.md +2 -2
- package/knowledge/wiki/terrain.md +24 -20
- package/knowledge/wiki/tilemap.md +13 -13
- package/knowledge/wiki/time.md +4 -4
- package/knowledge/wiki/timeline.md +14 -14
- package/knowledge/wiki/transform.md +8 -8
- package/knowledge/wiki/tween.md +17 -17
- package/knowledge/wiki/ui.md +245 -269
- package/knowledge/wiki/video.md +5 -5
- package/knowledge/wiki/world.md +36 -36
- package/package.json +4 -4
- package/schema/api.schema.json +1834 -305
- package/shell/platform.ts +5 -0
- package/shell/player.ts +8 -2
- package/shell/transport.ts +6 -0
- package/src/generated/abi.ts +37 -1
- package/src/geom.ts +260 -0
- package/src/index.ts +8 -1
- package/src/node/playtest-run.ts +1 -0
- package/src/platform-local.ts +2 -0
- package/src/playtest.ts +8 -0
- package/src/runtime.ts +87 -6
- package/src/ui-kit/settings.ts +9 -0
- package/src/web/shell.ts +1 -1
- package/src/web/worker.ts +2 -2
- package/types/bindings.json +697 -402
- package/types/index.d.ts +1045 -127
package/knowledge/wiki/load.md
CHANGED
|
@@ -18,7 +18,7 @@ module load {
|
|
|
18
18
|
# declarations follow, each quoted below
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
<sub>`api.ogt` line
|
|
21
|
+
<sub>`api.ogt` line 5386</sub>
|
|
22
22
|
|
|
23
23
|
## Contents
|
|
24
24
|
|
|
@@ -52,7 +52,7 @@ module load {
|
|
|
52
52
|
| [`og.load.environment`](#fn-environment) | function | A prefiltered environment map for Environment.map, from a cooked `.ogt` of `type environment`: `source` an equirectangular Radiance `.hdr` or OpenEXR `.exr` (the centre column faces +X, as three.js maps it) or a KTX2 cube map (six square faces +X -X +Y -Y +Z -Z with rows from the top; RGBA16F, RGB9E5, BC6H and the other HDR formats, decoded at cook time), or `faces` with six `.hdr`/`.exr` images in that order; `size` level 0's face size (a power of two, 16 to 2048, default 128), `intensity`, `rotation` (degrees about +Y) and `samples`. The cook prefilters it into a cube of five GGX levels (roughness 0 to 1) in RGB9E5 and the diffuse irradiance as nine harmonics, so loading only uploads it; `prefiltered true` takes a KTX2 cube's own mip chain as those levels instead (one already GGX-prefiltered by cmgen, IBLBaker or the glTF IBL sampler: level k of L at roughness k / (L - 1)), at the file's own size, without filtering it again. On the web it is fetched with the bundle like any blob; one in a streaming group's pack loads when its group is resident, and the sky lights the scene until then. Loaded once per path. |
|
|
53
53
|
| [`og.load.emitter`](#fn-emitter) | function | A particle emitter asset for ParticleSystem.emitter, from a cooked `.ogt` of `type particles` (the og-game skill's Effects section gives every line with its default and an example; og-cook's fx module parses it): shape, rate and bursts, lifetime, speed, size and colour over life, gravity, drag, noise, a texture and sprite sheet, blending, collision, billboard or 2D sprite rendering. A sprite-mode emitter may draw from a texture array instead (`array "<id>" [<layers>] [off \| life <cycles> \| fps <n> \| random]`: each particle shows a layer by its age, at a rate, or one at random for its life; one draw per array whatever the layers; `round true` fades each particle to the soft dot's round edge). The textures and the array it names are loaded with it; while the array's streaming group is not resident its systems draw nothing. Loaded once per path. |
|
|
54
54
|
| [`og.load.shader`](#fn-shader) | function | A material shader for og.render.shaderMaterial, from a cooked `.ogt` of `type shader` (its WGSL compiled by the cook for every back end). `mode hooks` (the default) defines hooks of the lit shader; `mode full lit` or `mode full unlit` defines `fn vertex(v: VertexInput, model: mat4x4<f32>, p: Params) -> VertexOutput` and `fn fragment(f: FragmentInput, p: Params) -> SurfaceOutput` over the binding contract (camera(), the model with its skin, Params, tex0 to tex7 for the material's eight texture slots; the og-game skill's Full custom shaders section), lit by the frame's lights or drawn as returned, the prepass and every shadow pass drawn through the same entries. Loaded once per path. |
|
|
55
|
-
| [`og.load.post`](#fn-post) | function | A custom post pass for PostEffects.
|
|
55
|
+
| [`og.load.post`](#fn-post) | function | A custom post pass for PostEffects.custom, from a cooked `.ogt` of `type post`: `code` or `source` (a `.wgsl` beside it) defining `fn post(f: PostInput, p: Params) -> vec4<f32>` and `param <name> float\|vec2\|vec3\|vec4\|color <default...>` lines (at most eight). The function reads previous(uv), scene_color(uv), depth(uv), normal(uv) and f.uv, f.pixel, f.size, f.time, and returns linear HDR colour (the og-game skill's Custom post passes section has the contract). The cook compiles it for every back end. Loaded once per path. |
|
|
56
56
|
| [`og.load.texture`](#fn-texture) | function | Load a cooked texture for og.render.sprite and og.ui.image, as three.js TextureLoader.load. |
|
|
57
57
|
| [`og.load.textureArray`](#fn-textureArray) | function | Load a cooked texture array (an `.ogt` of `type texture-array`: `kind color\|normal\|linear\|pixel` and one `layer "<file>"` per layer, 1 to 256 images of one size, each path beside the file or under assets/) and upload it as one 2D-array texture, its layers in file order, each in the encoding the device takes for its kind. Each layer is also a texture of its own, `<path>#layer<n>`, for og.load.texture. Loading the same path again answers the same array. |
|
|
58
58
|
| [`og.load.style`](#fn-style) | function | Load a cooked UI style (an `.ogt` of `type style`: every palette role, the radii, type ramp, durations, and its art: the atlas and its nine-slice frames, ornaments, fonts, icons, motion and sounds; the grammar is og-ui's `parse_style`) for UiDesc.style. Its atlas, fonts, icons and sounds are loaded with it. Loaded once per path. A built-in style a look names is in the bundle as `@styles/<name>/style.ogt`. |
|
|
@@ -104,7 +104,7 @@ fn bundle {
|
|
|
104
104
|
}
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
<sub>`api.ogt` line
|
|
107
|
+
<sub>`api.ogt` line 5525</sub>
|
|
108
108
|
|
|
109
109
|
<a id="fn-bundleInfo"></a>
|
|
110
110
|
|
|
@@ -134,7 +134,7 @@ fn bundleInfo {
|
|
|
134
134
|
}
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
<sub>`api.ogt` line
|
|
137
|
+
<sub>`api.ogt` line 5532</sub>
|
|
138
138
|
|
|
139
139
|
<a id="fn-defaultBundle"></a>
|
|
140
140
|
|
|
@@ -162,7 +162,7 @@ fn defaultBundle {
|
|
|
162
162
|
}
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
<sub>`api.ogt` line
|
|
165
|
+
<sub>`api.ogt` line 5539</sub>
|
|
166
166
|
|
|
167
167
|
<a id="fn-gltf"></a>
|
|
168
168
|
|
|
@@ -170,7 +170,7 @@ fn defaultBundle {
|
|
|
170
170
|
|
|
171
171
|
Load a cooked glTF (.gltf or .glb), as three.js GLTFLoader.load: its meshes, materials and textures join the renderer once.
|
|
172
172
|
|
|
173
|
-
A MagicaVoxel `.vox` cooks to a glTF and loads here too: greedy-meshed, flat-shaded, its palette as vertex colours, z-up turned y-up, each model about its centre (MagicaVoxel's pivot, with a scene graph or without). Its import settings (`models/hut.vox.ogt`, `type import`) size and place it: `model { voxScale 0.1 voxOrigin bottom }` is 0.1 m a voxel (default 1) and the lowest voxel on y = 0 (default `center`, the editor's origin). A `.vox` with frames (MagicaVoxel's animation) cooks to clips that swap the frames' models, played by og.AnimationPlayer as any skinned clip: `voxFps 8` (default 10) and `voxClip walk 0 3` (frames 0 to 3; default one clip `frames` of every frame).
|
|
173
|
+
A MagicaVoxel `.vox` cooks to a glTF and loads here too: greedy-meshed, flat-shaded, its palette as vertex colours, z-up turned y-up, each model about its centre (MagicaVoxel's pivot, with a scene graph or without). Its import settings (`models/hut.vox.ogt`, `type import`) size and place it: `model { voxScale 0.1 voxOrigin bottom }` is 0.1 m a voxel (default 1) and the lowest voxel on y = 0 (default `center`, the editor's origin). A `.vox` with frames (MagicaVoxel's animation) cooks to clips that swap the frames' models, played by og.AnimationPlayer as any skinned clip: `voxFps 8` (default 10) and `voxClip walk 0 3` (frames 0 to 3; default one clip `frames` of the file's playback range, else of every frame); a node's `_loop` repeats its keys as the editor plays them.
|
|
174
174
|
|
|
175
175
|
```ts
|
|
176
176
|
og.load.gltf(world: World, path: string, desc?: GltfDesc): Result<Asset>
|
|
@@ -189,7 +189,7 @@ Binding symbol `og_load_gltf` · publish builds: kept
|
|
|
189
189
|
```ogt
|
|
190
190
|
fn gltf {
|
|
191
191
|
doc "Load a cooked glTF (.gltf or .glb), as three.js GLTFLoader.load: its meshes, materials and textures join the renderer once."
|
|
192
|
-
doc "A MagicaVoxel `.vox` cooks to a glTF and loads here too: greedy-meshed, flat-shaded, its palette as vertex colours, z-up turned y-up, each model about its centre (MagicaVoxel's pivot, with a scene graph or without). Its import settings (`models/hut.vox.ogt`, `type import`) size and place it: `model { voxScale 0.1 voxOrigin bottom }` is 0.1 m a voxel (default 1) and the lowest voxel on y = 0 (default `center`, the editor's origin). A `.vox` with frames (MagicaVoxel's animation) cooks to clips that swap the frames' models, played by og.AnimationPlayer as any skinned clip: `voxFps 8` (default 10) and `voxClip walk 0 3` (frames 0 to 3; default one clip `frames` of every frame)."
|
|
192
|
+
doc "A MagicaVoxel `.vox` cooks to a glTF and loads here too: greedy-meshed, flat-shaded, its palette as vertex colours, z-up turned y-up, each model about its centre (MagicaVoxel's pivot, with a scene graph or without). Its import settings (`models/hut.vox.ogt`, `type import`) size and place it: `model { voxScale 0.1 voxOrigin bottom }` is 0.1 m a voxel (default 1) and the lowest voxel on y = 0 (default `center`, the editor's origin). A `.vox` with frames (MagicaVoxel's animation) cooks to clips that swap the frames' models, played by og.AnimationPlayer as any skinned clip: `voxFps 8` (default 10) and `voxClip walk 0 3` (frames 0 to 3; default one clip `frames` of the file's playback range, else of every frame); a node's `_loop` repeats its keys as the editor plays them."
|
|
193
193
|
param world World "The world that owns the asset."
|
|
194
194
|
param path String "The asset id, such as `models/ship.glb`."
|
|
195
195
|
param desc GltfDesc "Scene and shadow options."
|
|
@@ -197,7 +197,7 @@ fn gltf {
|
|
|
197
197
|
}
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
<sub>`api.ogt` line
|
|
200
|
+
<sub>`api.ogt` line 5545</sub>
|
|
201
201
|
|
|
202
202
|
<a id="fn-scene"></a>
|
|
203
203
|
|
|
@@ -227,7 +227,7 @@ fn scene {
|
|
|
227
227
|
}
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
-
<sub>`api.ogt` line
|
|
230
|
+
<sub>`api.ogt` line 5554</sub>
|
|
231
231
|
|
|
232
232
|
<a id="fn-font"></a>
|
|
233
233
|
|
|
@@ -257,7 +257,7 @@ fn font {
|
|
|
257
257
|
}
|
|
258
258
|
```
|
|
259
259
|
|
|
260
|
-
<sub>`api.ogt` line
|
|
260
|
+
<sub>`api.ogt` line 5561</sub>
|
|
261
261
|
|
|
262
262
|
<a id="fn-fontInfo"></a>
|
|
263
263
|
|
|
@@ -287,7 +287,7 @@ fn fontInfo {
|
|
|
287
287
|
}
|
|
288
288
|
```
|
|
289
289
|
|
|
290
|
-
<sub>`api.ogt` line
|
|
290
|
+
<sub>`api.ogt` line 5568</sub>
|
|
291
291
|
|
|
292
292
|
<a id="fn-sound"></a>
|
|
293
293
|
|
|
@@ -320,7 +320,7 @@ fn sound {
|
|
|
320
320
|
}
|
|
321
321
|
```
|
|
322
322
|
|
|
323
|
-
<sub>`api.ogt` line
|
|
323
|
+
<sub>`api.ogt` line 5575</sub>
|
|
324
324
|
|
|
325
325
|
<a id="fn-lut"></a>
|
|
326
326
|
|
|
@@ -350,7 +350,7 @@ fn lut {
|
|
|
350
350
|
}
|
|
351
351
|
```
|
|
352
352
|
|
|
353
|
-
<sub>`api.ogt` line
|
|
353
|
+
<sub>`api.ogt` line 5583</sub>
|
|
354
354
|
|
|
355
355
|
<a id="fn-environment"></a>
|
|
356
356
|
|
|
@@ -380,7 +380,7 @@ fn environment {
|
|
|
380
380
|
}
|
|
381
381
|
```
|
|
382
382
|
|
|
383
|
-
<sub>`api.ogt` line
|
|
383
|
+
<sub>`api.ogt` line 5590</sub>
|
|
384
384
|
|
|
385
385
|
<a id="fn-emitter"></a>
|
|
386
386
|
|
|
@@ -410,7 +410,7 @@ fn emitter {
|
|
|
410
410
|
}
|
|
411
411
|
```
|
|
412
412
|
|
|
413
|
-
<sub>`api.ogt` line
|
|
413
|
+
<sub>`api.ogt` line 5597</sub>
|
|
414
414
|
|
|
415
415
|
<a id="fn-shader"></a>
|
|
416
416
|
|
|
@@ -440,13 +440,13 @@ fn shader {
|
|
|
440
440
|
}
|
|
441
441
|
```
|
|
442
442
|
|
|
443
|
-
<sub>`api.ogt` line
|
|
443
|
+
<sub>`api.ogt` line 5604</sub>
|
|
444
444
|
|
|
445
445
|
<a id="fn-post"></a>
|
|
446
446
|
|
|
447
447
|
### `og.load.post`
|
|
448
448
|
|
|
449
|
-
A custom post pass for PostEffects.
|
|
449
|
+
A custom post pass for PostEffects.custom, from a cooked `.ogt` of `type post`: `code` or `source` (a `.wgsl` beside it) defining `fn post(f: PostInput, p: Params) -> vec4<f32>` and `param <name> float|vec2|vec3|vec4|color <default...>` lines (at most eight). The function reads previous(uv), scene_color(uv), depth(uv), normal(uv) and f.uv, f.pixel, f.size, f.time, and returns linear HDR colour (the og-game skill's Custom post passes section has the contract). The cook compiles it for every back end. Loaded once per path.
|
|
450
450
|
|
|
451
451
|
```ts
|
|
452
452
|
og.load.post(world: World, path: string): Result<Post>
|
|
@@ -463,14 +463,14 @@ Binding symbol `og_load_post` · publish builds: kept
|
|
|
463
463
|
|
|
464
464
|
```ogt
|
|
465
465
|
fn post {
|
|
466
|
-
doc "A custom post pass for PostEffects.
|
|
466
|
+
doc "A custom post pass for PostEffects.custom, from a cooked `.ogt` of `type post`: `code` or `source` (a `.wgsl` beside it) defining `fn post(f: PostInput, p: Params) -> vec4<f32>` and `param <name> float|vec2|vec3|vec4|color <default...>` lines (at most eight). The function reads previous(uv), scene_color(uv), depth(uv), normal(uv) and f.uv, f.pixel, f.size, f.time, and returns linear HDR colour (the og-game skill's Custom post passes section has the contract). The cook compiles it for every back end. Loaded once per path."
|
|
467
467
|
param world World "The world whose renderer owns it."
|
|
468
468
|
param path String "The asset id, such as `post/crt.ogt`."
|
|
469
469
|
returns Result.Post "Refused for a path not in the bundle or not a post pass."
|
|
470
470
|
}
|
|
471
471
|
```
|
|
472
472
|
|
|
473
|
-
<sub>`api.ogt` line
|
|
473
|
+
<sub>`api.ogt` line 5611</sub>
|
|
474
474
|
|
|
475
475
|
<a id="fn-texture"></a>
|
|
476
476
|
|
|
@@ -503,7 +503,7 @@ fn texture {
|
|
|
503
503
|
}
|
|
504
504
|
```
|
|
505
505
|
|
|
506
|
-
<sub>`api.ogt` line
|
|
506
|
+
<sub>`api.ogt` line 5618</sub>
|
|
507
507
|
|
|
508
508
|
<a id="fn-textureArray"></a>
|
|
509
509
|
|
|
@@ -536,7 +536,7 @@ fn textureArray {
|
|
|
536
536
|
}
|
|
537
537
|
```
|
|
538
538
|
|
|
539
|
-
<sub>`api.ogt` line
|
|
539
|
+
<sub>`api.ogt` line 5626</sub>
|
|
540
540
|
|
|
541
541
|
<a id="fn-style"></a>
|
|
542
542
|
|
|
@@ -566,7 +566,7 @@ fn style {
|
|
|
566
566
|
}
|
|
567
567
|
```
|
|
568
568
|
|
|
569
|
-
<sub>`api.ogt` line
|
|
569
|
+
<sub>`api.ogt` line 5634</sub>
|
|
570
570
|
|
|
571
571
|
<a id="fn-look"></a>
|
|
572
572
|
|
|
@@ -596,7 +596,7 @@ fn look {
|
|
|
596
596
|
}
|
|
597
597
|
```
|
|
598
598
|
|
|
599
|
-
<sub>`api.ogt` line
|
|
599
|
+
<sub>`api.ogt` line 5641</sub>
|
|
600
600
|
|
|
601
601
|
<a id="fn-lookInfo"></a>
|
|
602
602
|
|
|
@@ -626,7 +626,7 @@ fn lookInfo {
|
|
|
626
626
|
}
|
|
627
627
|
```
|
|
628
628
|
|
|
629
|
-
<sub>`api.ogt` line
|
|
629
|
+
<sub>`api.ogt` line 5648</sub>
|
|
630
630
|
|
|
631
631
|
<a id="fn-palette"></a>
|
|
632
632
|
|
|
@@ -656,7 +656,7 @@ fn palette {
|
|
|
656
656
|
}
|
|
657
657
|
```
|
|
658
658
|
|
|
659
|
-
<sub>`api.ogt` line
|
|
659
|
+
<sub>`api.ogt` line 5655</sub>
|
|
660
660
|
|
|
661
661
|
<a id="fn-soundInfo"></a>
|
|
662
662
|
|
|
@@ -686,7 +686,7 @@ fn soundInfo {
|
|
|
686
686
|
}
|
|
687
687
|
```
|
|
688
688
|
|
|
689
|
-
<sub>`api.ogt` line
|
|
689
|
+
<sub>`api.ogt` line 5662</sub>
|
|
690
690
|
|
|
691
691
|
<a id="fn-status"></a>
|
|
692
692
|
|
|
@@ -716,7 +716,7 @@ fn status {
|
|
|
716
716
|
}
|
|
717
717
|
```
|
|
718
718
|
|
|
719
|
-
<sub>`api.ogt` line
|
|
719
|
+
<sub>`api.ogt` line 5669</sub>
|
|
720
720
|
|
|
721
721
|
<a id="fn-error"></a>
|
|
722
722
|
|
|
@@ -746,7 +746,7 @@ fn error {
|
|
|
746
746
|
}
|
|
747
747
|
```
|
|
748
748
|
|
|
749
|
-
<sub>`api.ogt` line
|
|
749
|
+
<sub>`api.ogt` line 5676</sub>
|
|
750
750
|
|
|
751
751
|
<a id="fn-gltfInfo"></a>
|
|
752
752
|
|
|
@@ -776,7 +776,7 @@ fn gltfInfo {
|
|
|
776
776
|
}
|
|
777
777
|
```
|
|
778
778
|
|
|
779
|
-
<sub>`api.ogt` line
|
|
779
|
+
<sub>`api.ogt` line 5683</sub>
|
|
780
780
|
|
|
781
781
|
<a id="fn-animation"></a>
|
|
782
782
|
|
|
@@ -809,7 +809,7 @@ fn animation {
|
|
|
809
809
|
}
|
|
810
810
|
```
|
|
811
811
|
|
|
812
|
-
<sub>`api.ogt` line
|
|
812
|
+
<sub>`api.ogt` line 5690</sub>
|
|
813
813
|
|
|
814
814
|
<a id="fn-rig"></a>
|
|
815
815
|
|
|
@@ -839,7 +839,7 @@ fn rig {
|
|
|
839
839
|
}
|
|
840
840
|
```
|
|
841
841
|
|
|
842
|
-
<sub>`api.ogt` line
|
|
842
|
+
<sub>`api.ogt` line 5698</sub>
|
|
843
843
|
|
|
844
844
|
<a id="fn-flipbook"></a>
|
|
845
845
|
|
|
@@ -869,7 +869,7 @@ fn flipbook {
|
|
|
869
869
|
}
|
|
870
870
|
```
|
|
871
871
|
|
|
872
|
-
<sub>`api.ogt` line
|
|
872
|
+
<sub>`api.ogt` line 5705</sub>
|
|
873
873
|
|
|
874
874
|
<a id="fn-tilemap"></a>
|
|
875
875
|
|
|
@@ -899,7 +899,7 @@ fn tilemap {
|
|
|
899
899
|
}
|
|
900
900
|
```
|
|
901
901
|
|
|
902
|
-
<sub>`api.ogt` line
|
|
902
|
+
<sub>`api.ogt` line 5712</sub>
|
|
903
903
|
|
|
904
904
|
<a id="fn-video"></a>
|
|
905
905
|
|
|
@@ -929,7 +929,7 @@ fn video {
|
|
|
929
929
|
}
|
|
930
930
|
```
|
|
931
931
|
|
|
932
|
-
<sub>`api.ogt` line
|
|
932
|
+
<sub>`api.ogt` line 5719</sub>
|
|
933
933
|
|
|
934
934
|
<a id="fn-videoInfo"></a>
|
|
935
935
|
|
|
@@ -959,7 +959,7 @@ fn videoInfo {
|
|
|
959
959
|
}
|
|
960
960
|
```
|
|
961
961
|
|
|
962
|
-
<sub>`api.ogt` line
|
|
962
|
+
<sub>`api.ogt` line 5726</sub>
|
|
963
963
|
|
|
964
964
|
<a id="fn-timeline"></a>
|
|
965
965
|
|
|
@@ -989,7 +989,7 @@ fn timeline {
|
|
|
989
989
|
}
|
|
990
990
|
```
|
|
991
991
|
|
|
992
|
-
<sub>`api.ogt` line
|
|
992
|
+
<sub>`api.ogt` line 5733</sub>
|
|
993
993
|
|
|
994
994
|
<a id="fn-rig2d"></a>
|
|
995
995
|
|
|
@@ -1019,7 +1019,7 @@ fn rig2d {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
```
|
|
1021
1021
|
|
|
1022
|
-
<sub>`api.ogt` line
|
|
1022
|
+
<sub>`api.ogt` line 5740</sub>
|
|
1023
1023
|
|
|
1024
1024
|
## Components, resources and events
|
|
1025
1025
|
|
|
@@ -1042,7 +1042,7 @@ Token `og.Model`, registered under the schema name `og.Model`; its value type is
|
|
|
1042
1042
|
| `castShadow` | `boolean` | `true` | — | — | — | Every mesh of the model casts shadows, as Mesh.castShadow: drawn into the sun's cascades and the shadowed lights' maps. On by default, unlike Mesh's (a loaded model casts, as it always has); false takes this instance out of every shadow pass. world.instantiate of a glTF and a scene's `model` line set it from the load's GltfDesc.castShadow, unless the scene gives the entity a `Model` table (whose castShadow is on unless it says false). |
|
|
1043
1043
|
| `receiveShadow` | `boolean` | `true` | — | — | — | Every mesh of the model receives shadows, as Mesh.receiveShadow; false lights this instance as if unshadowed by every light. On by default. Set as castShadow is, from GltfDesc.receiveShadow or the scene's `Model` table. |
|
|
1044
1044
|
| `visible` | `boolean` | `true` | — | — | — | Whether it is drawn, as Mesh.visible: false skips every draw of this instance (its meshes, its shadows) while it keeps its transform, its animation and its physics, so a ghost car or a pickup waiting to respawn is hidden without moving it away. |
|
|
1045
|
-
| `lodBias` | `number` | `1` | 0 … 16 | — | tunable | This instance's level of detail bias, multiplied with RenderSettings.lodBias: the cook simplifies every mesh into levels (a model's import settings, `model { lods 1 0.5 0.25 }` by default, the triangle fraction of each level; a glTF with MSFT_lod keeps its own levels), and the renderer draws the level
|
|
1045
|
+
| `lodBias` | `number` | `1` | 0 … 16 | — | tunable | This instance's level of detail bias, multiplied with RenderSettings.lodBias: the cook simplifies every mesh into levels (a model's import settings, `model { lods 1 0.5 0.25 }` by default, the triangle fraction of each level; a glTF with MSFT_lod keeps its own levels) and measures each level's error against the full mesh, and the renderer draws the coarsest level whose error covers less than a pixel at the model's distance, with hysteresis so it does not flicker at the boundary. Above 1 keeps detail farther (a hero), below 1 drops it sooner (a crowd); 0 always draws the full mesh. dump_entity shows the level drawn. |
|
|
1046
1046
|
| `layers` | `number` | `1` | — | — | — | Three.js layers of every mesh of the model, as Mesh.layers. |
|
|
1047
1047
|
| `static` | `boolean` | `false` | — | — | — | Part of its scene's baked lighting: og bake lightmaps gives a static model lightmap UVs (xatlas, over its world-space triangles) and traces the light arriving at its surfaces from the scene into the scene's lightmap (`<scene>.lightmap.ogt` and `.ktx2` beside the scene). Once baked, the model draws with it (its ambient light from the lightmap instead of the sky; its lights' direct light, shadows and highlights still drawn every frame) for as long as the bake matches the scene. A scene entity says `static true` beside its `model` line; an unbaked static model draws as any model, and og doctor --project names the scene. |
|
|
1048
1048
|
|
|
@@ -1071,7 +1071,7 @@ component Model {
|
|
|
1071
1071
|
field visible bool "Whether it is drawn, as Mesh.visible: false skips every draw of this instance (its meshes, its shadows) while it keeps its transform, its animation and its physics, so a ghost car or a pickup waiting to respawn is hidden without moving it away." {
|
|
1072
1072
|
default true
|
|
1073
1073
|
}
|
|
1074
|
-
field lodBias f32 "This instance's level of detail bias, multiplied with RenderSettings.lodBias: the cook simplifies every mesh into levels (a model's import settings, `model { lods 1 0.5 0.25 }` by default, the triangle fraction of each level; a glTF with MSFT_lod keeps its own levels), and the renderer draws the level
|
|
1074
|
+
field lodBias f32 "This instance's level of detail bias, multiplied with RenderSettings.lodBias: the cook simplifies every mesh into levels (a model's import settings, `model { lods 1 0.5 0.25 }` by default, the triangle fraction of each level; a glTF with MSFT_lod keeps its own levels) and measures each level's error against the full mesh, and the renderer draws the coarsest level whose error covers less than a pixel at the model's distance, with hysteresis so it does not flicker at the boundary. Above 1 keeps detail farther (a hero), below 1 drops it sooner (a crowd); 0 always draws the full mesh. dump_entity shows the level drawn." {
|
|
1075
1075
|
default 1
|
|
1076
1076
|
min 0
|
|
1077
1077
|
max 16
|
|
@@ -1084,7 +1084,7 @@ component Model {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
```
|
|
1086
1086
|
|
|
1087
|
-
<sub>`api.ogt` line
|
|
1087
|
+
<sub>`api.ogt` line 5489</sub>
|
|
1088
1088
|
|
|
1089
1089
|
<a id="record-AssetReady"></a>
|
|
1090
1090
|
|
|
@@ -1107,7 +1107,7 @@ event AssetReady {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
```
|
|
1109
1109
|
|
|
1110
|
-
<sub>`api.ogt` line
|
|
1110
|
+
<sub>`api.ogt` line 5747</sub>
|
|
1111
1111
|
|
|
1112
1112
|
<a id="record-AssetFailed"></a>
|
|
1113
1113
|
|
|
@@ -1132,7 +1132,7 @@ event AssetFailed {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
```
|
|
1134
1134
|
|
|
1135
|
-
<sub>`api.ogt` line
|
|
1135
|
+
<sub>`api.ogt` line 5753</sub>
|
|
1136
1136
|
|
|
1137
1137
|
## Types
|
|
1138
1138
|
|
|
@@ -1148,7 +1148,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
|
|
|
1148
1148
|
handle Asset "A loaded bundle, scene or glTF asset."
|
|
1149
1149
|
```
|
|
1150
1150
|
|
|
1151
|
-
<sub>`api.ogt` line
|
|
1151
|
+
<sub>`api.ogt` line 5392</sub>
|
|
1152
1152
|
|
|
1153
1153
|
<a id="type-Font"></a>
|
|
1154
1154
|
|
|
@@ -1162,7 +1162,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
|
|
|
1162
1162
|
handle Font "A cooked MSDF font: its glyph table and one or more atlas pages."
|
|
1163
1163
|
```
|
|
1164
1164
|
|
|
1165
|
-
<sub>`api.ogt` line
|
|
1165
|
+
<sub>`api.ogt` line 5393</sub>
|
|
1166
1166
|
|
|
1167
1167
|
<a id="type-Sound"></a>
|
|
1168
1168
|
|
|
@@ -1176,7 +1176,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
|
|
|
1176
1176
|
handle Sound "A cooked sound: QOA-encoded PCM the audio module plays."
|
|
1177
1177
|
```
|
|
1178
1178
|
|
|
1179
|
-
<sub>`api.ogt` line
|
|
1179
|
+
<sub>`api.ogt` line 5394</sub>
|
|
1180
1180
|
|
|
1181
1181
|
<a id="type-Style"></a>
|
|
1182
1182
|
|
|
@@ -1190,7 +1190,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
|
|
|
1190
1190
|
handle Style "A cooked UI style: its values, atlas, fonts, icons and sounds loaded with it, for og.ui.configure."
|
|
1191
1191
|
```
|
|
1192
1192
|
|
|
1193
|
-
<sub>`api.ogt` line
|
|
1193
|
+
<sub>`api.ogt` line 5395</sub>
|
|
1194
1194
|
|
|
1195
1195
|
<a id="type-TextureArray"></a>
|
|
1196
1196
|
|
|
@@ -1204,7 +1204,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
|
|
|
1204
1204
|
handle TextureArray "A cooked texture array: same-sized layers uploaded as one 2D-array texture (og.load.textureArray)."
|
|
1205
1205
|
```
|
|
1206
1206
|
|
|
1207
|
-
<sub>`api.ogt` line
|
|
1207
|
+
<sub>`api.ogt` line 5396</sub>
|
|
1208
1208
|
|
|
1209
1209
|
<a id="type-LoadStatus"></a>
|
|
1210
1210
|
|
|
@@ -1229,7 +1229,7 @@ enum LoadStatus {
|
|
|
1229
1229
|
}
|
|
1230
1230
|
```
|
|
1231
1231
|
|
|
1232
|
-
<sub>`api.ogt` line
|
|
1232
|
+
<sub>`api.ogt` line 5419</sub>
|
|
1233
1233
|
|
|
1234
1234
|
<a id="type-GltfDesc"></a>
|
|
1235
1235
|
|
|
@@ -1259,7 +1259,7 @@ struct GltfDesc {
|
|
|
1259
1259
|
}
|
|
1260
1260
|
```
|
|
1261
1261
|
|
|
1262
|
-
<sub>`api.ogt` line
|
|
1262
|
+
<sub>`api.ogt` line 5426</sub>
|
|
1263
1263
|
|
|
1264
1264
|
<a id="type-GltfInfo"></a>
|
|
1265
1265
|
|
|
@@ -1284,7 +1284,7 @@ struct GltfInfo {
|
|
|
1284
1284
|
}
|
|
1285
1285
|
```
|
|
1286
1286
|
|
|
1287
|
-
<sub>`api.ogt` line
|
|
1287
|
+
<sub>`api.ogt` line 5438</sub>
|
|
1288
1288
|
|
|
1289
1289
|
<a id="type-BundleInfo"></a>
|
|
1290
1290
|
|
|
@@ -1307,7 +1307,7 @@ struct BundleInfo {
|
|
|
1307
1307
|
}
|
|
1308
1308
|
```
|
|
1309
1309
|
|
|
1310
|
-
<sub>`api.ogt` line
|
|
1310
|
+
<sub>`api.ogt` line 5446</sub>
|
|
1311
1311
|
|
|
1312
1312
|
<a id="type-FontInfo"></a>
|
|
1313
1313
|
|
|
@@ -1340,7 +1340,7 @@ struct FontInfo {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
```
|
|
1342
1342
|
|
|
1343
|
-
<sub>`api.ogt` line
|
|
1343
|
+
<sub>`api.ogt` line 5453</sub>
|
|
1344
1344
|
|
|
1345
1345
|
<a id="type-SoundInfo"></a>
|
|
1346
1346
|
|
|
@@ -1371,7 +1371,7 @@ struct SoundInfo {
|
|
|
1371
1371
|
}
|
|
1372
1372
|
```
|
|
1373
1373
|
|
|
1374
|
-
<sub>`api.ogt` line
|
|
1374
|
+
<sub>`api.ogt` line 5465</sub>
|
|
1375
1375
|
|
|
1376
1376
|
<a id="type-TextureArrayInfo"></a>
|
|
1377
1377
|
|
|
@@ -1402,7 +1402,7 @@ struct TextureArrayInfo {
|
|
|
1402
1402
|
}
|
|
1403
1403
|
```
|
|
1404
1404
|
|
|
1405
|
-
<sub>`api.ogt` line
|
|
1405
|
+
<sub>`api.ogt` line 5478</sub>
|
|
1406
1406
|
|
|
1407
1407
|
## Column kinds
|
|
1408
1408
|
|
|
@@ -1423,7 +1423,7 @@ column TextureArray {
|
|
|
1423
1423
|
}
|
|
1424
1424
|
```
|
|
1425
1425
|
|
|
1426
|
-
<sub>`api.ogt` line
|
|
1426
|
+
<sub>`api.ogt` line 5398</sub>
|
|
1427
1427
|
|
|
1428
1428
|
```ogt
|
|
1429
1429
|
column Asset {
|
|
@@ -1434,7 +1434,7 @@ column Asset {
|
|
|
1434
1434
|
}
|
|
1435
1435
|
```
|
|
1436
1436
|
|
|
1437
|
-
<sub>`api.ogt` line
|
|
1437
|
+
<sub>`api.ogt` line 5405</sub>
|
|
1438
1438
|
|
|
1439
1439
|
```ogt
|
|
1440
1440
|
column Sound {
|
|
@@ -1445,4 +1445,4 @@ column Sound {
|
|
|
1445
1445
|
}
|
|
1446
1446
|
```
|
|
1447
1447
|
|
|
1448
|
-
<sub>`api.ogt` line
|
|
1448
|
+
<sub>`api.ogt` line 5412</sub>
|