@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,230 @@
|
|
|
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 `transform` module
|
|
4
|
+
|
|
5
|
+
Transforms in the three.js vocabulary: position, quaternion and scale, composed into matrixWorld down the parent chain.
|
|
6
|
+
|
|
7
|
+
- **TypeScript**: functions are the namespace `og.transform`; components, resources and events are tokens on `og`.
|
|
8
|
+
- **Publish builds**: kept (members may override).
|
|
9
|
+
- **Skill**: `og-game`, 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 transform {
|
|
14
|
+
# declarations follow, each quoted below
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
<sub>`api.ogt` line 521</sub>
|
|
18
|
+
|
|
19
|
+
## Contents
|
|
20
|
+
|
|
21
|
+
| Name | Kind | Summary |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| [`og.Transform`](#record-Transform) | component | Where an entity is, relative to its parent (or the world). |
|
|
24
|
+
| [`og.Parent`](#record-Parent) | component | The entity this one's Transform is relative to. Set by SpawnDesc.parent. |
|
|
25
|
+
| [`og.MatrixWorld`](#record-MatrixWorld) | component | The world matrix the engine composes after the systems run, as three.js Object3D.matrixWorld. |
|
|
26
|
+
| [`og.transform.compose`](#fn-compose) | function | A matrix from position, rotation and scale, as three.js Matrix4.compose. |
|
|
27
|
+
| [`og.transform.decompose`](#fn-decompose) | function | Position, rotation and scale from a matrix, as three.js Matrix4.decompose. |
|
|
28
|
+
| [`og.transform.lookAt`](#fn-lookAt) | function | The rotation that points -Z from an eye towards a target, as three.js Object3D.lookAt for cameras. |
|
|
29
|
+
| [`og.transform.fromAxisAngle`](#fn-fromAxisAngle) | function | A rotation about an axis, as three.js Quaternion.setFromAxisAngle. |
|
|
30
|
+
|
|
31
|
+
## Functions
|
|
32
|
+
|
|
33
|
+
<a id="fn-compose"></a>
|
|
34
|
+
|
|
35
|
+
### `og.transform.compose`
|
|
36
|
+
|
|
37
|
+
A matrix from position, rotation and scale, as three.js Matrix4.compose.
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
og.transform.compose(position: Vector3, quaternion: Quaternion, scale: Vector3): Matrix4
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| Parameter | Type | Optional | Doc |
|
|
44
|
+
|---|---|---|---|
|
|
45
|
+
| `position` | `Vector3` | no | The translation. |
|
|
46
|
+
| `quaternion` | `Quaternion` | no | The rotation. |
|
|
47
|
+
| `scale` | `Vector3` | no | The scale. |
|
|
48
|
+
|
|
49
|
+
**Returns** `Matrix4`.
|
|
50
|
+
|
|
51
|
+
Binding symbol `og_transform_compose` · publish builds: kept
|
|
52
|
+
|
|
53
|
+
```ogt
|
|
54
|
+
fn compose {
|
|
55
|
+
doc "A matrix from position, rotation and scale, as three.js Matrix4.compose."
|
|
56
|
+
param position Vector3 "The translation."
|
|
57
|
+
param quaternion Quaternion "The rotation."
|
|
58
|
+
param scale Vector3 "The scale."
|
|
59
|
+
returns Matrix4
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
<sub>`api.ogt` line 548</sub>
|
|
64
|
+
|
|
65
|
+
<a id="fn-decompose"></a>
|
|
66
|
+
|
|
67
|
+
### `og.transform.decompose`
|
|
68
|
+
|
|
69
|
+
Position, rotation and scale from a matrix, as three.js Matrix4.decompose.
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
og.transform.decompose(matrix: Matrix4): Transform
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
| Parameter | Type | Optional | Doc |
|
|
76
|
+
|---|---|---|---|
|
|
77
|
+
| `matrix` | `Matrix4` | no | An affine matrix. |
|
|
78
|
+
|
|
79
|
+
**Returns** `Transform`.
|
|
80
|
+
|
|
81
|
+
Binding symbol `og_transform_decompose` · publish builds: kept
|
|
82
|
+
|
|
83
|
+
```ogt
|
|
84
|
+
fn decompose {
|
|
85
|
+
doc "Position, rotation and scale from a matrix, as three.js Matrix4.decompose."
|
|
86
|
+
param matrix Matrix4 "An affine matrix."
|
|
87
|
+
returns Transform
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
<sub>`api.ogt` line 556</sub>
|
|
92
|
+
|
|
93
|
+
<a id="fn-lookAt"></a>
|
|
94
|
+
|
|
95
|
+
### `og.transform.lookAt`
|
|
96
|
+
|
|
97
|
+
The rotation that points -Z from an eye towards a target, as three.js Object3D.lookAt for cameras.
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
og.transform.lookAt(eye: Vector3, target: Vector3, up?: Vector3): Quaternion
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
| Parameter | Type | Optional | Doc |
|
|
104
|
+
|---|---|---|---|
|
|
105
|
+
| `eye` | `Vector3` | no | Where the viewer is. |
|
|
106
|
+
| `target` | `Vector3` | no | What it looks at. |
|
|
107
|
+
| `up` | `Vector3` | yes | The up direction; the zero vector means +Y. |
|
|
108
|
+
|
|
109
|
+
**Returns** `Quaternion`.
|
|
110
|
+
|
|
111
|
+
Binding symbol `og_transform_look_at` · publish builds: kept
|
|
112
|
+
|
|
113
|
+
```ogt
|
|
114
|
+
fn lookAt {
|
|
115
|
+
doc "The rotation that points -Z from an eye towards a target, as three.js Object3D.lookAt for cameras."
|
|
116
|
+
param eye Vector3 "Where the viewer is."
|
|
117
|
+
param target Vector3 "What it looks at."
|
|
118
|
+
param up Vector3 "The up direction; the zero vector means +Y." {
|
|
119
|
+
optional true
|
|
120
|
+
}
|
|
121
|
+
returns Quaternion
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
<sub>`api.ogt` line 562</sub>
|
|
126
|
+
|
|
127
|
+
<a id="fn-fromAxisAngle"></a>
|
|
128
|
+
|
|
129
|
+
### `og.transform.fromAxisAngle`
|
|
130
|
+
|
|
131
|
+
A rotation about an axis, as three.js Quaternion.setFromAxisAngle.
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
og.transform.fromAxisAngle(axis: Vector3, angle: number): Quaternion
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
| Parameter | Type | Optional | Doc |
|
|
138
|
+
|---|---|---|---|
|
|
139
|
+
| `axis` | `Vector3` | no | A unit axis. |
|
|
140
|
+
| `angle` | `number` | no | The angle in radians. |
|
|
141
|
+
|
|
142
|
+
**Returns** `Quaternion`.
|
|
143
|
+
|
|
144
|
+
Binding symbol `og_transform_from_axis_angle` · publish builds: kept
|
|
145
|
+
|
|
146
|
+
```ogt
|
|
147
|
+
fn fromAxisAngle {
|
|
148
|
+
doc "A rotation about an axis, as three.js Quaternion.setFromAxisAngle."
|
|
149
|
+
param axis Vector3 "A unit axis."
|
|
150
|
+
param angle f32 "The angle in radians."
|
|
151
|
+
returns Quaternion
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
<sub>`api.ogt` line 572</sub>
|
|
156
|
+
|
|
157
|
+
## Components, resources and events
|
|
158
|
+
|
|
159
|
+
<a id="record-Transform"></a>
|
|
160
|
+
|
|
161
|
+
### `og.Transform` (component)
|
|
162
|
+
|
|
163
|
+
Where an entity is, relative to its parent (or the world).
|
|
164
|
+
|
|
165
|
+
Token `og.Transform`, registered under the schema name `og.Transform`; its value type is `Transform`.
|
|
166
|
+
|
|
167
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
168
|
+
|---|---|---|---|---|---|---|
|
|
169
|
+
| `position` | `Vector3` | `{ x: 0, y: 0, z: 0 }` | — | `m` | — | The position, as three.js Object3D.position. |
|
|
170
|
+
| `quaternion` | `Quaternion` | `{ x: 0, y: 0, z: 0, w: 1 }` | — | — | — | The rotation, as three.js Object3D.quaternion. |
|
|
171
|
+
| `scale` | `Vector3` | `{ x: 1, y: 1, z: 1 }` | — | — | — | The scale, as three.js Object3D.scale. |
|
|
172
|
+
|
|
173
|
+
```ogt
|
|
174
|
+
component Transform {
|
|
175
|
+
doc "Where an entity is, relative to its parent (or the world)."
|
|
176
|
+
field position Vector3 "The position, as three.js Object3D.position." {
|
|
177
|
+
unit m
|
|
178
|
+
}
|
|
179
|
+
field quaternion Quaternion "The rotation, as three.js Object3D.quaternion."
|
|
180
|
+
field scale Vector3 "The scale, as three.js Object3D.scale." {
|
|
181
|
+
default 1 1 1
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
<sub>`api.ogt` line 525</sub>
|
|
187
|
+
|
|
188
|
+
<a id="record-Parent"></a>
|
|
189
|
+
|
|
190
|
+
### `og.Parent` (component)
|
|
191
|
+
|
|
192
|
+
The entity this one's Transform is relative to. Set by SpawnDesc.parent.
|
|
193
|
+
|
|
194
|
+
Token `og.Parent`, registered under the schema name `og.Parent`; its value type is `Parent`.
|
|
195
|
+
|
|
196
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
197
|
+
|---|---|---|---|---|---|---|
|
|
198
|
+
| `entity` | `Entity` | `0` | — | — | — | The parent. |
|
|
199
|
+
|
|
200
|
+
```ogt
|
|
201
|
+
component Parent {
|
|
202
|
+
doc "The entity this one's Transform is relative to. Set by SpawnDesc.parent."
|
|
203
|
+
field entity Entity "The parent."
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
<sub>`api.ogt` line 536</sub>
|
|
208
|
+
|
|
209
|
+
<a id="record-MatrixWorld"></a>
|
|
210
|
+
|
|
211
|
+
### `og.MatrixWorld` (component)
|
|
212
|
+
|
|
213
|
+
The world matrix the engine composes after the systems run, as three.js Object3D.matrixWorld.
|
|
214
|
+
|
|
215
|
+
Token `og.MatrixWorld`, registered under the schema name `og.MatrixWorld`; its value type is `MatrixWorld`.
|
|
216
|
+
|
|
217
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
218
|
+
|---|---|---|---|---|---|---|
|
|
219
|
+
| `matrix` | `Matrix4` | `{ elements: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] }` | — | — | read only | The composed world matrix. |
|
|
220
|
+
|
|
221
|
+
```ogt
|
|
222
|
+
component MatrixWorld {
|
|
223
|
+
doc "The world matrix the engine composes after the systems run, as three.js Object3D.matrixWorld."
|
|
224
|
+
field matrix Matrix4 "The composed world matrix." {
|
|
225
|
+
readonly true
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
<sub>`api.ogt` line 541</sub>
|