@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.
Files changed (158) hide show
  1. package/bin/og.mjs +25 -0
  2. package/dist/web/origin-engine.d.ts +1233 -0
  3. package/dist/web/origin-engine.js +8628 -0
  4. package/dist/web/origin-engine_bg.wasm +0 -0
  5. package/dist/web/origin-engine_bg.wasm.d.ts +366 -0
  6. package/dist/web-publish/origin-engine-lanes.js +8509 -0
  7. package/dist/web-publish/origin-engine-lanes_bg.wasm +0 -0
  8. package/dist/web-publish/origin-engine.d.ts +1176 -0
  9. package/dist/web-publish/origin-engine.js +8313 -0
  10. package/dist/web-publish/origin-engine_bg.wasm +0 -0
  11. package/dist/web-publish/origin-engine_bg.wasm.d.ts +347 -0
  12. package/dist/web-publish/snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.no-bundler.js +77 -0
  13. package/dist/web-publish-2d/origin-engine-lanes.js +8509 -0
  14. package/dist/web-publish-2d/origin-engine-lanes_bg.wasm +0 -0
  15. package/dist/web-publish-2d/origin-engine.d.ts +1176 -0
  16. package/dist/web-publish-2d/origin-engine.js +8313 -0
  17. package/dist/web-publish-2d/origin-engine_bg.wasm +0 -0
  18. package/dist/web-publish-2d/origin-engine_bg.wasm.d.ts +347 -0
  19. package/dist/web-publish-2d/snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.no-bundler.js +77 -0
  20. package/knowledge/README.md +31 -0
  21. package/knowledge/knowledge.json +13 -0
  22. package/knowledge/looks/catalogue.json +1871 -0
  23. package/knowledge/package.json +33 -0
  24. package/knowledge/rules/platform.json +329 -0
  25. package/knowledge/scaffold/README.md +27 -0
  26. package/knowledge/scaffold/distribution.json +48 -0
  27. package/knowledge/scaffold/origin-engine.json +19 -0
  28. package/knowledge/scaffold/template/.origin/setup +14 -0
  29. package/knowledge/scaffold/template/LICENSES.md +23 -0
  30. package/knowledge/scaffold/template/README.md +37 -0
  31. package/knowledge/scaffold/template/assets/ai/guard.ogt +48 -0
  32. package/knowledge/scaffold/template/assets/audio/click.ogt +9 -0
  33. package/knowledge/scaffold/template/assets/fonts/NotoSansSC-Regular-subset.ttf.ogt +12 -0
  34. package/knowledge/scaffold/template/assets/fonts/OFL.txt +93 -0
  35. package/knowledge/scaffold/template/assets/looks/origin-game.ogt +12 -0
  36. package/knowledge/scaffold/template/assets/nav/yard.ogt +27 -0
  37. package/knowledge/scaffold/template/assets/scenes/main.ogt +34 -0
  38. package/knowledge/scaffold/template/assets/strings/en.ogt +14 -0
  39. package/knowledge/scaffold/template/assets/textures/stone_n.png.ogt +7 -0
  40. package/knowledge/scaffold/template/gitattributes +22 -0
  41. package/knowledge/scaffold/template/package.json +18 -0
  42. package/knowledge/scaffold/template/project.ogt +25 -0
  43. package/knowledge/scaffold/template/src/main.ts +246 -0
  44. package/knowledge/scaffold/template/tests/guard.og.ts +67 -0
  45. package/knowledge/scaffold/template/tests/smoke.og.ts +43 -0
  46. package/knowledge/scaffold/template/tsconfig.json +17 -0
  47. package/knowledge/scripts/lib.ts +203 -0
  48. package/knowledge/scripts/mount.ts +210 -0
  49. package/knowledge/scripts/pack.ts +24 -0
  50. package/knowledge/scripts/scaffold.ts +72 -0
  51. package/knowledge/scripts/validate.ts +749 -0
  52. package/knowledge/skills/og-ai/SKILL.md +386 -0
  53. package/knowledge/skills/og-audio/SKILL.md +191 -0
  54. package/knowledge/skills/og-build/SKILL.md +330 -0
  55. package/knowledge/skills/og-core/SKILL.md +285 -0
  56. package/knowledge/skills/og-feel/SKILL.md +385 -0
  57. package/knowledge/skills/og-game/SKILL.md +1479 -0
  58. package/knowledge/skills/og-i18n/SKILL.md +220 -0
  59. package/knowledge/skills/og-platform-sdk/SKILL.md +199 -0
  60. package/knowledge/skills/og-taste/SKILL.md +537 -0
  61. package/knowledge/skills/og-ui/SKILL.md +444 -0
  62. package/knowledge/wiki/ai.md +627 -0
  63. package/knowledge/wiki/anim.md +1187 -0
  64. package/knowledge/wiki/atmosphere.md +636 -0
  65. package/knowledge/wiki/audio.md +732 -0
  66. package/knowledge/wiki/camera.md +711 -0
  67. package/knowledge/wiki/commands.md +357 -0
  68. package/knowledge/wiki/game.md +220 -0
  69. package/knowledge/wiki/i18n.md +213 -0
  70. package/knowledge/wiki/index.md +1027 -0
  71. package/knowledge/wiki/input.md +1714 -0
  72. package/knowledge/wiki/load.md +1280 -0
  73. package/knowledge/wiki/math.md +166 -0
  74. package/knowledge/wiki/nav.md +1154 -0
  75. package/knowledge/wiki/physics.md +3142 -0
  76. package/knowledge/wiki/platform.md +857 -0
  77. package/knowledge/wiki/probe.md +1692 -0
  78. package/knowledge/wiki/reflect.md +285 -0
  79. package/knowledge/wiki/render.md +3511 -0
  80. package/knowledge/wiki/rng.md +393 -0
  81. package/knowledge/wiki/stream.md +376 -0
  82. package/knowledge/wiki/system.md +197 -0
  83. package/knowledge/wiki/systems.md +43 -0
  84. package/knowledge/wiki/terrain.md +727 -0
  85. package/knowledge/wiki/tilemap.md +422 -0
  86. package/knowledge/wiki/time.md +150 -0
  87. package/knowledge/wiki/transform.md +230 -0
  88. package/knowledge/wiki/tween.md +580 -0
  89. package/knowledge/wiki/ui.md +8000 -0
  90. package/knowledge/wiki/world.md +909 -0
  91. package/package.json +68 -4
  92. package/schema/api.schema.json +29675 -0
  93. package/shell/README.md +22 -0
  94. package/shell/brand/README.md +23 -0
  95. package/shell/brand/icon-192.png +0 -0
  96. package/shell/brand/icon-512.png +0 -0
  97. package/shell/brand/mark-on-paper.svg +6 -0
  98. package/shell/brand/origin-mark.svg +5 -0
  99. package/shell/brand/origin-motion.css +251 -0
  100. package/shell/brand/tokens.css +20 -0
  101. package/shell/brand.ts +132 -0
  102. package/shell/page.ts +715 -0
  103. package/shell/platform.ts +203 -0
  104. package/shell/player.ts +238 -0
  105. package/shell/shell.css +185 -0
  106. package/shell/sw.ts +177 -0
  107. package/shell/transport.ts +515 -0
  108. package/shell/wire.ts +369 -0
  109. package/src/e6.ts +69 -0
  110. package/src/env.d.ts +100 -0
  111. package/src/generated/abi.ts +980 -0
  112. package/src/index.ts +193 -0
  113. package/src/node/audio.ts +86 -0
  114. package/src/node/build.ts +109 -0
  115. package/src/node/device.ts +981 -0
  116. package/src/node/doctor.ts +60 -0
  117. package/src/node/index.ts +102 -0
  118. package/src/node/platform.ts +24 -0
  119. package/src/node/playtest-run.ts +249 -0
  120. package/src/node/png.ts +130 -0
  121. package/src/node/polish.ts +976 -0
  122. package/src/node/run.ts +373 -0
  123. package/src/node/web-build.ts +808 -0
  124. package/src/p2.ts +35 -0
  125. package/src/platform-local.ts +211 -0
  126. package/src/playtest.ts +131 -0
  127. package/src/runtime.ts +1509 -0
  128. package/src/systems/cameras.ts +247 -0
  129. package/src/ui-kit/bind.ts +141 -0
  130. package/src/ui-kit/huds.ts +303 -0
  131. package/src/ui-kit/index.ts +36 -0
  132. package/src/ui-kit/menus.ts +187 -0
  133. package/src/ui-kit/settings.ts +131 -0
  134. package/src/ui-kit/store.ts +222 -0
  135. package/src/ui-kit/story.ts +89 -0
  136. package/src/ui-kit/util.ts +106 -0
  137. package/src/web/a11y.ts +429 -0
  138. package/src/web/audio-worklet.ts +193 -0
  139. package/src/web/audio.ts +307 -0
  140. package/src/web/basis.ts +239 -0
  141. package/src/web/gamepad.ts +123 -0
  142. package/src/web/host.ts +166 -0
  143. package/src/web/input.ts +237 -0
  144. package/src/web/lanes.ts +21 -0
  145. package/src/web/play.ts +20 -0
  146. package/src/web/rpc-ring.ts +110 -0
  147. package/src/web/settle.ts +122 -0
  148. package/src/web/shell.ts +643 -0
  149. package/src/web/text-input.ts +248 -0
  150. package/src/web/worker.ts +1002 -0
  151. package/types/bindings.json +13654 -0
  152. package/types/index.d.ts +20090 -0
  153. package/vendor/basis/LICENSE +201 -0
  154. package/vendor/basis/NOTICE +15 -0
  155. package/vendor/basis/README.md +18 -0
  156. package/vendor/basis/basis_transcoder.js +19 -0
  157. package/vendor/basis/basis_transcoder.wasm +0 -0
  158. 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>