@origingame/engine 0.0.0-stage → 0.1.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 +25 -0
- package/dist/web/origin-engine.d.ts +1233 -0
- package/dist/web/origin-engine.js +8628 -0
- package/dist/web/origin-engine_bg.wasm +0 -0
- package/dist/web/origin-engine_bg.wasm.d.ts +366 -0
- package/dist/web-publish/origin-engine-lanes.js +8509 -0
- package/dist/web-publish/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish/origin-engine.d.ts +1176 -0
- package/dist/web-publish/origin-engine.js +8313 -0
- package/dist/web-publish/origin-engine_bg.wasm +0 -0
- package/dist/web-publish/origin-engine_bg.wasm.d.ts +347 -0
- package/dist/web-publish/snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.no-bundler.js +77 -0
- package/dist/web-publish-2d/origin-engine-lanes.js +8509 -0
- package/dist/web-publish-2d/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine.d.ts +1176 -0
- package/dist/web-publish-2d/origin-engine.js +8313 -0
- package/dist/web-publish-2d/origin-engine_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine_bg.wasm.d.ts +347 -0
- package/dist/web-publish-2d/snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.no-bundler.js +77 -0
- package/knowledge/README.md +31 -0
- package/knowledge/knowledge.json +13 -0
- package/knowledge/looks/catalogue.json +1871 -0
- package/knowledge/package.json +33 -0
- package/knowledge/rules/platform.json +329 -0
- package/knowledge/scaffold/README.md +27 -0
- package/knowledge/scaffold/distribution.json +48 -0
- package/knowledge/scaffold/origin-engine.json +19 -0
- package/knowledge/scaffold/template/.origin/setup +14 -0
- package/knowledge/scaffold/template/LICENSES.md +23 -0
- package/knowledge/scaffold/template/README.md +37 -0
- package/knowledge/scaffold/template/assets/ai/guard.ogt +48 -0
- package/knowledge/scaffold/template/assets/audio/click.ogt +9 -0
- package/knowledge/scaffold/template/assets/fonts/NotoSansSC-Regular-subset.ttf.ogt +12 -0
- package/knowledge/scaffold/template/assets/fonts/OFL.txt +93 -0
- package/knowledge/scaffold/template/assets/looks/origin-game.ogt +12 -0
- package/knowledge/scaffold/template/assets/nav/yard.ogt +27 -0
- package/knowledge/scaffold/template/assets/scenes/main.ogt +34 -0
- package/knowledge/scaffold/template/assets/strings/en.ogt +14 -0
- package/knowledge/scaffold/template/assets/textures/stone_n.png.ogt +7 -0
- package/knowledge/scaffold/template/gitattributes +22 -0
- package/knowledge/scaffold/template/package.json +18 -0
- package/knowledge/scaffold/template/project.ogt +25 -0
- package/knowledge/scaffold/template/src/main.ts +246 -0
- package/knowledge/scaffold/template/tests/guard.og.ts +67 -0
- package/knowledge/scaffold/template/tests/smoke.og.ts +43 -0
- package/knowledge/scaffold/template/tsconfig.json +17 -0
- package/knowledge/scripts/lib.ts +203 -0
- package/knowledge/scripts/mount.ts +210 -0
- package/knowledge/scripts/pack.ts +24 -0
- package/knowledge/scripts/scaffold.ts +72 -0
- package/knowledge/scripts/validate.ts +749 -0
- package/knowledge/skills/og-ai/SKILL.md +386 -0
- package/knowledge/skills/og-audio/SKILL.md +191 -0
- package/knowledge/skills/og-build/SKILL.md +330 -0
- package/knowledge/skills/og-core/SKILL.md +285 -0
- package/knowledge/skills/og-feel/SKILL.md +385 -0
- package/knowledge/skills/og-game/SKILL.md +1479 -0
- package/knowledge/skills/og-i18n/SKILL.md +220 -0
- package/knowledge/skills/og-platform-sdk/SKILL.md +199 -0
- package/knowledge/skills/og-taste/SKILL.md +537 -0
- package/knowledge/skills/og-ui/SKILL.md +444 -0
- package/knowledge/wiki/ai.md +627 -0
- package/knowledge/wiki/anim.md +1187 -0
- package/knowledge/wiki/atmosphere.md +636 -0
- package/knowledge/wiki/audio.md +732 -0
- package/knowledge/wiki/camera.md +711 -0
- package/knowledge/wiki/commands.md +357 -0
- package/knowledge/wiki/game.md +220 -0
- package/knowledge/wiki/i18n.md +213 -0
- package/knowledge/wiki/index.md +1027 -0
- package/knowledge/wiki/input.md +1714 -0
- package/knowledge/wiki/load.md +1280 -0
- package/knowledge/wiki/math.md +166 -0
- package/knowledge/wiki/nav.md +1154 -0
- package/knowledge/wiki/physics.md +3142 -0
- package/knowledge/wiki/platform.md +857 -0
- package/knowledge/wiki/probe.md +1692 -0
- package/knowledge/wiki/reflect.md +285 -0
- package/knowledge/wiki/render.md +3511 -0
- package/knowledge/wiki/rng.md +393 -0
- package/knowledge/wiki/stream.md +376 -0
- package/knowledge/wiki/system.md +197 -0
- package/knowledge/wiki/systems.md +43 -0
- package/knowledge/wiki/terrain.md +727 -0
- package/knowledge/wiki/tilemap.md +422 -0
- package/knowledge/wiki/time.md +150 -0
- package/knowledge/wiki/transform.md +230 -0
- package/knowledge/wiki/tween.md +580 -0
- package/knowledge/wiki/ui.md +8000 -0
- package/knowledge/wiki/world.md +909 -0
- package/package.json +68 -4
- package/schema/api.schema.json +29675 -0
- package/shell/README.md +22 -0
- package/shell/brand/README.md +23 -0
- package/shell/brand/icon-192.png +0 -0
- package/shell/brand/icon-512.png +0 -0
- package/shell/brand/mark-on-paper.svg +6 -0
- package/shell/brand/origin-mark.svg +5 -0
- package/shell/brand/origin-motion.css +251 -0
- package/shell/brand/tokens.css +20 -0
- package/shell/brand.ts +132 -0
- package/shell/page.ts +715 -0
- package/shell/platform.ts +203 -0
- package/shell/player.ts +238 -0
- package/shell/shell.css +185 -0
- package/shell/sw.ts +177 -0
- package/shell/transport.ts +515 -0
- package/shell/wire.ts +369 -0
- package/src/e6.ts +69 -0
- package/src/env.d.ts +100 -0
- package/src/generated/abi.ts +980 -0
- package/src/index.ts +193 -0
- package/src/node/audio.ts +86 -0
- package/src/node/build.ts +109 -0
- package/src/node/device.ts +981 -0
- package/src/node/doctor.ts +60 -0
- package/src/node/index.ts +102 -0
- package/src/node/platform.ts +24 -0
- package/src/node/playtest-run.ts +249 -0
- package/src/node/png.ts +130 -0
- package/src/node/polish.ts +976 -0
- package/src/node/run.ts +373 -0
- package/src/node/web-build.ts +808 -0
- package/src/p2.ts +35 -0
- package/src/platform-local.ts +211 -0
- package/src/playtest.ts +131 -0
- package/src/runtime.ts +1509 -0
- package/src/systems/cameras.ts +247 -0
- package/src/ui-kit/bind.ts +141 -0
- package/src/ui-kit/huds.ts +303 -0
- package/src/ui-kit/index.ts +36 -0
- package/src/ui-kit/menus.ts +187 -0
- package/src/ui-kit/settings.ts +131 -0
- package/src/ui-kit/store.ts +222 -0
- package/src/ui-kit/story.ts +89 -0
- package/src/ui-kit/util.ts +106 -0
- package/src/web/a11y.ts +429 -0
- package/src/web/audio-worklet.ts +193 -0
- package/src/web/audio.ts +307 -0
- package/src/web/basis.ts +239 -0
- package/src/web/gamepad.ts +123 -0
- package/src/web/host.ts +166 -0
- package/src/web/input.ts +237 -0
- package/src/web/lanes.ts +21 -0
- package/src/web/play.ts +20 -0
- package/src/web/rpc-ring.ts +110 -0
- package/src/web/settle.ts +122 -0
- package/src/web/shell.ts +643 -0
- package/src/web/text-input.ts +248 -0
- package/src/web/worker.ts +1002 -0
- package/types/bindings.json +13654 -0
- package/types/index.d.ts +20090 -0
- package/vendor/basis/LICENSE +201 -0
- package/vendor/basis/NOTICE +15 -0
- package/vendor/basis/README.md +18 -0
- package/vendor/basis/basis_transcoder.js +19 -0
- package/vendor/basis/basis_transcoder.wasm +0 -0
- package/README.md +0 -3
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<!-- Generated from crates/og-api/api.ogt by `og api gen`. Do not edit: `og api check` fails on any difference; change api.ogt and regenerate. -->
|
|
2
|
+
|
|
3
|
+
# The `math` module
|
|
4
|
+
|
|
5
|
+
Plain math values in the three.js vocabulary. They are data: the engine owns the operations, so results are identical on every host.
|
|
6
|
+
|
|
7
|
+
- **TypeScript**: functions are none at module level (its members live on the types below); components, resources and events are tokens on `og`.
|
|
8
|
+
- **Publish builds**: kept (members may override).
|
|
9
|
+
- **Skill**: `og-core`, which teaches the module (how much of it to use, and how to prove it).
|
|
10
|
+
- **Index**: [every module and name](index.md).
|
|
11
|
+
|
|
12
|
+
```ogt
|
|
13
|
+
module math {
|
|
14
|
+
# declarations follow, each quoted below
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
<sub>`api.ogt` line 35</sub>
|
|
18
|
+
|
|
19
|
+
## Contents
|
|
20
|
+
|
|
21
|
+
| Name | Kind | Summary |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| [`Vector2`](#type-Vector2) | struct | A 2D vector, as three.js Vector2. |
|
|
24
|
+
| [`Vector3`](#type-Vector3) | struct | A 3D vector, as three.js Vector3. The engine is right-handed with +Y up, as three.js. |
|
|
25
|
+
| [`Quaternion`](#type-Quaternion) | struct | A unit quaternion rotation, as three.js Quaternion. The zero value is the identity. |
|
|
26
|
+
| [`Matrix4`](#type-Matrix4) | struct | A 4x4 matrix, as three.js Matrix4: sixteen elements in column-major order. The zero value is the identity. |
|
|
27
|
+
| [`Color`](#type-Color) | struct | A linear RGB colour, as three.js Color with colour management on. Components are usually between 0 and 1; above 1 is HDR. |
|
|
28
|
+
| [`Ray`](#type-Ray) | struct | A ray, as three.js Ray. |
|
|
29
|
+
|
|
30
|
+
## Types
|
|
31
|
+
|
|
32
|
+
<a id="type-Vector2"></a>
|
|
33
|
+
|
|
34
|
+
### `Vector2` (struct)
|
|
35
|
+
|
|
36
|
+
A 2D vector, as three.js Vector2.
|
|
37
|
+
|
|
38
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
39
|
+
|---|---|---|---|---|---|---|
|
|
40
|
+
| `x` | `number` | `0` | — | — | — | The x component. |
|
|
41
|
+
| `y` | `number` | `0` | — | — | — | The y component. |
|
|
42
|
+
|
|
43
|
+
```ogt
|
|
44
|
+
struct Vector2 {
|
|
45
|
+
doc "A 2D vector, as three.js Vector2."
|
|
46
|
+
field x f32 "The x component."
|
|
47
|
+
field y f32 "The y component."
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
<sub>`api.ogt` line 40</sub>
|
|
52
|
+
|
|
53
|
+
<a id="type-Vector3"></a>
|
|
54
|
+
|
|
55
|
+
### `Vector3` (struct)
|
|
56
|
+
|
|
57
|
+
A 3D vector, as three.js Vector3. The engine is right-handed with +Y up, as three.js.
|
|
58
|
+
|
|
59
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
60
|
+
|---|---|---|---|---|---|---|
|
|
61
|
+
| `x` | `number` | `0` | — | — | — | The x component. |
|
|
62
|
+
| `y` | `number` | `0` | — | — | — | The y component. |
|
|
63
|
+
| `z` | `number` | `0` | — | — | — | The z component. |
|
|
64
|
+
|
|
65
|
+
```ogt
|
|
66
|
+
struct Vector3 {
|
|
67
|
+
doc "A 3D vector, as three.js Vector3. The engine is right-handed with +Y up, as three.js."
|
|
68
|
+
field x f32 "The x component."
|
|
69
|
+
field y f32 "The y component."
|
|
70
|
+
field z f32 "The z component."
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
<sub>`api.ogt` line 46</sub>
|
|
75
|
+
|
|
76
|
+
<a id="type-Quaternion"></a>
|
|
77
|
+
|
|
78
|
+
### `Quaternion` (struct)
|
|
79
|
+
|
|
80
|
+
A unit quaternion rotation, as three.js Quaternion. The zero value is the identity.
|
|
81
|
+
|
|
82
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
83
|
+
|---|---|---|---|---|---|---|
|
|
84
|
+
| `x` | `number` | `0` | — | — | — | The x component. |
|
|
85
|
+
| `y` | `number` | `0` | — | — | — | The y component. |
|
|
86
|
+
| `z` | `number` | `0` | — | — | — | The z component. |
|
|
87
|
+
| `w` | `number` | `1` | — | — | — | The w (scalar) component. |
|
|
88
|
+
|
|
89
|
+
```ogt
|
|
90
|
+
struct Quaternion {
|
|
91
|
+
doc "A unit quaternion rotation, as three.js Quaternion. The zero value is the identity."
|
|
92
|
+
field x f32 "The x component."
|
|
93
|
+
field y f32 "The y component."
|
|
94
|
+
field z f32 "The z component."
|
|
95
|
+
field w f32 "The w (scalar) component." {
|
|
96
|
+
default 1
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
<sub>`api.ogt` line 53</sub>
|
|
102
|
+
|
|
103
|
+
<a id="type-Matrix4"></a>
|
|
104
|
+
|
|
105
|
+
### `Matrix4` (struct)
|
|
106
|
+
|
|
107
|
+
A 4x4 matrix, as three.js Matrix4: sixteen elements in column-major order. The zero value is the identity.
|
|
108
|
+
|
|
109
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
110
|
+
|---|---|---|---|---|---|---|
|
|
111
|
+
| `elements` | `[number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]` | `[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]` | — | — | — | The elements, column-major, as three.js Matrix4.elements. |
|
|
112
|
+
|
|
113
|
+
```ogt
|
|
114
|
+
struct Matrix4 {
|
|
115
|
+
doc "A 4x4 matrix, as three.js Matrix4: sixteen elements in column-major order. The zero value is the identity."
|
|
116
|
+
field elements Array.f32.16 "The elements, column-major, as three.js Matrix4.elements." {
|
|
117
|
+
default 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
<sub>`api.ogt` line 63</sub>
|
|
123
|
+
|
|
124
|
+
<a id="type-Color"></a>
|
|
125
|
+
|
|
126
|
+
### `Color` (struct)
|
|
127
|
+
|
|
128
|
+
A linear RGB colour, as three.js Color with colour management on. Components are usually between 0 and 1; above 1 is HDR.
|
|
129
|
+
|
|
130
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
131
|
+
|---|---|---|---|---|---|---|
|
|
132
|
+
| `r` | `number` | `0` | — | — | — | The red component. |
|
|
133
|
+
| `g` | `number` | `0` | — | — | — | The green component. |
|
|
134
|
+
| `b` | `number` | `0` | — | — | — | The blue component. |
|
|
135
|
+
|
|
136
|
+
```ogt
|
|
137
|
+
struct Color {
|
|
138
|
+
doc "A linear RGB colour, as three.js Color with colour management on. Components are usually between 0 and 1; above 1 is HDR."
|
|
139
|
+
field r f32 "The red component."
|
|
140
|
+
field g f32 "The green component."
|
|
141
|
+
field b f32 "The blue component."
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
<sub>`api.ogt` line 70</sub>
|
|
146
|
+
|
|
147
|
+
<a id="type-Ray"></a>
|
|
148
|
+
|
|
149
|
+
### `Ray` (struct)
|
|
150
|
+
|
|
151
|
+
A ray, as three.js Ray.
|
|
152
|
+
|
|
153
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
154
|
+
|---|---|---|---|---|---|---|
|
|
155
|
+
| `origin` | `Vector3` | `{ x: 0, y: 0, z: 0 }` | — | — | — | Where the ray starts. |
|
|
156
|
+
| `direction` | `Vector3` | `{ x: 0, y: 0, z: 0 }` | — | — | — | The unit direction the ray points in. |
|
|
157
|
+
|
|
158
|
+
```ogt
|
|
159
|
+
struct Ray {
|
|
160
|
+
doc "A ray, as three.js Ray."
|
|
161
|
+
field origin Vector3 "Where the ray starts."
|
|
162
|
+
field direction Vector3 "The unit direction the ray points in."
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
<sub>`api.ogt` line 77</sub>
|