@origingame/engine 0.1.1 → 0.3.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/bin/og.mjs +1 -1
- package/dist/web/origin-engine.d.ts +219 -5
- package/dist/web/origin-engine.js +1344 -125
- package/dist/web/origin-engine_bg.wasm +0 -0
- package/dist/web/origin-engine_bg.wasm.d.ts +68 -3
- package/dist/web-publish/origin-engine-lanes.js +1007 -22
- package/dist/web-publish/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish/origin-engine.d.ts +162 -5
- package/dist/web-publish/origin-engine.js +1004 -19
- package/dist/web-publish/origin-engine_bg.wasm +0 -0
- package/dist/web-publish/origin-engine_bg.wasm.d.ts +52 -3
- package/dist/web-publish-2d/origin-engine-lanes.js +1007 -22
- package/dist/web-publish-2d/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine.d.ts +162 -5
- package/dist/web-publish-2d/origin-engine.js +1004 -19
- package/dist/web-publish-2d/origin-engine_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine_bg.wasm.d.ts +52 -3
- package/knowledge/looks/catalogue.json +40 -40
- package/knowledge/package.json +4 -4
- package/knowledge/scaffold/distribution.json +14 -0
- package/knowledge/scaffold/origin-engine.json +2 -2
- package/knowledge/scaffold/template/README.md +2 -1
- package/knowledge/scaffold/template/assets/audio/sting.ogt +10 -0
- package/knowledge/scaffold/template/assets/timelines/intro.ogt +101 -0
- package/knowledge/scaffold/template/assets/timelines/narration.srt +11 -0
- package/knowledge/scaffold/template/host.d.ts +46 -0
- package/knowledge/scaffold/template/package.json +1 -1
- package/knowledge/scaffold/template/project.ogt +1 -1
- package/knowledge/scaffold/template/src/main.ts +1 -1
- package/knowledge/scaffold/template/tests/frames.ts +134 -0
- package/knowledge/scaffold/template/tests/intro.og.ts +65 -0
- package/knowledge/scaffold/template/tests/smoke.og.ts +30 -36
- package/knowledge/scaffold/template/tsconfig.json +1 -1
- package/knowledge/scripts/mount.ts +2 -1
- package/knowledge/scripts/validate.ts +21 -11
- package/knowledge/skills/og-build/SKILL.md +25 -6
- package/knowledge/skills/og-core/SKILL.md +11 -0
- package/knowledge/skills/og-feel/SKILL.md +8 -1
- package/knowledge/skills/og-game/SKILL.md +994 -21
- package/knowledge/skills/og-i18n/SKILL.md +12 -3
- package/knowledge/skills/og-platform-sdk/SKILL.md +4 -1
- package/knowledge/skills/og-taste/SKILL.md +82 -73
- package/knowledge/skills/og-ui/SKILL.md +82 -54
- package/knowledge/wiki/ai.md +20 -20
- package/knowledge/wiki/anim.md +384 -41
- package/knowledge/wiki/atmosphere.md +36 -13
- package/knowledge/wiki/audio.md +18 -18
- package/knowledge/wiki/camera.md +19 -13
- package/knowledge/wiki/commands.md +19 -13
- package/knowledge/wiki/debug.md +414 -0
- package/knowledge/wiki/game.md +8 -8
- package/knowledge/wiki/i18n.md +7 -7
- package/knowledge/wiki/index.md +265 -7
- package/knowledge/wiki/input.md +47 -47
- package/knowledge/wiki/load.md +236 -68
- package/knowledge/wiki/math.md +2614 -7
- package/knowledge/wiki/nav.md +34 -34
- package/knowledge/wiki/net.md +340 -0
- package/knowledge/wiki/path.md +402 -0
- package/knowledge/wiki/physics.md +124 -106
- package/knowledge/wiki/platform.md +465 -31
- package/knowledge/wiki/probe.md +681 -67
- package/knowledge/wiki/reflect.md +15 -15
- package/knowledge/wiki/render.md +3904 -1897
- package/knowledge/wiki/rng.md +14 -14
- 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 +19 -19
- package/knowledge/wiki/tilemap.md +19 -15
- package/knowledge/wiki/time.md +4 -4
- package/knowledge/wiki/timeline.md +396 -0
- package/knowledge/wiki/transform.md +8 -8
- package/knowledge/wiki/tween.md +17 -17
- package/knowledge/wiki/ui.md +603 -629
- package/knowledge/wiki/video.md +157 -0
- package/knowledge/wiki/world.md +67 -37
- package/package.json +7 -6
- package/schema/api.schema.json +21071 -13964
- package/shell/page.ts +26 -2
- package/shell/platform.ts +46 -0
- package/shell/player.ts +7 -0
- package/src/depth.ts +71 -0
- package/src/e6.ts +32 -1
- package/src/env.d.ts +5 -1
- package/src/generated/abi.ts +189 -3
- package/src/index.ts +26 -4
- package/src/light.ts +18 -0
- package/src/math.ts +622 -0
- package/src/node/index.ts +17 -0
- package/src/node/playtest-run.ts +114 -18
- package/src/node/polish.ts +15 -4
- package/src/node/render.ts +291 -0
- package/src/node/run.ts +91 -6
- package/src/p2.ts +19 -1
- package/src/playtest.ts +57 -4
- package/src/runtime.ts +15 -3
- package/src/targets.ts +28 -0
- package/src/trace.ts +169 -0
- package/src/ui-kit/huds.ts +49 -45
- package/src/ui-kit/menus.ts +12 -12
- package/src/ui-kit/settings.ts +2 -2
- package/src/ui-kit/store.ts +18 -18
- package/src/ui-kit/story.ts +6 -4
- package/src/ui-kit/util.ts +8 -8
- package/src/web/shell.ts +58 -0
- package/src/web/worker.ts +103 -2
- package/types/bindings.json +8945 -6456
- package/types/index.d.ts +15507 -11437
|
@@ -16,7 +16,7 @@ module atmosphere {
|
|
|
16
16
|
# declarations follow, each quoted below
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
<sub>`api.ogt` line
|
|
19
|
+
<sub>`api.ogt` line 6734</sub>
|
|
20
20
|
|
|
21
21
|
## Contents
|
|
22
22
|
|
|
@@ -63,7 +63,7 @@ fn timeOfDay {
|
|
|
63
63
|
}
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
<sub>`api.ogt` line
|
|
66
|
+
<sub>`api.ogt` line 7130</sub>
|
|
67
67
|
|
|
68
68
|
## Components, resources and events
|
|
69
69
|
|
|
@@ -89,6 +89,10 @@ Token `og.Fog`, registered under the schema name `og.Fog`; its value type is `Fo
|
|
|
89
89
|
| `sunPower` | `number` | `8` | 0 … 256 | — | tunable | How tight the sun's glow in the fog is (higher: smaller). |
|
|
90
90
|
| `maxOpacity` | `number` | `1` | 0 … 1 | `ratio` | tunable | The most the fog hides. |
|
|
91
91
|
| `sky` | `number` | `1` | 0 … 1 | `ratio` | tunable | How much of the fog covers the sky (0: the sky stays clear). |
|
|
92
|
+
| `volumetric` | `boolean` | `false` | — | — | — | Light the fog as a participating medium: within volumetricDistance of the camera the fog (density per metre, thickened below height by heightDensity and falloff, as above) scatters the sun through its shadow cascades, so light shafts fall through windows and between trees and move with the sun, and every point, spot and rect light it is lit by (up to RenderCapabilities.volumetricLights at each sample); it dims what lies behind it by the same amounts. RenderCapabilities.volumetricFog names the method (a froxel grid on the full tier, a raymarch on WebGL2). Opaque surfaces and the sky are seen through the volume; blended surfaces, particles and sprites take the plain distance and height fog of the same medium. Past volumetricDistance nothing more is added. |
|
|
93
|
+
| `scattering` | `number` | `0.8` | 0 … 4 | — | tunable | How much of the light the fog takes from a ray it scatters (its albedo, tinted by color): 0 dims without glowing, 1 sends all of it on, above 1 brightens the shafts for effect. |
|
|
94
|
+
| `anisotropy` | `number` | `0.6` | -0.95 … 0.95 | — | tunable | Which way the fog scatters (Henyey–Greenstein g): 0 evenly, towards 1 forward (bright looking into the light: shafts against the sun), below 0 back towards the light. |
|
|
95
|
+
| `volumetricDistance` | `number` | `48` | 4 … 400 | `m` | — | How far from the camera the volume reaches. |
|
|
92
96
|
|
|
93
97
|
```ogt
|
|
94
98
|
resource Fog {
|
|
@@ -151,10 +155,29 @@ resource Fog {
|
|
|
151
155
|
unit ratio
|
|
152
156
|
tunable true
|
|
153
157
|
}
|
|
158
|
+
field volumetric bool "Light the fog as a participating medium: within volumetricDistance of the camera the fog (density per metre, thickened below height by heightDensity and falloff, as above) scatters the sun through its shadow cascades, so light shafts fall through windows and between trees and move with the sun, and every point, spot and rect light it is lit by (up to RenderCapabilities.volumetricLights at each sample); it dims what lies behind it by the same amounts. RenderCapabilities.volumetricFog names the method (a froxel grid on the full tier, a raymarch on WebGL2). Opaque surfaces and the sky are seen through the volume; blended surfaces, particles and sprites take the plain distance and height fog of the same medium. Past volumetricDistance nothing more is added."
|
|
159
|
+
field scattering f32 "How much of the light the fog takes from a ray it scatters (its albedo, tinted by color): 0 dims without glowing, 1 sends all of it on, above 1 brightens the shafts for effect." {
|
|
160
|
+
default 0.8
|
|
161
|
+
min 0
|
|
162
|
+
max 4
|
|
163
|
+
tunable true
|
|
164
|
+
}
|
|
165
|
+
field anisotropy f32 "Which way the fog scatters (Henyey–Greenstein g): 0 evenly, towards 1 forward (bright looking into the light: shafts against the sun), below 0 back towards the light." {
|
|
166
|
+
default 0.6
|
|
167
|
+
min -0.95
|
|
168
|
+
max 0.95
|
|
169
|
+
tunable true
|
|
170
|
+
}
|
|
171
|
+
field volumetricDistance f32 "How far from the camera the volume reaches." {
|
|
172
|
+
default 48
|
|
173
|
+
min 4
|
|
174
|
+
max 400
|
|
175
|
+
unit m
|
|
176
|
+
}
|
|
154
177
|
}
|
|
155
178
|
```
|
|
156
179
|
|
|
157
|
-
<sub>`api.ogt` line
|
|
180
|
+
<sub>`api.ogt` line 6745</sub>
|
|
158
181
|
|
|
159
182
|
<a id="record-Sky"></a>
|
|
160
183
|
|
|
@@ -261,7 +284,7 @@ resource Sky {
|
|
|
261
284
|
}
|
|
262
285
|
```
|
|
263
286
|
|
|
264
|
-
<sub>`api.ogt` line
|
|
287
|
+
<sub>`api.ogt` line 6826</sub>
|
|
265
288
|
|
|
266
289
|
<a id="record-DayNight"></a>
|
|
267
290
|
|
|
@@ -343,7 +366,7 @@ resource DayNight {
|
|
|
343
366
|
}
|
|
344
367
|
```
|
|
345
368
|
|
|
346
|
-
<sub>`api.ogt` line
|
|
369
|
+
<sub>`api.ogt` line 6901</sub>
|
|
347
370
|
|
|
348
371
|
<a id="record-Weather"></a>
|
|
349
372
|
|
|
@@ -405,7 +428,7 @@ resource Weather {
|
|
|
405
428
|
}
|
|
406
429
|
```
|
|
407
430
|
|
|
408
|
-
<sub>`api.ogt` line
|
|
431
|
+
<sub>`api.ogt` line 6958</sub>
|
|
409
432
|
|
|
410
433
|
<a id="record-Water"></a>
|
|
411
434
|
|
|
@@ -539,7 +562,7 @@ component Water {
|
|
|
539
562
|
}
|
|
540
563
|
```
|
|
541
564
|
|
|
542
|
-
<sub>`api.ogt` line
|
|
565
|
+
<sub>`api.ogt` line 6998</sub>
|
|
543
566
|
|
|
544
567
|
<a id="record-Water2D"></a>
|
|
545
568
|
|
|
@@ -593,7 +616,7 @@ component Water2D {
|
|
|
593
616
|
}
|
|
594
617
|
```
|
|
595
618
|
|
|
596
|
-
<sub>`api.ogt` line
|
|
619
|
+
<sub>`api.ogt` line 7098</sub>
|
|
597
620
|
|
|
598
621
|
## Constants
|
|
599
622
|
|
|
@@ -609,28 +632,28 @@ component Water2D {
|
|
|
609
632
|
const WEATHER_NONE u32 0 "Weather.kind: clear."
|
|
610
633
|
```
|
|
611
634
|
|
|
612
|
-
<sub>`api.ogt` line
|
|
635
|
+
<sub>`api.ogt` line 6739</sub>
|
|
613
636
|
|
|
614
637
|
```ogt
|
|
615
638
|
const WEATHER_RAIN u32 1 "Weather.kind: rain streaks falling with the wind, the light dimmed and a grey distance fog."
|
|
616
639
|
```
|
|
617
640
|
|
|
618
|
-
<sub>`api.ogt` line
|
|
641
|
+
<sub>`api.ogt` line 6740</sub>
|
|
619
642
|
|
|
620
643
|
```ogt
|
|
621
644
|
const WEATHER_SNOW u32 2 "Weather.kind: flakes drifting down on gusts, a pale fog."
|
|
622
645
|
```
|
|
623
646
|
|
|
624
|
-
<sub>`api.ogt` line
|
|
647
|
+
<sub>`api.ogt` line 6741</sub>
|
|
625
648
|
|
|
626
649
|
```ogt
|
|
627
650
|
const WEATHER_DUST u32 3 "Weather.kind: dust blowing along the wind near the ground, a warm thick fog."
|
|
628
651
|
```
|
|
629
652
|
|
|
630
|
-
<sub>`api.ogt` line
|
|
653
|
+
<sub>`api.ogt` line 6742</sub>
|
|
631
654
|
|
|
632
655
|
```ogt
|
|
633
656
|
const WEATHER_MIST u32 4 "Weather.kind: no particles, a dense low height fog."
|
|
634
657
|
```
|
|
635
658
|
|
|
636
|
-
<sub>`api.ogt` line
|
|
659
|
+
<sub>`api.ogt` line 6743</sub>
|
package/knowledge/wiki/audio.md
CHANGED
|
@@ -18,7 +18,7 @@ module audio {
|
|
|
18
18
|
# declarations follow, each quoted below
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
<sub>`api.ogt` line
|
|
21
|
+
<sub>`api.ogt` line 8069</sub>
|
|
22
22
|
|
|
23
23
|
## Contents
|
|
24
24
|
|
|
@@ -73,7 +73,7 @@ fn outputLatency {
|
|
|
73
73
|
}
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
<sub>`api.ogt` line
|
|
76
|
+
<sub>`api.ogt` line 8449</sub>
|
|
77
77
|
|
|
78
78
|
## Components, resources and events
|
|
79
79
|
|
|
@@ -200,7 +200,7 @@ component AudioSource {
|
|
|
200
200
|
}
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
-
<sub>`api.ogt` line
|
|
203
|
+
<sub>`api.ogt` line 8096</sub>
|
|
204
204
|
|
|
205
205
|
<a id="record-AudioListener"></a>
|
|
206
206
|
|
|
@@ -226,7 +226,7 @@ component AudioListener {
|
|
|
226
226
|
}
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
-
<sub>`api.ogt` line
|
|
229
|
+
<sub>`api.ogt` line 8184</sub>
|
|
230
230
|
|
|
231
231
|
<a id="record-Audio"></a>
|
|
232
232
|
|
|
@@ -314,7 +314,7 @@ resource Audio {
|
|
|
314
314
|
}
|
|
315
315
|
```
|
|
316
316
|
|
|
317
|
-
<sub>`api.ogt` line
|
|
317
|
+
<sub>`api.ogt` line 8194</sub>
|
|
318
318
|
|
|
319
319
|
<a id="record-AudioBusFx"></a>
|
|
320
320
|
|
|
@@ -435,7 +435,7 @@ component AudioBusFx {
|
|
|
435
435
|
}
|
|
436
436
|
```
|
|
437
437
|
|
|
438
|
-
<sub>`api.ogt` line
|
|
438
|
+
<sub>`api.ogt` line 8257</sub>
|
|
439
439
|
|
|
440
440
|
<a id="record-ReverbZone"></a>
|
|
441
441
|
|
|
@@ -506,7 +506,7 @@ component ReverbZone {
|
|
|
506
506
|
}
|
|
507
507
|
```
|
|
508
508
|
|
|
509
|
-
<sub>`api.ogt` line
|
|
509
|
+
<sub>`api.ogt` line 8346</sub>
|
|
510
510
|
|
|
511
511
|
<a id="record-Music"></a>
|
|
512
512
|
|
|
@@ -562,7 +562,7 @@ component Music {
|
|
|
562
562
|
}
|
|
563
563
|
```
|
|
564
564
|
|
|
565
|
-
<sub>`api.ogt` line
|
|
565
|
+
<sub>`api.ogt` line 8392</sub>
|
|
566
566
|
|
|
567
567
|
<a id="record-MusicBeat"></a>
|
|
568
568
|
|
|
@@ -589,7 +589,7 @@ event MusicBeat {
|
|
|
589
589
|
}
|
|
590
590
|
```
|
|
591
591
|
|
|
592
|
-
<sub>`api.ogt` line
|
|
592
|
+
<sub>`api.ogt` line 8426</sub>
|
|
593
593
|
|
|
594
594
|
<a id="record-SoundStarted"></a>
|
|
595
595
|
|
|
@@ -614,7 +614,7 @@ event SoundStarted {
|
|
|
614
614
|
}
|
|
615
615
|
```
|
|
616
616
|
|
|
617
|
-
<sub>`api.ogt` line
|
|
617
|
+
<sub>`api.ogt` line 8434</sub>
|
|
618
618
|
|
|
619
619
|
<a id="record-SoundEnded"></a>
|
|
620
620
|
|
|
@@ -641,7 +641,7 @@ event SoundEnded {
|
|
|
641
641
|
}
|
|
642
642
|
```
|
|
643
643
|
|
|
644
|
-
<sub>`api.ogt` line
|
|
644
|
+
<sub>`api.ogt` line 8441</sub>
|
|
645
645
|
|
|
646
646
|
## Types
|
|
647
647
|
|
|
@@ -670,7 +670,7 @@ enum AudioBus {
|
|
|
670
670
|
}
|
|
671
671
|
```
|
|
672
672
|
|
|
673
|
-
<sub>`api.ogt` line
|
|
673
|
+
<sub>`api.ogt` line 8081</sub>
|
|
674
674
|
|
|
675
675
|
## Column kinds
|
|
676
676
|
|
|
@@ -689,7 +689,7 @@ column AudioBus {
|
|
|
689
689
|
}
|
|
690
690
|
```
|
|
691
691
|
|
|
692
|
-
<sub>`api.ogt` line
|
|
692
|
+
<sub>`api.ogt` line 8089</sub>
|
|
693
693
|
|
|
694
694
|
## Constants
|
|
695
695
|
|
|
@@ -705,28 +705,28 @@ column AudioBus {
|
|
|
705
705
|
const SOUND_FINISHED u32 0 "SoundEnded.reason: a one-shot played to its end."
|
|
706
706
|
```
|
|
707
707
|
|
|
708
|
-
<sub>`api.ogt` line
|
|
708
|
+
<sub>`api.ogt` line 8075</sub>
|
|
709
709
|
|
|
710
710
|
```ogt
|
|
711
711
|
const SOUND_STOPPED u32 1 "SoundEnded.reason: `playing` was set to false."
|
|
712
712
|
```
|
|
713
713
|
|
|
714
|
-
<sub>`api.ogt` line
|
|
714
|
+
<sub>`api.ogt` line 8076</sub>
|
|
715
715
|
|
|
716
716
|
```ogt
|
|
717
717
|
const SOUND_REMOVED u32 2 "SoundEnded.reason: the AudioSource was removed from a living entity."
|
|
718
718
|
```
|
|
719
719
|
|
|
720
|
-
<sub>`api.ogt` line
|
|
720
|
+
<sub>`api.ogt` line 8077</sub>
|
|
721
721
|
|
|
722
722
|
```ogt
|
|
723
723
|
const SOUND_REPLACED u32 3 "SoundEnded.reason: `sound` changed while it played."
|
|
724
724
|
```
|
|
725
725
|
|
|
726
|
-
<sub>`api.ogt` line
|
|
726
|
+
<sub>`api.ogt` line 8078</sub>
|
|
727
727
|
|
|
728
728
|
```ogt
|
|
729
729
|
const SOUND_CULLED u32 4 "SoundEnded.reason: more sources played than Audio.maxVoices and this one stood lowest (priority, then volume, then age)."
|
|
730
730
|
```
|
|
731
731
|
|
|
732
|
-
<sub>`api.ogt` line
|
|
732
|
+
<sub>`api.ogt` line 8079</sub>
|
package/knowledge/wiki/camera.md
CHANGED
|
@@ -16,7 +16,7 @@ module camera {
|
|
|
16
16
|
# declarations follow, each quoted below
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
<sub>`api.ogt` line
|
|
19
|
+
<sub>`api.ogt` line 1872</sub>
|
|
20
20
|
|
|
21
21
|
## Contents
|
|
22
22
|
|
|
@@ -62,7 +62,7 @@ fn shake {
|
|
|
62
62
|
}
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
<sub>`api.ogt` line
|
|
65
|
+
<sub>`api.ogt` line 2212</sub>
|
|
66
66
|
|
|
67
67
|
<a id="fn-punch"></a>
|
|
68
68
|
|
|
@@ -92,7 +92,7 @@ fn punch {
|
|
|
92
92
|
}
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
<sub>`api.ogt` line
|
|
95
|
+
<sub>`api.ogt` line 2219</sub>
|
|
96
96
|
|
|
97
97
|
<a id="fn-kick"></a>
|
|
98
98
|
|
|
@@ -124,7 +124,7 @@ fn kick {
|
|
|
124
124
|
}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
<sub>`api.ogt` line
|
|
127
|
+
<sub>`api.ogt` line 2226</sub>
|
|
128
128
|
|
|
129
129
|
## Components, resources and events
|
|
130
130
|
|
|
@@ -165,6 +165,7 @@ Token `og.Camera`, registered under the schema name `og.Camera`; its value type
|
|
|
165
165
|
| `zoneFromMax` | `Vector2` | `{ x: 0, y: 0 }` | — | `m` | — | Its top-right corner. |
|
|
166
166
|
| `zoneScroll` | `number` | `1` | 0 … 1 | — | — | How far the transition has come, 0 to 1 (eased; 1 is settled). |
|
|
167
167
|
| `zoneScrollTime` | `number` | `0` | ≥ 0 | `s` | — | How long the transition takes: the entered zone's scrollTime. |
|
|
168
|
+
| `layers` | `number` | `1` | — | — | — | Three.js layers, as Camera.layers.mask: the frame draws the meshes, models, world sprites, particle systems, lines and points whose layers share a bit with it. 1 (layer 0) by default, as every object's. |
|
|
168
169
|
|
|
169
170
|
```ogt
|
|
170
171
|
resource Camera {
|
|
@@ -295,10 +296,13 @@ resource Camera {
|
|
|
295
296
|
param y f32 "Vertical position in CSS pixels."
|
|
296
297
|
returns Ray
|
|
297
298
|
}
|
|
299
|
+
field layers u32 "Three.js layers, as Camera.layers.mask: the frame draws the meshes, models, world sprites, particle systems, lines and points whose layers share a bit with it. 1 (layer 0) by default, as every object's." {
|
|
300
|
+
default 1
|
|
301
|
+
}
|
|
298
302
|
}
|
|
299
303
|
```
|
|
300
304
|
|
|
301
|
-
<sub>`api.ogt` line
|
|
305
|
+
<sub>`api.ogt` line 1877</sub>
|
|
302
306
|
|
|
303
307
|
<a id="member-Camera-lookAt"></a>
|
|
304
308
|
|
|
@@ -325,7 +329,7 @@ fn lookAt {
|
|
|
325
329
|
}
|
|
326
330
|
```
|
|
327
331
|
|
|
328
|
-
<sub>`api.ogt` line
|
|
332
|
+
<sub>`api.ogt` line 1990</sub>
|
|
329
333
|
|
|
330
334
|
<a id="member-Camera-worldToScreen"></a>
|
|
331
335
|
|
|
@@ -353,7 +357,7 @@ fn worldToScreen {
|
|
|
353
357
|
}
|
|
354
358
|
```
|
|
355
359
|
|
|
356
|
-
<sub>`api.ogt` line
|
|
360
|
+
<sub>`api.ogt` line 1994</sub>
|
|
357
361
|
|
|
358
362
|
<a id="member-Camera-screenToRay"></a>
|
|
359
363
|
|
|
@@ -383,7 +387,7 @@ fn screenToRay {
|
|
|
383
387
|
}
|
|
384
388
|
```
|
|
385
389
|
|
|
386
|
-
<sub>`api.ogt` line
|
|
390
|
+
<sub>`api.ogt` line 1999</sub>
|
|
387
391
|
|
|
388
392
|
<a id="record-OrbitCamera"></a>
|
|
389
393
|
|
|
@@ -491,7 +495,7 @@ component OrbitCamera {
|
|
|
491
495
|
}
|
|
492
496
|
```
|
|
493
497
|
|
|
494
|
-
<sub>`api.ogt` line
|
|
498
|
+
<sub>`api.ogt` line 2010</sub>
|
|
495
499
|
|
|
496
500
|
<a id="record-FollowCamera"></a>
|
|
497
501
|
|
|
@@ -529,7 +533,7 @@ component FollowCamera {
|
|
|
529
533
|
}
|
|
530
534
|
```
|
|
531
535
|
|
|
532
|
-
<sub>`api.ogt` line
|
|
536
|
+
<sub>`api.ogt` line 2084</sub>
|
|
533
537
|
|
|
534
538
|
<a id="record-Follow2D"></a>
|
|
535
539
|
|
|
@@ -608,7 +612,7 @@ component Follow2D {
|
|
|
608
612
|
}
|
|
609
613
|
```
|
|
610
614
|
|
|
611
|
-
<sub>`api.ogt` line
|
|
615
|
+
<sub>`api.ogt` line 2103</sub>
|
|
612
616
|
|
|
613
617
|
<a id="record-CameraZone"></a>
|
|
614
618
|
|
|
@@ -643,7 +647,7 @@ component CameraZone {
|
|
|
643
647
|
}
|
|
644
648
|
```
|
|
645
649
|
|
|
646
|
-
<sub>`api.ogt` line
|
|
650
|
+
<sub>`api.ogt` line 2155</sub>
|
|
647
651
|
|
|
648
652
|
<a id="record-CameraRail"></a>
|
|
649
653
|
|
|
@@ -665,6 +669,7 @@ Token `og.CameraRail`, registered under the schema name `og.CameraRail`; its val
|
|
|
665
669
|
| `p6` | `Vector3` | `{ x: 0, y: 0, z: 0 }` | — | `m` | — | Rail point 6. |
|
|
666
670
|
| `p7` | `Vector3` | `{ x: 0, y: 0, z: 0 }` | — | `m` | — | Rail point 7. |
|
|
667
671
|
| `smoothTime` | `number` | `0.2` | ≥ 0 | `s` | tunable | Roughly how long the camera takes to catch up along the rail; 0 snaps. |
|
|
672
|
+
| `path` | `Path` | `0` | — | — | — | A path (og.path.create, or a scene's `path` by og.path.find) the rail follows instead of p0 to p(points - 1): any number of points, catmullRom, bezier or linear, closed or not. 0 uses the points. |
|
|
668
673
|
|
|
669
674
|
```ogt
|
|
670
675
|
component CameraRail {
|
|
@@ -705,7 +710,8 @@ component CameraRail {
|
|
|
705
710
|
unit s
|
|
706
711
|
tunable true
|
|
707
712
|
}
|
|
713
|
+
field path Path "A path (og.path.create, or a scene's `path` by og.path.find) the rail follows instead of p0 to p(points - 1): any number of points, catmullRom, bezier or linear, closed or not. 0 uses the points."
|
|
708
714
|
}
|
|
709
715
|
```
|
|
710
716
|
|
|
711
|
-
<sub>`api.ogt` line
|
|
717
|
+
<sub>`api.ogt` line 2171</sub>
|
|
@@ -18,7 +18,7 @@ module commands {
|
|
|
18
18
|
# declarations follow, each quoted below
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
<sub>`api.ogt` line
|
|
21
|
+
<sub>`api.ogt` line 12139</sub>
|
|
22
22
|
|
|
23
23
|
## Contents
|
|
24
24
|
|
|
@@ -67,7 +67,7 @@ fn register {
|
|
|
67
67
|
}
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
<sub>`api.ogt` line
|
|
70
|
+
<sub>`api.ogt` line 12218</sub>
|
|
71
71
|
|
|
72
72
|
<a id="fn-parse"></a>
|
|
73
73
|
|
|
@@ -95,7 +95,7 @@ fn parse {
|
|
|
95
95
|
}
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
<sub>`api.ogt` line
|
|
98
|
+
<sub>`api.ogt` line 12226</sub>
|
|
99
99
|
|
|
100
100
|
<a id="fn-help"></a>
|
|
101
101
|
|
|
@@ -123,7 +123,7 @@ fn help {
|
|
|
123
123
|
}
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
<sub>`api.ogt` line
|
|
126
|
+
<sub>`api.ogt` line 12232</sub>
|
|
127
127
|
|
|
128
128
|
<a id="fn-schedule"></a>
|
|
129
129
|
|
|
@@ -153,7 +153,7 @@ fn schedule {
|
|
|
153
153
|
}
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
<sub>`api.ogt` line
|
|
156
|
+
<sub>`api.ogt` line 12238</sub>
|
|
157
157
|
|
|
158
158
|
## Types
|
|
159
159
|
|
|
@@ -186,7 +186,7 @@ A string: one of the variants below. The zero value is `"screenshot"`.
|
|
|
186
186
|
| `"frame_entity"` | `frame_entity:<entity>`: point the camera at an entity. |
|
|
187
187
|
| `"dump_world"` | `dump_world[:path]`: tables, systems and their matched counts. |
|
|
188
188
|
| `"dump_entity"` | `dump_entity:<name>[:path]`: one entity's components and transform. |
|
|
189
|
-
| `"dump_ui"` | `dump_ui[:path]`: the UI tree with bounds. |
|
|
189
|
+
| `"dump_ui"` | `dump_ui[:path]`: the UI tree with bounds, and `style`, the configured UI style's name (empty for the placeholder prototype). |
|
|
190
190
|
| `"set"` | `set:<entity>.<component>.<field>=<value>` or `set:<Resource>.<field>=<value>`: a Tune write through the schema: a number, `true` or `false` for a bool, `x,y,z` for a vector, an enum's variant name or its index; refused outside the field's FieldOptions min/max, never clamped. |
|
|
191
191
|
| `"get"` | `get:<Resource>[.<field>]` or `get:<entity>[.<component>[.<field>]][:path]`: read through the schema as game code sees it (an enum as its variant's name, `"music"`; og.Time whole, with rate and the time scale; the DirectionalLight og.DayNight drives with the colour, intensity and direction it is drawn with), logged and written as JSON to `get-<tick>.json` (more unnamed ones on one tick: `get-<tick>-2.json`, ...). |
|
|
192
192
|
| `"seed"` | `seed:<n>`: reseed the Rng resource. |
|
|
@@ -194,6 +194,9 @@ A string: one of the variants below. The zero value is `"screenshot"`.
|
|
|
194
194
|
| `"resume"` | `resume`: release the clock. |
|
|
195
195
|
| `"advance"` | `advance:<ticks>`: take fixed steps. |
|
|
196
196
|
| `"quit"` | `quit`: exit. |
|
|
197
|
+
| `"describe"` | `describe[:path]`: write the frame as data (probe.Description): the visible entities with screen boxes, depth order and occlusion from the entity-id pass, what each secondary camera (og.CameraView, og.Mirror) shows from its own pass, the UI elements with rects and text, the camera. |
|
|
198
|
+
| `"expect"` | `expect:<what>`: assert at this tick (probe.ExpectResult): `entity:<id>:within:x,y,w,h` (its visible box, CSS pixels) or `:within:x0,y0,z0,x1,y1,z1` (its position, world units), `event:<Name>[:count]`, `ui:text:[=]<text>`, `region:x,y,w,h:color:#rrggbb[:tolerance]`, `frame:<ref.png>:rmse:<=v`, `state:<path>==<value>` (also != < <= > >=), `entity:<id>:<path>==<value>` (a field of its dump_entity: `render.lod==2`, `og.Transform.position.y>0`), `timings:<path>==<value>` (state().timings: `triangles<=1500000`). A failure is a warning with the tick and the observed value; `og run --json` lists every result and exits 1 on a failure. Frame expectations without a renderer are unchecked, as are an entity's `render.*` fields and the renderer's timings (`triangles`, `render`, `passes`). |
|
|
199
|
+
| `"save_scene"` | `save_scene[:path][:spawned]`: write every scene the world was assembled from back from the world (the boot scene's, then each og.world.instantiate made, each to its own `.ogt`): only the lines whose values changed (comments and order kept), the fields set or patch tuned, and resources as `resource <Name> { }` blocks; with `spawned`, the entities the game spawned at run time under the boot scene's marked section. To each scene's source, or with a path the boot scene's to that file under the output directory and the others beside it. |
|
|
197
200
|
| `"help"` | `help`: list every action the channel knows, core and registered. |
|
|
198
201
|
|
|
199
202
|
```ogt
|
|
@@ -218,7 +221,7 @@ enum CoreAction {
|
|
|
218
221
|
variant frame_entity "`frame_entity:<entity>`: point the camera at an entity."
|
|
219
222
|
variant dump_world "`dump_world[:path]`: tables, systems and their matched counts."
|
|
220
223
|
variant dump_entity "`dump_entity:<name>[:path]`: one entity's components and transform."
|
|
221
|
-
variant dump_ui "`dump_ui[:path]`: the UI tree with bounds."
|
|
224
|
+
variant dump_ui "`dump_ui[:path]`: the UI tree with bounds, and `style`, the configured UI style's name (empty for the placeholder prototype)."
|
|
222
225
|
variant set "`set:<entity>.<component>.<field>=<value>` or `set:<Resource>.<field>=<value>`: a Tune write through the schema: a number, `true` or `false` for a bool, `x,y,z` for a vector, an enum's variant name or its index; refused outside the field's FieldOptions min/max, never clamped."
|
|
223
226
|
variant get "`get:<Resource>[.<field>]` or `get:<entity>[.<component>[.<field>]][:path]`: read through the schema as game code sees it (an enum as its variant's name, `\"music\"`; og.Time whole, with rate and the time scale; the DirectionalLight og.DayNight drives with the colour, intensity and direction it is drawn with), logged and written as JSON to `get-<tick>.json` (more unnamed ones on one tick: `get-<tick>-2.json`, ...)."
|
|
224
227
|
variant seed "`seed:<n>`: reseed the Rng resource."
|
|
@@ -226,11 +229,14 @@ enum CoreAction {
|
|
|
226
229
|
variant resume "`resume`: release the clock."
|
|
227
230
|
variant advance "`advance:<ticks>`: take fixed steps."
|
|
228
231
|
variant quit "`quit`: exit."
|
|
232
|
+
variant describe "`describe[:path]`: write the frame as data (probe.Description): the visible entities with screen boxes, depth order and occlusion from the entity-id pass, what each secondary camera (og.CameraView, og.Mirror) shows from its own pass, the UI elements with rects and text, the camera."
|
|
233
|
+
variant expect "`expect:<what>`: assert at this tick (probe.ExpectResult): `entity:<id>:within:x,y,w,h` (its visible box, CSS pixels) or `:within:x0,y0,z0,x1,y1,z1` (its position, world units), `event:<Name>[:count]`, `ui:text:[=]<text>`, `region:x,y,w,h:color:#rrggbb[:tolerance]`, `frame:<ref.png>:rmse:<=v`, `state:<path>==<value>` (also != < <= > >=), `entity:<id>:<path>==<value>` (a field of its dump_entity: `render.lod==2`, `og.Transform.position.y>0`), `timings:<path>==<value>` (state().timings: `triangles<=1500000`). A failure is a warning with the tick and the observed value; `og run --json` lists every result and exits 1 on a failure. Frame expectations without a renderer are unchecked, as are an entity's `render.*` fields and the renderer's timings (`triangles`, `render`, `passes`)."
|
|
234
|
+
variant save_scene "`save_scene[:path][:spawned]`: write every scene the world was assembled from back from the world (the boot scene's, then each og.world.instantiate made, each to its own `.ogt`): only the lines whose values changed (comments and order kept), the fields set or patch tuned, and resources as `resource <Name> { }` blocks; with `spawned`, the entities the game spawned at run time under the boot scene's marked section. To each scene's source, or with a path the boot scene's to that file under the output directory and the others beside it."
|
|
229
235
|
variant help "`help`: list every action the channel knows, core and registered."
|
|
230
236
|
}
|
|
231
237
|
```
|
|
232
238
|
|
|
233
|
-
<sub>`api.ogt` line
|
|
239
|
+
<sub>`api.ogt` line 12146</sub>
|
|
234
240
|
|
|
235
241
|
<a id="type-CommandHandler"></a>
|
|
236
242
|
|
|
@@ -257,7 +263,7 @@ callback CommandHandler {
|
|
|
257
263
|
}
|
|
258
264
|
```
|
|
259
265
|
|
|
260
|
-
<sub>`api.ogt` line
|
|
266
|
+
<sub>`api.ogt` line 12181</sub>
|
|
261
267
|
|
|
262
268
|
<a id="type-CommandDesc"></a>
|
|
263
269
|
|
|
@@ -281,7 +287,7 @@ struct CommandDesc {
|
|
|
281
287
|
}
|
|
282
288
|
```
|
|
283
289
|
|
|
284
|
-
<sub>`api.ogt` line
|
|
290
|
+
<sub>`api.ogt` line 12187</sub>
|
|
285
291
|
|
|
286
292
|
<a id="type-CommandStep"></a>
|
|
287
293
|
|
|
@@ -306,7 +312,7 @@ struct CommandStep {
|
|
|
306
312
|
}
|
|
307
313
|
```
|
|
308
314
|
|
|
309
|
-
<sub>`api.ogt` line
|
|
315
|
+
<sub>`api.ogt` line 12194</sub>
|
|
310
316
|
|
|
311
317
|
<a id="type-CommandInfo"></a>
|
|
312
318
|
|
|
@@ -331,7 +337,7 @@ struct CommandInfo {
|
|
|
331
337
|
}
|
|
332
338
|
```
|
|
333
339
|
|
|
334
|
-
<sub>`api.ogt` line
|
|
340
|
+
<sub>`api.ogt` line 12203</sub>
|
|
335
341
|
|
|
336
342
|
<a id="type-CommandsReport"></a>
|
|
337
343
|
|
|
@@ -354,4 +360,4 @@ struct CommandsReport {
|
|
|
354
360
|
}
|
|
355
361
|
```
|
|
356
362
|
|
|
357
|
-
<sub>`api.ogt` line
|
|
363
|
+
<sub>`api.ogt` line 12211</sub>
|