@origingame/engine 0.3.0 → 0.5.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 +44 -5
- package/dist/web/origin-engine.js +279 -19
- package/dist/web/origin-engine_bg.wasm +0 -0
- package/dist/web/origin-engine_bg.wasm.d.ts +18 -5
- package/dist/web-publish/origin-engine-lanes.js +289 -48
- package/dist/web-publish/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish/origin-engine.d.ts +44 -5
- package/dist/web-publish/origin-engine.js +279 -38
- package/dist/web-publish/origin-engine_bg.wasm +0 -0
- package/dist/web-publish/origin-engine_bg.wasm.d.ts +18 -5
- package/dist/web-publish-2d/origin-engine-lanes.js +289 -48
- package/dist/web-publish-2d/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine.d.ts +44 -5
- package/dist/web-publish-2d/origin-engine.js +279 -38
- package/dist/web-publish-2d/origin-engine_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine_bg.wasm.d.ts +18 -5
- package/knowledge/README.md +2 -1
- package/knowledge/guides/three-to-og.md +393 -0
- package/knowledge/knowledge.json +2 -1
- package/knowledge/looks/catalogue.json +123 -2
- 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 +209 -27
- package/knowledge/skills/og-audio/SKILL.md +33 -7
- package/knowledge/skills/og-build/SKILL.md +66 -7
- package/knowledge/skills/og-core/SKILL.md +24 -8
- package/knowledge/skills/og-feel/SKILL.md +11 -3
- package/knowledge/skills/og-game/SKILL.md +680 -51
- 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 +7 -1
- package/knowledge/skills/og-taste/SKILL.md +7 -0
- package/knowledge/skills/og-ui/SKILL.md +39 -8
- package/knowledge/wiki/ai.md +20 -20
- package/knowledge/wiki/anim.md +537 -63
- package/knowledge/wiki/atmosphere.md +13 -13
- package/knowledge/wiki/audio.md +160 -20
- 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 +81 -3
- package/knowledge/wiki/input.md +47 -47
- package/knowledge/wiki/load.md +83 -57
- package/knowledge/wiki/math.md +102 -102
- 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 +111 -100
- package/knowledge/wiki/platform.md +44 -44
- package/knowledge/wiki/probe.md +86 -86
- package/knowledge/wiki/reflect.md +30 -18
- package/knowledge/wiki/render.md +1243 -176
- 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 +2238 -81
- package/shell/page.ts +4 -0
- package/shell/platform.ts +5 -0
- package/shell/player.ts +8 -2
- package/shell/transport.ts +6 -0
- package/src/generated/abi.ts +40 -1
- package/src/geom.ts +260 -0
- package/src/index.ts +19 -1
- package/src/node/device.ts +5 -2
- package/src/node/playtest-run.ts +1 -0
- package/src/node/polish.ts +34 -15
- package/src/node/run.ts +23 -6
- package/src/platform-local.ts +2 -0
- package/src/playtest.ts +8 -0
- package/src/runtime.ts +88 -6
- package/src/ui-kit/settings.ts +9 -0
- package/src/web/gl-state.ts +907 -0
- package/src/web/shell.ts +1 -1
- package/src/web/worker.ts +8 -2
- package/types/bindings.json +1222 -453
- package/types/index.d.ts +1868 -315
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 5417</sub>
|
|
22
22
|
|
|
23
23
|
## Contents
|
|
24
24
|
|
|
@@ -32,6 +32,8 @@ module load {
|
|
|
32
32
|
| [`TextureArray()`](#column-TextureArray) | column kind | A TextureArray handle field (0 is none). |
|
|
33
33
|
| [`Asset()`](#column-Asset) | column kind | An Asset handle field. |
|
|
34
34
|
| [`Sound()`](#column-Sound) | column kind | A Sound handle field. |
|
|
35
|
+
| [`Font()`](#column-Font) | column kind | A Font handle field (0 is none): a font og.load.font answered, kept for og.render.text or og.ui.configure. |
|
|
36
|
+
| [`Style()`](#column-Style) | column kind | A Style handle field (0 is none): a UI style og.load.style answered, kept for og.ui.configure. |
|
|
35
37
|
| [`LoadStatus`](#type-LoadStatus) | enum | Where a load is. |
|
|
36
38
|
| [`GltfDesc`](#type-GltfDesc) | desc struct | How to load a glTF, as three.js GLTFLoader options where they apply. |
|
|
37
39
|
| [`GltfInfo`](#type-GltfInfo) | struct | What a loaded glTF holds. |
|
|
@@ -52,7 +54,7 @@ module load {
|
|
|
52
54
|
| [`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
55
|
| [`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
56
|
| [`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.
|
|
57
|
+
| [`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
58
|
| [`og.load.texture`](#fn-texture) | function | Load a cooked texture for og.render.sprite and og.ui.image, as three.js TextureLoader.load. |
|
|
57
59
|
| [`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
60
|
| [`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 +106,7 @@ fn bundle {
|
|
|
104
106
|
}
|
|
105
107
|
```
|
|
106
108
|
|
|
107
|
-
<sub>`api.ogt` line
|
|
109
|
+
<sub>`api.ogt` line 5570</sub>
|
|
108
110
|
|
|
109
111
|
<a id="fn-bundleInfo"></a>
|
|
110
112
|
|
|
@@ -134,7 +136,7 @@ fn bundleInfo {
|
|
|
134
136
|
}
|
|
135
137
|
```
|
|
136
138
|
|
|
137
|
-
<sub>`api.ogt` line
|
|
139
|
+
<sub>`api.ogt` line 5577</sub>
|
|
138
140
|
|
|
139
141
|
<a id="fn-defaultBundle"></a>
|
|
140
142
|
|
|
@@ -162,7 +164,7 @@ fn defaultBundle {
|
|
|
162
164
|
}
|
|
163
165
|
```
|
|
164
166
|
|
|
165
|
-
<sub>`api.ogt` line
|
|
167
|
+
<sub>`api.ogt` line 5584</sub>
|
|
166
168
|
|
|
167
169
|
<a id="fn-gltf"></a>
|
|
168
170
|
|
|
@@ -170,7 +172,7 @@ fn defaultBundle {
|
|
|
170
172
|
|
|
171
173
|
Load a cooked glTF (.gltf or .glb), as three.js GLTFLoader.load: its meshes, materials and textures join the renderer once.
|
|
172
174
|
|
|
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).
|
|
175
|
+
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
176
|
|
|
175
177
|
```ts
|
|
176
178
|
og.load.gltf(world: World, path: string, desc?: GltfDesc): Result<Asset>
|
|
@@ -189,7 +191,7 @@ Binding symbol `og_load_gltf` · publish builds: kept
|
|
|
189
191
|
```ogt
|
|
190
192
|
fn gltf {
|
|
191
193
|
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)."
|
|
194
|
+
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
195
|
param world World "The world that owns the asset."
|
|
194
196
|
param path String "The asset id, such as `models/ship.glb`."
|
|
195
197
|
param desc GltfDesc "Scene and shadow options."
|
|
@@ -197,7 +199,7 @@ fn gltf {
|
|
|
197
199
|
}
|
|
198
200
|
```
|
|
199
201
|
|
|
200
|
-
<sub>`api.ogt` line
|
|
202
|
+
<sub>`api.ogt` line 5590</sub>
|
|
201
203
|
|
|
202
204
|
<a id="fn-scene"></a>
|
|
203
205
|
|
|
@@ -227,7 +229,7 @@ fn scene {
|
|
|
227
229
|
}
|
|
228
230
|
```
|
|
229
231
|
|
|
230
|
-
<sub>`api.ogt` line
|
|
232
|
+
<sub>`api.ogt` line 5599</sub>
|
|
231
233
|
|
|
232
234
|
<a id="fn-font"></a>
|
|
233
235
|
|
|
@@ -257,7 +259,7 @@ fn font {
|
|
|
257
259
|
}
|
|
258
260
|
```
|
|
259
261
|
|
|
260
|
-
<sub>`api.ogt` line
|
|
262
|
+
<sub>`api.ogt` line 5606</sub>
|
|
261
263
|
|
|
262
264
|
<a id="fn-fontInfo"></a>
|
|
263
265
|
|
|
@@ -287,7 +289,7 @@ fn fontInfo {
|
|
|
287
289
|
}
|
|
288
290
|
```
|
|
289
291
|
|
|
290
|
-
<sub>`api.ogt` line
|
|
292
|
+
<sub>`api.ogt` line 5613</sub>
|
|
291
293
|
|
|
292
294
|
<a id="fn-sound"></a>
|
|
293
295
|
|
|
@@ -320,7 +322,7 @@ fn sound {
|
|
|
320
322
|
}
|
|
321
323
|
```
|
|
322
324
|
|
|
323
|
-
<sub>`api.ogt` line
|
|
325
|
+
<sub>`api.ogt` line 5620</sub>
|
|
324
326
|
|
|
325
327
|
<a id="fn-lut"></a>
|
|
326
328
|
|
|
@@ -350,7 +352,7 @@ fn lut {
|
|
|
350
352
|
}
|
|
351
353
|
```
|
|
352
354
|
|
|
353
|
-
<sub>`api.ogt` line
|
|
355
|
+
<sub>`api.ogt` line 5628</sub>
|
|
354
356
|
|
|
355
357
|
<a id="fn-environment"></a>
|
|
356
358
|
|
|
@@ -380,7 +382,7 @@ fn environment {
|
|
|
380
382
|
}
|
|
381
383
|
```
|
|
382
384
|
|
|
383
|
-
<sub>`api.ogt` line
|
|
385
|
+
<sub>`api.ogt` line 5635</sub>
|
|
384
386
|
|
|
385
387
|
<a id="fn-emitter"></a>
|
|
386
388
|
|
|
@@ -410,7 +412,7 @@ fn emitter {
|
|
|
410
412
|
}
|
|
411
413
|
```
|
|
412
414
|
|
|
413
|
-
<sub>`api.ogt` line
|
|
415
|
+
<sub>`api.ogt` line 5642</sub>
|
|
414
416
|
|
|
415
417
|
<a id="fn-shader"></a>
|
|
416
418
|
|
|
@@ -440,13 +442,13 @@ fn shader {
|
|
|
440
442
|
}
|
|
441
443
|
```
|
|
442
444
|
|
|
443
|
-
<sub>`api.ogt` line
|
|
445
|
+
<sub>`api.ogt` line 5649</sub>
|
|
444
446
|
|
|
445
447
|
<a id="fn-post"></a>
|
|
446
448
|
|
|
447
449
|
### `og.load.post`
|
|
448
450
|
|
|
449
|
-
A custom post pass for PostEffects.
|
|
451
|
+
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
452
|
|
|
451
453
|
```ts
|
|
452
454
|
og.load.post(world: World, path: string): Result<Post>
|
|
@@ -463,14 +465,14 @@ Binding symbol `og_load_post` · publish builds: kept
|
|
|
463
465
|
|
|
464
466
|
```ogt
|
|
465
467
|
fn post {
|
|
466
|
-
doc "A custom post pass for PostEffects.
|
|
468
|
+
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
469
|
param world World "The world whose renderer owns it."
|
|
468
470
|
param path String "The asset id, such as `post/crt.ogt`."
|
|
469
471
|
returns Result.Post "Refused for a path not in the bundle or not a post pass."
|
|
470
472
|
}
|
|
471
473
|
```
|
|
472
474
|
|
|
473
|
-
<sub>`api.ogt` line
|
|
475
|
+
<sub>`api.ogt` line 5656</sub>
|
|
474
476
|
|
|
475
477
|
<a id="fn-texture"></a>
|
|
476
478
|
|
|
@@ -503,7 +505,7 @@ fn texture {
|
|
|
503
505
|
}
|
|
504
506
|
```
|
|
505
507
|
|
|
506
|
-
<sub>`api.ogt` line
|
|
508
|
+
<sub>`api.ogt` line 5663</sub>
|
|
507
509
|
|
|
508
510
|
<a id="fn-textureArray"></a>
|
|
509
511
|
|
|
@@ -536,7 +538,7 @@ fn textureArray {
|
|
|
536
538
|
}
|
|
537
539
|
```
|
|
538
540
|
|
|
539
|
-
<sub>`api.ogt` line
|
|
541
|
+
<sub>`api.ogt` line 5671</sub>
|
|
540
542
|
|
|
541
543
|
<a id="fn-style"></a>
|
|
542
544
|
|
|
@@ -566,7 +568,7 @@ fn style {
|
|
|
566
568
|
}
|
|
567
569
|
```
|
|
568
570
|
|
|
569
|
-
<sub>`api.ogt` line
|
|
571
|
+
<sub>`api.ogt` line 5679</sub>
|
|
570
572
|
|
|
571
573
|
<a id="fn-look"></a>
|
|
572
574
|
|
|
@@ -596,7 +598,7 @@ fn look {
|
|
|
596
598
|
}
|
|
597
599
|
```
|
|
598
600
|
|
|
599
|
-
<sub>`api.ogt` line
|
|
601
|
+
<sub>`api.ogt` line 5686</sub>
|
|
600
602
|
|
|
601
603
|
<a id="fn-lookInfo"></a>
|
|
602
604
|
|
|
@@ -626,7 +628,7 @@ fn lookInfo {
|
|
|
626
628
|
}
|
|
627
629
|
```
|
|
628
630
|
|
|
629
|
-
<sub>`api.ogt` line
|
|
631
|
+
<sub>`api.ogt` line 5693</sub>
|
|
630
632
|
|
|
631
633
|
<a id="fn-palette"></a>
|
|
632
634
|
|
|
@@ -656,7 +658,7 @@ fn palette {
|
|
|
656
658
|
}
|
|
657
659
|
```
|
|
658
660
|
|
|
659
|
-
<sub>`api.ogt` line
|
|
661
|
+
<sub>`api.ogt` line 5700</sub>
|
|
660
662
|
|
|
661
663
|
<a id="fn-soundInfo"></a>
|
|
662
664
|
|
|
@@ -686,7 +688,7 @@ fn soundInfo {
|
|
|
686
688
|
}
|
|
687
689
|
```
|
|
688
690
|
|
|
689
|
-
<sub>`api.ogt` line
|
|
691
|
+
<sub>`api.ogt` line 5707</sub>
|
|
690
692
|
|
|
691
693
|
<a id="fn-status"></a>
|
|
692
694
|
|
|
@@ -716,7 +718,7 @@ fn status {
|
|
|
716
718
|
}
|
|
717
719
|
```
|
|
718
720
|
|
|
719
|
-
<sub>`api.ogt` line
|
|
721
|
+
<sub>`api.ogt` line 5714</sub>
|
|
720
722
|
|
|
721
723
|
<a id="fn-error"></a>
|
|
722
724
|
|
|
@@ -746,7 +748,7 @@ fn error {
|
|
|
746
748
|
}
|
|
747
749
|
```
|
|
748
750
|
|
|
749
|
-
<sub>`api.ogt` line
|
|
751
|
+
<sub>`api.ogt` line 5721</sub>
|
|
750
752
|
|
|
751
753
|
<a id="fn-gltfInfo"></a>
|
|
752
754
|
|
|
@@ -776,7 +778,7 @@ fn gltfInfo {
|
|
|
776
778
|
}
|
|
777
779
|
```
|
|
778
780
|
|
|
779
|
-
<sub>`api.ogt` line
|
|
781
|
+
<sub>`api.ogt` line 5728</sub>
|
|
780
782
|
|
|
781
783
|
<a id="fn-animation"></a>
|
|
782
784
|
|
|
@@ -809,7 +811,7 @@ fn animation {
|
|
|
809
811
|
}
|
|
810
812
|
```
|
|
811
813
|
|
|
812
|
-
<sub>`api.ogt` line
|
|
814
|
+
<sub>`api.ogt` line 5735</sub>
|
|
813
815
|
|
|
814
816
|
<a id="fn-rig"></a>
|
|
815
817
|
|
|
@@ -839,7 +841,7 @@ fn rig {
|
|
|
839
841
|
}
|
|
840
842
|
```
|
|
841
843
|
|
|
842
|
-
<sub>`api.ogt` line
|
|
844
|
+
<sub>`api.ogt` line 5743</sub>
|
|
843
845
|
|
|
844
846
|
<a id="fn-flipbook"></a>
|
|
845
847
|
|
|
@@ -869,7 +871,7 @@ fn flipbook {
|
|
|
869
871
|
}
|
|
870
872
|
```
|
|
871
873
|
|
|
872
|
-
<sub>`api.ogt` line
|
|
874
|
+
<sub>`api.ogt` line 5750</sub>
|
|
873
875
|
|
|
874
876
|
<a id="fn-tilemap"></a>
|
|
875
877
|
|
|
@@ -899,7 +901,7 @@ fn tilemap {
|
|
|
899
901
|
}
|
|
900
902
|
```
|
|
901
903
|
|
|
902
|
-
<sub>`api.ogt` line
|
|
904
|
+
<sub>`api.ogt` line 5757</sub>
|
|
903
905
|
|
|
904
906
|
<a id="fn-video"></a>
|
|
905
907
|
|
|
@@ -929,7 +931,7 @@ fn video {
|
|
|
929
931
|
}
|
|
930
932
|
```
|
|
931
933
|
|
|
932
|
-
<sub>`api.ogt` line
|
|
934
|
+
<sub>`api.ogt` line 5764</sub>
|
|
933
935
|
|
|
934
936
|
<a id="fn-videoInfo"></a>
|
|
935
937
|
|
|
@@ -959,7 +961,7 @@ fn videoInfo {
|
|
|
959
961
|
}
|
|
960
962
|
```
|
|
961
963
|
|
|
962
|
-
<sub>`api.ogt` line
|
|
964
|
+
<sub>`api.ogt` line 5771</sub>
|
|
963
965
|
|
|
964
966
|
<a id="fn-timeline"></a>
|
|
965
967
|
|
|
@@ -989,7 +991,7 @@ fn timeline {
|
|
|
989
991
|
}
|
|
990
992
|
```
|
|
991
993
|
|
|
992
|
-
<sub>`api.ogt` line
|
|
994
|
+
<sub>`api.ogt` line 5778</sub>
|
|
993
995
|
|
|
994
996
|
<a id="fn-rig2d"></a>
|
|
995
997
|
|
|
@@ -1019,7 +1021,7 @@ fn rig2d {
|
|
|
1019
1021
|
}
|
|
1020
1022
|
```
|
|
1021
1023
|
|
|
1022
|
-
<sub>`api.ogt` line
|
|
1024
|
+
<sub>`api.ogt` line 5785</sub>
|
|
1023
1025
|
|
|
1024
1026
|
## Components, resources and events
|
|
1025
1027
|
|
|
@@ -1042,7 +1044,7 @@ Token `og.Model`, registered under the schema name `og.Model`; its value type is
|
|
|
1042
1044
|
| `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
1045
|
| `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
1046
|
| `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
|
|
1047
|
+
| `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
1048
|
| `layers` | `number` | `1` | — | — | — | Three.js layers of every mesh of the model, as Mesh.layers. |
|
|
1047
1049
|
| `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
1050
|
|
|
@@ -1071,7 +1073,7 @@ component Model {
|
|
|
1071
1073
|
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
1074
|
default true
|
|
1073
1075
|
}
|
|
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
|
|
1076
|
+
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
1077
|
default 1
|
|
1076
1078
|
min 0
|
|
1077
1079
|
max 16
|
|
@@ -1084,7 +1086,7 @@ component Model {
|
|
|
1084
1086
|
}
|
|
1085
1087
|
```
|
|
1086
1088
|
|
|
1087
|
-
<sub>`api.ogt` line
|
|
1089
|
+
<sub>`api.ogt` line 5534</sub>
|
|
1088
1090
|
|
|
1089
1091
|
<a id="record-AssetReady"></a>
|
|
1090
1092
|
|
|
@@ -1107,7 +1109,7 @@ event AssetReady {
|
|
|
1107
1109
|
}
|
|
1108
1110
|
```
|
|
1109
1111
|
|
|
1110
|
-
<sub>`api.ogt` line
|
|
1112
|
+
<sub>`api.ogt` line 5792</sub>
|
|
1111
1113
|
|
|
1112
1114
|
<a id="record-AssetFailed"></a>
|
|
1113
1115
|
|
|
@@ -1132,7 +1134,7 @@ event AssetFailed {
|
|
|
1132
1134
|
}
|
|
1133
1135
|
```
|
|
1134
1136
|
|
|
1135
|
-
<sub>`api.ogt` line
|
|
1137
|
+
<sub>`api.ogt` line 5798</sub>
|
|
1136
1138
|
|
|
1137
1139
|
## Types
|
|
1138
1140
|
|
|
@@ -1148,7 +1150,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
|
|
|
1148
1150
|
handle Asset "A loaded bundle, scene or glTF asset."
|
|
1149
1151
|
```
|
|
1150
1152
|
|
|
1151
|
-
<sub>`api.ogt` line
|
|
1153
|
+
<sub>`api.ogt` line 5423</sub>
|
|
1152
1154
|
|
|
1153
1155
|
<a id="type-Font"></a>
|
|
1154
1156
|
|
|
@@ -1162,7 +1164,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
|
|
|
1162
1164
|
handle Font "A cooked MSDF font: its glyph table and one or more atlas pages."
|
|
1163
1165
|
```
|
|
1164
1166
|
|
|
1165
|
-
<sub>`api.ogt` line
|
|
1167
|
+
<sub>`api.ogt` line 5424</sub>
|
|
1166
1168
|
|
|
1167
1169
|
<a id="type-Sound"></a>
|
|
1168
1170
|
|
|
@@ -1176,7 +1178,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
|
|
|
1176
1178
|
handle Sound "A cooked sound: QOA-encoded PCM the audio module plays."
|
|
1177
1179
|
```
|
|
1178
1180
|
|
|
1179
|
-
<sub>`api.ogt` line
|
|
1181
|
+
<sub>`api.ogt` line 5425</sub>
|
|
1180
1182
|
|
|
1181
1183
|
<a id="type-Style"></a>
|
|
1182
1184
|
|
|
@@ -1190,7 +1192,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
|
|
|
1190
1192
|
handle Style "A cooked UI style: its values, atlas, fonts, icons and sounds loaded with it, for og.ui.configure."
|
|
1191
1193
|
```
|
|
1192
1194
|
|
|
1193
|
-
<sub>`api.ogt` line
|
|
1195
|
+
<sub>`api.ogt` line 5426</sub>
|
|
1194
1196
|
|
|
1195
1197
|
<a id="type-TextureArray"></a>
|
|
1196
1198
|
|
|
@@ -1204,7 +1206,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
|
|
|
1204
1206
|
handle TextureArray "A cooked texture array: same-sized layers uploaded as one 2D-array texture (og.load.textureArray)."
|
|
1205
1207
|
```
|
|
1206
1208
|
|
|
1207
|
-
<sub>`api.ogt` line
|
|
1209
|
+
<sub>`api.ogt` line 5427</sub>
|
|
1208
1210
|
|
|
1209
1211
|
<a id="type-LoadStatus"></a>
|
|
1210
1212
|
|
|
@@ -1229,7 +1231,7 @@ enum LoadStatus {
|
|
|
1229
1231
|
}
|
|
1230
1232
|
```
|
|
1231
1233
|
|
|
1232
|
-
<sub>`api.ogt` line
|
|
1234
|
+
<sub>`api.ogt` line 5464</sub>
|
|
1233
1235
|
|
|
1234
1236
|
<a id="type-GltfDesc"></a>
|
|
1235
1237
|
|
|
@@ -1259,7 +1261,7 @@ struct GltfDesc {
|
|
|
1259
1261
|
}
|
|
1260
1262
|
```
|
|
1261
1263
|
|
|
1262
|
-
<sub>`api.ogt` line
|
|
1264
|
+
<sub>`api.ogt` line 5471</sub>
|
|
1263
1265
|
|
|
1264
1266
|
<a id="type-GltfInfo"></a>
|
|
1265
1267
|
|
|
@@ -1284,7 +1286,7 @@ struct GltfInfo {
|
|
|
1284
1286
|
}
|
|
1285
1287
|
```
|
|
1286
1288
|
|
|
1287
|
-
<sub>`api.ogt` line
|
|
1289
|
+
<sub>`api.ogt` line 5483</sub>
|
|
1288
1290
|
|
|
1289
1291
|
<a id="type-BundleInfo"></a>
|
|
1290
1292
|
|
|
@@ -1307,7 +1309,7 @@ struct BundleInfo {
|
|
|
1307
1309
|
}
|
|
1308
1310
|
```
|
|
1309
1311
|
|
|
1310
|
-
<sub>`api.ogt` line
|
|
1312
|
+
<sub>`api.ogt` line 5491</sub>
|
|
1311
1313
|
|
|
1312
1314
|
<a id="type-FontInfo"></a>
|
|
1313
1315
|
|
|
@@ -1340,7 +1342,7 @@ struct FontInfo {
|
|
|
1340
1342
|
}
|
|
1341
1343
|
```
|
|
1342
1344
|
|
|
1343
|
-
<sub>`api.ogt` line
|
|
1345
|
+
<sub>`api.ogt` line 5498</sub>
|
|
1344
1346
|
|
|
1345
1347
|
<a id="type-SoundInfo"></a>
|
|
1346
1348
|
|
|
@@ -1371,7 +1373,7 @@ struct SoundInfo {
|
|
|
1371
1373
|
}
|
|
1372
1374
|
```
|
|
1373
1375
|
|
|
1374
|
-
<sub>`api.ogt` line
|
|
1376
|
+
<sub>`api.ogt` line 5510</sub>
|
|
1375
1377
|
|
|
1376
1378
|
<a id="type-TextureArrayInfo"></a>
|
|
1377
1379
|
|
|
@@ -1402,7 +1404,7 @@ struct TextureArrayInfo {
|
|
|
1402
1404
|
}
|
|
1403
1405
|
```
|
|
1404
1406
|
|
|
1405
|
-
<sub>`api.ogt` line
|
|
1407
|
+
<sub>`api.ogt` line 5523</sub>
|
|
1406
1408
|
|
|
1407
1409
|
## Column kinds
|
|
1408
1410
|
|
|
@@ -1413,6 +1415,8 @@ Each is a factory, `TextureArray(value?, options?)`, that makes one field of a c
|
|
|
1413
1415
|
| <a id="column-TextureArray"></a>`TextureArray` | `TextureArray` | `Uint32Array` | 2 | A TextureArray handle field (0 is none). |
|
|
1414
1416
|
| <a id="column-Asset"></a>`Asset` | `Asset` | `Uint32Array` | 2 | An Asset handle field. |
|
|
1415
1417
|
| <a id="column-Sound"></a>`Sound` | `Sound` | `Uint32Array` | 2 | A Sound handle field. |
|
|
1418
|
+
| <a id="column-Font"></a>`Font` | `Font` | `Uint32Array` | 2 | A Font handle field (0 is none): a font og.load.font answered, kept for og.render.text or og.ui.configure. |
|
|
1419
|
+
| <a id="column-Style"></a>`Style` | `Style` | `Uint32Array` | 2 | A Style handle field (0 is none): a UI style og.load.style answered, kept for og.ui.configure. |
|
|
1416
1420
|
|
|
1417
1421
|
```ogt
|
|
1418
1422
|
column TextureArray {
|
|
@@ -1423,7 +1427,7 @@ column TextureArray {
|
|
|
1423
1427
|
}
|
|
1424
1428
|
```
|
|
1425
1429
|
|
|
1426
|
-
<sub>`api.ogt` line
|
|
1430
|
+
<sub>`api.ogt` line 5429</sub>
|
|
1427
1431
|
|
|
1428
1432
|
```ogt
|
|
1429
1433
|
column Asset {
|
|
@@ -1434,7 +1438,7 @@ column Asset {
|
|
|
1434
1438
|
}
|
|
1435
1439
|
```
|
|
1436
1440
|
|
|
1437
|
-
<sub>`api.ogt` line
|
|
1441
|
+
<sub>`api.ogt` line 5436</sub>
|
|
1438
1442
|
|
|
1439
1443
|
```ogt
|
|
1440
1444
|
column Sound {
|
|
@@ -1445,4 +1449,26 @@ column Sound {
|
|
|
1445
1449
|
}
|
|
1446
1450
|
```
|
|
1447
1451
|
|
|
1448
|
-
<sub>`api.ogt` line
|
|
1452
|
+
<sub>`api.ogt` line 5443</sub>
|
|
1453
|
+
|
|
1454
|
+
```ogt
|
|
1455
|
+
column Font {
|
|
1456
|
+
doc "A Font handle field (0 is none): a font og.load.font answered, kept for og.render.text or og.ui.configure."
|
|
1457
|
+
array Uint32Array
|
|
1458
|
+
stride 2
|
|
1459
|
+
value Font
|
|
1460
|
+
}
|
|
1461
|
+
```
|
|
1462
|
+
|
|
1463
|
+
<sub>`api.ogt` line 5450</sub>
|
|
1464
|
+
|
|
1465
|
+
```ogt
|
|
1466
|
+
column Style {
|
|
1467
|
+
doc "A Style handle field (0 is none): a UI style og.load.style answered, kept for og.ui.configure."
|
|
1468
|
+
array Uint32Array
|
|
1469
|
+
stride 2
|
|
1470
|
+
value Style
|
|
1471
|
+
}
|
|
1472
|
+
```
|
|
1473
|
+
|
|
1474
|
+
<sub>`api.ogt` line 5457</sub>
|