@flighthq/scene3d 0.2.1-next.840.857425c

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 (75) hide show
  1. package/dist/billboard.d.ts +8 -0
  2. package/dist/billboard.d.ts.map +1 -0
  3. package/dist/billboard.js +41 -0
  4. package/dist/billboard.js.map +1 -0
  5. package/dist/billboardCamera.d.ts +4 -0
  6. package/dist/billboardCamera.d.ts.map +1 -0
  7. package/dist/billboardCamera.js +238 -0
  8. package/dist/billboardCamera.js.map +1 -0
  9. package/dist/index.d.ts +15 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +15 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/mesh.d.ts +10 -0
  14. package/dist/mesh.d.ts.map +1 -0
  15. package/dist/mesh.js +75 -0
  16. package/dist/mesh.js.map +1 -0
  17. package/dist/prepareScene3DMorph.d.ts +3 -0
  18. package/dist/prepareScene3DMorph.d.ts.map +1 -0
  19. package/dist/prepareScene3DMorph.js +34 -0
  20. package/dist/prepareScene3DMorph.js.map +1 -0
  21. package/dist/scene.d.ts +3 -0
  22. package/dist/scene.d.ts.map +1 -0
  23. package/dist/scene.js +12 -0
  24. package/dist/scene.js.map +1 -0
  25. package/dist/sceneAnimation.d.ts +3 -0
  26. package/dist/sceneAnimation.d.ts.map +1 -0
  27. package/dist/sceneAnimation.js +43 -0
  28. package/dist/sceneAnimation.js.map +1 -0
  29. package/dist/sceneDocument.d.ts +4 -0
  30. package/dist/sceneDocument.d.ts.map +1 -0
  31. package/dist/sceneDocument.js +163 -0
  32. package/dist/sceneDocument.js.map +1 -0
  33. package/dist/sceneMaterial.d.ts +4 -0
  34. package/dist/sceneMaterial.d.ts.map +1 -0
  35. package/dist/sceneMaterial.js +58 -0
  36. package/dist/sceneMaterial.js.map +1 -0
  37. package/dist/sceneNode.d.ts +8 -0
  38. package/dist/sceneNode.d.ts.map +1 -0
  39. package/dist/sceneNode.js +29 -0
  40. package/dist/sceneNode.js.map +1 -0
  41. package/dist/sceneNodeAppearance.d.ts +5 -0
  42. package/dist/sceneNodeAppearance.d.ts.map +1 -0
  43. package/dist/sceneNodeAppearance.js +50 -0
  44. package/dist/sceneNodeAppearance.js.map +1 -0
  45. package/dist/sceneNodeBounds.d.ts +3 -0
  46. package/dist/sceneNodeBounds.d.ts.map +1 -0
  47. package/dist/sceneNodeBounds.js +49 -0
  48. package/dist/sceneNodeBounds.js.map +1 -0
  49. package/dist/sceneNodeCulling.d.ts +4 -0
  50. package/dist/sceneNodeCulling.d.ts.map +1 -0
  51. package/dist/sceneNodeCulling.js +62 -0
  52. package/dist/sceneNodeCulling.js.map +1 -0
  53. package/dist/sceneNodeDispose.d.ts +3 -0
  54. package/dist/sceneNodeDispose.d.ts.map +1 -0
  55. package/dist/sceneNodeDispose.js +15 -0
  56. package/dist/sceneNodeDispose.js.map +1 -0
  57. package/dist/sceneNodeTransform.d.ts +3 -0
  58. package/dist/sceneNodeTransform.d.ts.map +1 -0
  59. package/dist/sceneNodeTransform.js +65 -0
  60. package/dist/sceneNodeTransform.js.map +1 -0
  61. package/package.json +49 -0
  62. package/src/billboard.test.ts +79 -0
  63. package/src/billboardCamera.test.ts +152 -0
  64. package/src/mesh.test.ts +247 -0
  65. package/src/prepareScene3DMorph.test.ts +68 -0
  66. package/src/scene.test.ts +53 -0
  67. package/src/sceneAnimation.test.ts +109 -0
  68. package/src/sceneDocument.test.ts +173 -0
  69. package/src/sceneMaterial.test.ts +95 -0
  70. package/src/sceneNode.test.ts +291 -0
  71. package/src/sceneNodeAppearance.test.ts +80 -0
  72. package/src/sceneNodeBounds.test.ts +86 -0
  73. package/src/sceneNodeCulling.test.ts +123 -0
  74. package/src/sceneNodeDispose.test.ts +38 -0
  75. package/src/sceneNodeTransform.test.ts +40 -0
@@ -0,0 +1,8 @@
1
+ import type { Billboard, BillboardMode, BillboardRuntime, Kind, Material, MeshGeometry, NodeSignals, Node3D } from '@flighthq/types';
2
+ export { BillboardKind } from '@flighthq/types';
3
+ export declare function createBillboard(geometry: MeshGeometry, materials: (Material | null)[], mode?: BillboardMode, kind?: Kind, obj?: Readonly<Partial<Pick<Billboard, 'enabled' | 'name'>>>): Billboard;
4
+ export declare function enableBillboardSignals(source: Billboard): NodeSignals;
5
+ export declare function getBillboardRuntime(source: Readonly<Billboard>): BillboardRuntime;
6
+ export declare function getBillboardSignals(source: Billboard): NodeSignals | null;
7
+ export declare function isBillboard(source: Readonly<Node3D>): source is Billboard;
8
+ //# sourceMappingURL=billboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billboard.d.ts","sourceRoot":"","sources":["../src/billboard.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,MAAM,EACP,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAehD,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,EAC9B,IAAI,GAAE,aAAsB,EAC5B,IAAI,GAAE,IAAoB,EAC1B,GAAG,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,GAC3D,SAAS,CAMX;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,WAAW,CAErE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,gBAAgB,CAEjF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,IAAI,CAEzE;AAKD,wBAAgB,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,IAAI,SAAS,CAGzE"}
@@ -0,0 +1,41 @@
1
+ import { enableNodeSignals, getNodeSignals } from '@flighthq/node';
2
+ import { BillboardKind } from '@flighthq/types';
3
+ import { createNode3D, getNode3DRuntime } from './sceneNode';
4
+ export { BillboardKind } from '@flighthq/types';
5
+ // Allocates a camera-facing Billboard node: a Node3D (so it shares the scene hierarchy with mesh
6
+ // and group nodes) carrying `geometry`, one `materials` entry per geometry subset (positional; a
7
+ // missing or null slot resolves to DefaultMaterialKind at draw time), and a facing `mode`. Because a
8
+ // Billboard carries geometry it is structurally a drawable leaf (isMesh) and is drawn by the same
9
+ // per-material mesh renderers as a Mesh on every backend — the only billboard-specific step is the
10
+ // per-frame facing pass (orientBillboardToCamera / orientScene3DBillboardsToCamera), which rewrites
11
+ // the node's transform so its local axes face the camera before drawing.
12
+ //
13
+ // Facing convention: the geometry is authored in the local XY plane facing local +Z. The facing pass
14
+ // orients local +X to screen-right, local +Y to screen-up, and local +Z toward the camera. `geometry`
15
+ // and `materials` are stored by reference, not copied. The node starts with an identity localMatrix
16
+ // (unit scale at the origin) until placed and oriented; its authored position and scale are the world
17
+ // translation and scale the facing pass preserves.
18
+ export function createBillboard(geometry, materials, mode = 'full', kind = BillboardKind, obj) {
19
+ const billboard = createNode3D(kind, obj);
20
+ billboard.geometry = geometry;
21
+ billboard.materials = materials;
22
+ billboard.mode = mode;
23
+ return billboard;
24
+ }
25
+ export function enableBillboardSignals(source) {
26
+ return enableNodeSignals(source);
27
+ }
28
+ export function getBillboardRuntime(source) {
29
+ return getNode3DRuntime(source);
30
+ }
31
+ export function getBillboardSignals(source) {
32
+ return getNodeSignals(source);
33
+ }
34
+ // A node is a Billboard — a camera-facing drawable — when it carries both geometry (making it a
35
+ // drawable leaf) and a facing `mode`. Structural, so it holds for Billboards created with a custom
36
+ // kind, not just BillboardKind, and distinguishes a Billboard from a plain Mesh (geometry, no mode).
37
+ export function isBillboard(source) {
38
+ const candidate = source;
39
+ return candidate.geometry != null && candidate.mode != null;
40
+ }
41
+ //# sourceM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AAS,GAAG,MAA4B,CAAC;IAC/C,OAAO,SAAS,CAAC,QAAQ,IAAI,IAAI,IAAI,SAAS,CAAC,IAAI,IAAI,IAAI,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Billboard, Camera3D, Node3D } from '@flighthq/types';
2
+ export declare function orientBillboardToCamera(billboard: Billboard, camera: Readonly<Camera3D>): void;
3
+ export declare function orientScene3DBillboardsToCamera(scene: Readonly<Node3D>, camera: Readonly<Camera3D>): void;
4
+ //# sourceMappingURL=billboardCamera.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billboardCamera.d.ts","sourceRoot":"","sources":["../src/billboardCamera.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAiB,QAAQ,EAAW,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAc3F,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAG9F;AAOD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAGzG"}
@@ -0,0 +1,238 @@
1
+ import { copyMatrix4, createMatrix4, createQuaternion, createVector3, decomposeMatrix4, inverseMatrix4, multiplyMatrix4, } from '@flighthq/geometry';
2
+ import { getNodeParent, getNodeWorldMatrix4, setNodeLocalMatrix4 } from '@flighthq/node';
3
+ import { isBillboard } from './billboard';
4
+ import { getNode3DRuntime } from './sceneNode';
5
+ // Orients a single Billboard to face `camera`, rewriting its localMatrix so that after the scene's
6
+ // world transforms resolve, the billboard's world axes face the camera per its `mode`. The
7
+ // billboard's world position and world scale are preserved (read from its current world matrix); only
8
+ // the rotation is replaced. The result is backend-agnostic: the billboard then draws through the same
9
+ // per-material mesh renderers as any Mesh, on every backend, with no billboard-specific draw path.
10
+ //
11
+ // Call once per frame per billboard after the camera's view matrix is set and before drawing. For a
12
+ // whole subtree, orientScene3DBillboardsToCamera walks and orients every Billboard in one pass, deriving
13
+ // the camera basis a single time.
14
+ export function orientBillboardToCamera(billboard, camera) {
15
+ setBillboardCameraBasis(camera);
16
+ applyBillboardFacing(billboard);
17
+ }
18
+ // Orients every Billboard in the subtree rooted at `scene` to face `camera` in one pass. Non-billboard
19
+ // nodes are skipped (but still traversed, so billboards nested under group/mesh nodes are found). The
20
+ // camera basis is derived once and reused across every billboard. Parents are oriented before their
21
+ // descendants (top-down), so a billboard nested under another billboard sees its parent's updated
22
+ // transform.
23
+ export function orientScene3DBillboardsToCamera(scene, camera) {
24
+ setBillboardCameraBasis(camera);
25
+ orientBillboardSubtree(scene);
26
+ }
27
+ // Rewrites `billboard.localMatrix` from the module-scratch camera basis (set by setBillboardCameraBasis)
28
+ // so the billboard's world transform faces the camera. Reads the billboard's current world matrix for
29
+ // its world position and scale, builds the facing world matrix, then converts it back through the
30
+ // parent's inverse world transform into a local matrix (identity parent when the billboard is a root).
31
+ function applyBillboardFacing(billboard) {
32
+ const world = getNodeWorldMatrix4(billboard);
33
+ decomposeMatrix4(_position, _rotationScratch, _scale, world);
34
+ writeBillboardFacingMatrix(_facingWorld, billboard.mode);
35
+ const parent = getNodeParent(billboard);
36
+ if (parent === null) {
37
+ copyMatrix4(_localScratch, _facingWorld);
38
+ }
39
+ else {
40
+ const parentWorld = getNodeWorldMatrix4(parent);
41
+ if (inverseMatrix4(_inverseParentWorld, parentWorld)) {
42
+ multiplyMatrix4(_localScratch, _inverseParentWorld, _facingWorld);
43
+ }
44
+ else {
45
+ // Degenerate (non-invertible) parent world: fall back to treating the facing matrix as local.
46
+ copyMatrix4(_localScratch, _facingWorld);
47
+ }
48
+ }
49
+ // A billboard orients by a computed matrix, not TRS, so author it directly (leaves the node detached).
50
+ setNodeLocalMatrix4(billboard, _localScratch);
51
+ }
52
+ function orientBillboardSubtree(node) {
53
+ if (isBillboard(node)) {
54
+ applyBillboardFacing(node);
55
+ }
56
+ const children = getNode3DRuntime(node).children;
57
+ if (children !== null) {
58
+ for (let i = 0; i < children.length; i++) {
59
+ orientBillboardSubtree(children[i]);
60
+ }
61
+ }
62
+ }
63
+ // Derives the camera's world-space eye position and orthonormal right/up/back basis from its view
64
+ // matrix (view is world->view; its inverse is the camera's world transform) into module scratch. The
65
+ // basis vectors are normalized so a camera with a scaled view still yields a rotation-only billboard
66
+ // basis. `_back` is the camera's +Z world axis (toward the viewer), which is the facing normal a
67
+ // screen-aligned billboard adopts.
68
+ function setBillboardCameraBasis(camera) {
69
+ inverseMatrix4(_cameraWorld, camera.view);
70
+ const m = _cameraWorld.m;
71
+ _cameraEyeX = m[12];
72
+ _cameraEyeY = m[13];
73
+ _cameraEyeZ = m[14];
74
+ _cameraRightX = m[0];
75
+ _cameraRightY = m[1];
76
+ _cameraRightZ = m[2];
77
+ _cameraUpX = m[4];
78
+ _cameraUpY = m[5];
79
+ _cameraUpZ = m[6];
80
+ _cameraBackX = m[8];
81
+ _cameraBackY = m[9];
82
+ _cameraBackZ = m[10];
83
+ const rl = Math.hypot(_cameraRightX, _cameraRightY, _cameraRightZ) || 1;
84
+ _cameraRightX /= rl;
85
+ _cameraRightY /= rl;
86
+ _cameraRightZ /= rl;
87
+ const ul = Math.hypot(_cameraUpX, _cameraUpY, _cameraUpZ) || 1;
88
+ _cameraUpX /= ul;
89
+ _cameraUpY /= ul;
90
+ _cameraUpZ /= ul;
91
+ const bl = Math.hypot(_cameraBackX, _cameraBackY, _cameraBackZ) || 1;
92
+ _cameraBackX /= bl;
93
+ _cameraBackY /= bl;
94
+ _cameraBackZ /= bl;
95
+ }
96
+ // Writes a camera-facing world matrix into `out` from the module-scratch camera basis, the billboard's
97
+ // world position (`_position`) and scale (`_scale`), and its facing `mode`. Local +X maps to the
98
+ // billboard's right axis, +Y to its up axis, and +Z to its facing normal (toward the camera):
99
+ // - 'full' spherical: normal points at the camera eye, up derived from the camera's up.
100
+ // - 'axisY' cylindrical: yaws about world +Y to face the camera horizontally, staying upright.
101
+ // - 'screenAligned' planar: adopts the camera's right/up/back basis, so every billboard is coplanar
102
+ // with the view plane regardless of position.
103
+ function writeBillboardFacingMatrix(out, mode) {
104
+ const px = _position.x;
105
+ const py = _position.y;
106
+ const pz = _position.z;
107
+ const sx = _scale.x;
108
+ const sy = _scale.y;
109
+ const sz = _scale.z;
110
+ let rx;
111
+ let ry;
112
+ let rz;
113
+ let ux;
114
+ let uy;
115
+ let uz;
116
+ let nx;
117
+ let ny;
118
+ let nz;
119
+ if (mode === 'screenAligned') {
120
+ rx = _cameraRightX;
121
+ ry = _cameraRightY;
122
+ rz = _cameraRightZ;
123
+ ux = _cameraUpX;
124
+ uy = _cameraUpY;
125
+ uz = _cameraUpZ;
126
+ nx = _cameraBackX;
127
+ ny = _cameraBackY;
128
+ nz = _cameraBackZ;
129
+ }
130
+ else if (mode === 'axisY') {
131
+ // Face the camera horizontally: normal is the eye direction projected onto the world XZ plane,
132
+ // up is locked to world +Y so the billboard never tilts.
133
+ let dx = _cameraEyeX - px;
134
+ let dz = _cameraEyeZ - pz;
135
+ let dl = Math.hypot(dx, dz);
136
+ if (dl < FACING_EPSILON) {
137
+ // Camera3D is directly above/below: fall back to the camera back-axis projected onto XZ.
138
+ dx = _cameraBackX;
139
+ dz = _cameraBackZ;
140
+ dl = Math.hypot(dx, dz);
141
+ if (dl < FACING_EPSILON) {
142
+ dx = 0;
143
+ dz = 1;
144
+ dl = 1;
145
+ }
146
+ }
147
+ nx = dx / dl;
148
+ ny = 0;
149
+ nz = dz / dl;
150
+ // right = up x normal = (0,1,0) x (nx,0,nz) = (nz, 0, -nx).
151
+ rx = nz;
152
+ ry = 0;
153
+ rz = -nx;
154
+ ux = 0;
155
+ uy = 1;
156
+ uz = 0;
157
+ }
158
+ else {
159
+ // 'full' spherical: normal points from the billboard toward the camera eye.
160
+ let dnx = _cameraEyeX - px;
161
+ let dny = _cameraEyeY - py;
162
+ let dnz = _cameraEyeZ - pz;
163
+ let dnl = Math.hypot(dnx, dny, dnz);
164
+ if (dnl < FACING_EPSILON) {
165
+ dnx = _cameraBackX;
166
+ dny = _cameraBackY;
167
+ dnz = _cameraBackZ;
168
+ dnl = Math.hypot(dnx, dny, dnz) || 1;
169
+ }
170
+ nx = dnx / dnl;
171
+ ny = dny / dnl;
172
+ nz = dnz / dnl;
173
+ // right = normalize(cameraUp x normal).
174
+ rx = _cameraUpY * nz - _cameraUpZ * ny;
175
+ ry = _cameraUpZ * nx - _cameraUpX * nz;
176
+ rz = _cameraUpX * ny - _cameraUpY * nx;
177
+ let rl = Math.hypot(rx, ry, rz);
178
+ if (rl < FACING_EPSILON) {
179
+ // cameraUp parallel to normal: derive right from the camera right axis, orthogonalized to normal.
180
+ const d = _cameraRightX * nx + _cameraRightY * ny + _cameraRightZ * nz;
181
+ rx = _cameraRightX - d * nx;
182
+ ry = _cameraRightY - d * ny;
183
+ rz = _cameraRightZ - d * nz;
184
+ rl = Math.hypot(rx, ry, rz);
185
+ if (rl < FACING_EPSILON) {
186
+ rx = 1;
187
+ ry = 0;
188
+ rz = 0;
189
+ rl = 1;
190
+ }
191
+ }
192
+ rx /= rl;
193
+ ry /= rl;
194
+ rz /= rl;
195
+ // up = normal x right (already orthonormal).
196
+ ux = ny * rz - nz * ry;
197
+ uy = nz * rx - nx * rz;
198
+ uz = nx * ry - ny * rx;
199
+ }
200
+ const m = out.m;
201
+ m[0] = rx * sx;
202
+ m[1] = ry * sx;
203
+ m[2] = rz * sx;
204
+ m[3] = 0;
205
+ m[4] = ux * sy;
206
+ m[5] = uy * sy;
207
+ m[6] = uz * sy;
208
+ m[7] = 0;
209
+ m[8] = nx * sz;
210
+ m[9] = ny * sz;
211
+ m[10] = nz * sz;
212
+ m[11] = 0;
213
+ m[12] = px;
214
+ m[13] = py;
215
+ m[14] = pz;
216
+ m[15] = 1;
217
+ }
218
+ const FACING_EPSILON = 1e-6;
219
+ const _cameraWorld = createMatrix4();
220
+ const _inverseParentWorld = createMatrix4();
221
+ const _facingWorld = createMatrix4();
222
+ const _localScratch = createMatrix4();
223
+ const _position = createVector3();
224
+ const _scale = createVector3();
225
+ const _rotationScratch = createQuaternion(0, 0, 0, 1);
226
+ let _cameraEyeX = 0;
227
+ let _cameraEyeY = 0;
228
+ let _cameraEyeZ = 0;
229
+ let _cameraRightX = 1;
230
+ let _cameraRightY = 0;
231
+ let _cameraRightZ = 0;
232
+ let _cameraUpX = 0;
233
+ let _cameraUpY = 1;
234
+ let _cameraUpZ = 0;
235
+ let _cameraBackX = 0;
236
+ let _cameraBackY = 0;
237
+ let _cameraBackZ = 1;
238
+ //# sourceMappingURL=billboardCamera.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billboardCamera.js","sourceRoot":"","sources":["../src/billboardCamera.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGzF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,mGAAmG;AACnG,2FAA2F;AAC3F,sGAAsG;AACtG,sGAAsG;AACtG,mGAAmG;AACnG,EAAE;AACF,oGAAoG;AACpG,yGAAyG;AACzG,kCAAkC;AAClC,MAAM,UAAU,uBAAuB,CAAC,SAAoB,EAAE,MAA0B;IACtF,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAChC,oBAAoB,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,uGAAuG;AACvG,sGAAsG;AACtG,oGAAoG;AACpG,kGAAkG;AAClG,aAAa;AACb,MAAM,UAAU,+BAA+B,CAAC,KAAuB,EAAE,MAA0B;IACjG,uBAAuB,CAAC,MAAM,CAAC,CAA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,GAAG,aAAa,EAAE,CAAC;AACrC,MAAM,mBAAmB,GAAG,aAAa,EAAE,CAAC;AAC5C,MAAM,YAAY,GAAG,aAAa,EAAE,CAAC;AACrC,MAAM,aAAa,GAAG,aAAa,EAAE,CAAC;AACtC,MAAM,SAAS,GAAG,aAAa,EAAE,CAAC;AAClC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;AAC/B,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAEtD,IAAI,WAAW,GAAG,CAAC,CAAC;AACpB,IAAI,WAAW,GAAG,CAAC,CAAC;AACpB,IAAI,WAAW,GAAG,CAAC,CAAC;AACpB,IAAI,aAAa,GAAG,CAAC,CAAC;AACtB,IAAI,aAAa,GAAG,CAAC,CAAC;AACtB,IAAI,aAAa,GAAG,CAAC,CAAC;AACtB,IAAI,UAAU,GAAG,CAAC,CAAC;AACnB,IAAI,UAAU,GAAG,CAAC,CAAC;AACnB,IAAI,UAAU,GAAG,CAAC,CAAC;AACnB,IAAI,YAAY,GAAG,CAAC,CAAC;AACrB,IAAI,YAAY,GAAG,CAAC,CAAC;AACrB,IAAI,YAAY,GAAG,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ export * from './billboard';
2
+ export * from './billboardCamera';
3
+ export * from './mesh';
4
+ export * from './prepareScene3DMorph';
5
+ export * from './scene';
6
+ export * from './sceneAnimation';
7
+ export * from './sceneDocument';
8
+ export * from './sceneMaterial';
9
+ export * from './sceneNode';
10
+ export * from './sceneNodeAppearance';
11
+ export * from './sceneNodeBounds';
12
+ export * from './sceneNodeCulling';
13
+ export * from './sceneNodeDispose';
14
+ export * from './sceneNodeTransform';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ export * from './billboard';
2
+ export * from './billboardCamera';
3
+ export * from './mesh';
4
+ export * from './prepareScene3DMorph';
5
+ export * from './scene';
6
+ export * from './sceneAnimation';
7
+ export * from './sceneDocument';
8
+ export * from './sceneMaterial';
9
+ export * from './sceneNode';
10
+ export * from './sceneNodeAppearance';
11
+ export * from './sceneNodeBounds';
12
+ export * from './sceneNodeCulling';
13
+ export * from './sceneNodeDispose';
14
+ export * from './sceneNodeTransform';
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
package/dist/mesh.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import type { Kind, Material, Mesh, MeshDeformer, MeshGeometry, MeshRuntime, NodeSignals } from '@flighthq/types';
2
+ export { MeshKind } from '@flighthq/types';
3
+ export declare function cloneMesh(source: Readonly<Mesh>): Mesh;
4
+ export declare function createMesh(geometry: MeshGeometry, materials: (Material | null)[], kind?: Kind, obj?: Readonly<Partial<Pick<Mesh, 'enabled' | 'name'>>>): Mesh;
5
+ export declare function enableMeshSignals(source: Mesh): NodeSignals;
6
+ export declare function getMeshDeformer(source: Readonly<Mesh>): MeshDeformer;
7
+ export declare function getMeshRuntime(source: Readonly<Mesh>): MeshRuntime;
8
+ export declare function getMeshSignals(source: Mesh): NodeSignals | null;
9
+ export declare function isMesh(source: any): source is Mesh;
10
+ //# sourceMappingURL=mesh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mesh.d.ts","sourceRoot":"","sources":["../src/mesh.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKlH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAY3C,wBAAgB,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAgBtD;AAOD,wBAAgB,UAAU,CACxB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,EAC9B,IAAI,GAAE,IAAe,EACrB,GAAG,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,GACtD,IAAI,CAKN;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,IAAI,GAAG,WAAW,CAE3D;AAQD,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,YAAY,CAIpE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,WAAW,CAElE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,IAAI,GAAG,WAAW,GAAG,IAAI,CAE/D;AAKD,wBAAgB,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,IAAI,CAGlD"}
package/dist/mesh.js ADDED
@@ -0,0 +1,75 @@
1
+ import { cloneMeshGeometryForDeformation } from '@flighthq/mesh';
2
+ import { enableNodeSignals, getNodeLocalMatrix4, getNodeSignals, isNodeLocalMatrix4Detached, setNodeLocalMatrix4, setNodeTransform3D, } from '@flighthq/node';
3
+ import { MeshDeformerMorph, MeshDeformerNone, MeshDeformerSkeletal, MeshKind } from '@flighthq/types';
4
+ import { createNode3D, getNode3DRuntime } from './sceneNode';
5
+ export { MeshKind } from '@flighthq/types';
6
+ // Clones a Mesh node: a new node carrying a COPY of the source's transform. Rigid clones share their
7
+ // geometry; a mesh carrying morph or skin gets a restored, runtime-independent geometry because CPU
8
+ // deformation writes vertices in place. Morph targets remain shared immutable data while the live
9
+ // weight array is copied. Skin/skeleton pose is still shared explicitly; callers wanting an
10
+ // independent rig clone its joint hierarchy and Skeleton3D separately. `alpha`, `enabled`, `name`,
11
+ // and `kind` are copied. Only the mesh node itself is cloned;
12
+ // its children are not (a Mesh is a drawable leaf — clone each node you need explicitly). There is
13
+ // no general cloneNode3D: not every node kind can be duplicated (some own GPU/native resources
14
+ // or runtime bindings that cannot alias), so cloning is a per-type capability, defined here where
15
+ // it is well-formed.
16
+ export function cloneMesh(source) {
17
+ const hasDeformation = source.skin != null || source.morph != null;
18
+ const geometry = hasDeformation ? cloneMeshGeometryForDeformation(source.geometry) : source.geometry;
19
+ const clone = createMesh(geometry, source.materials.slice(), source.kind, {
20
+ enabled: source.enabled,
21
+ name: source.name,
22
+ });
23
+ clone.alpha = source.alpha;
24
+ // Copy the authored TRS; if the source authored its matrix directly, carry that detached matrix too.
25
+ setNodeTransform3D(clone, source);
26
+ if (isNodeLocalMatrix4Detached(source))
27
+ setNodeLocalMatrix4(clone, getNodeLocalMatrix4(source));
28
+ if (source.skin != null)
29
+ clone.skin = source.skin;
30
+ if (source.morph != null) {
31
+ clone.morph = { targets: source.morph.targets, weights: new Float32Array(source.morph.weights) };
32
+ }
33
+ return clone;
34
+ }
35
+ // Allocates a renderable Mesh node: a Node3D (so it shares the scene hierarchy with group nodes
36
+ // and other meshes) carrying `geometry` and one `materials` entry per geometry subset (indexed
37
+ // positionally; a missing or null slot resolves to DefaultMaterialKind at draw time). The node has
38
+ // an identity localMatrix — its model matrix once placed in the hierarchy — and no children.
39
+ // `geometry` and `materials` are stored by reference, not copied.
40
+ export function createMesh(geometry, materials, kind = MeshKind, obj) {
41
+ const mesh = createNode3D(kind, obj);
42
+ mesh.geometry = geometry;
43
+ mesh.materials = materials;
44
+ return mesh;
45
+ }
46
+ export function enableMeshSignals(source) {
47
+ return enableNodeSignals(source);
48
+ }
49
+ // The deformer a mesh runs each frame, derived from which deform field is populated: 'skeletal' when
50
+ // it carries a skin, 'morph' when it carries a morph target set, 'none' when neither (rigid). A mesh
51
+ // carrying both (corrective morph over skinning) reports 'skeletal' — the skin is the outer deform,
52
+ // applied over the morph-blended base (see updateMeshMorph then updateMeshSkin) — so this single tag
53
+ // names the outermost deform for a renderer or bounds pass; query mesh.skin/mesh.morph directly for the
54
+ // composed case. Renderers branch on this rather than duplicating the field checks.
55
+ export function getMeshDeformer(source) {
56
+ if (source.skin != null)
57
+ return MeshDeformerSkeletal;
58
+ if (source.morph != null)
59
+ return MeshDeformerMorph;
60
+ return MeshDeformerNone;
61
+ }
62
+ export function getMeshRuntime(source) {
63
+ return getNode3DRuntime(source);
64
+ }
65
+ export function getMeshSignals(source) {
66
+ return getNodeSignals(source);
67
+ }
68
+ // A node is a Mesh — a drawable leaf, not a transform-only group — when it carries geometry.
69
+ // Robust across custom kinds (a Mesh need not use MeshKind), so the scene render pass discriminates
70
+ // by this rather than by kind symbol.
71
+ export function isMesh(source) {
72
+ // eslint-disable-line
73
+ return source.geometry != null;
74
+ }
75
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cAAc,CAAC,MAAsB;IACnD,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAY;IACzC,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAED,6FAA6F;AAC7F,oGAAoG;AACpG,sCAAsC;AACtC,MAAM,UAAU,MAAM,CAAC,MAAW;IAChC,sBAAsB;IACtB,OAAQ,MAAwB,CAAC,QAAQ,IAAI,IAAI,CAAC;AACpD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { NodeAny } from '@flighthq/types';
2
+ export declare function prepareScene3DMorph(scene: Readonly<NodeAny>): void;
3
+ //# sourceMappingURL=prepareScene3DMorph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareScene3DMorph.d.ts","sourceRoot":"","sources":["../src/prepareScene3DMorph.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAkBrD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,CAclE"}
@@ -0,0 +1,34 @@
1
+ import { updateMeshMorph } from '@flighthq/mesh';
2
+ import { getNodeRuntime } from '@flighthq/node';
3
+ // Blends every enabled morphed mesh in the subtree rooted at `scene` for the current weights — the
4
+ // per-frame morph-prep pass. Call it BEFORE prepareScene3DRender: the morph writes into geometry.vertices
5
+ // and bumps the version, so the render prepare pass then culls against the freshly-morphed bounds (via
6
+ // ensureMeshGeometryBounds) and the GL backend re-uploads the deformed buffer.
7
+ //
8
+ // For morph there is no separate GPU deform, so this render-prep pass IS the CPU blend — unlike skin,
9
+ // where the GPU poses in-shader and prepare only readies the palette + a posed-bounds slot. That is why
10
+ // a morphed mesh needs no deformedLocalBounds slot: the blend writes real vertices, so the geometry's
11
+ // own bounds already describe its current pose. updateMeshMorph is itself dirty-gated, so a settled
12
+ // morph over a whole scene costs one weight-vector compare per mesh and no reblend.
13
+ //
14
+ // This lives in @flighthq/scene3d, not @flighthq/skeleton3d, so a morph-only app (e.g. an MD2 model) never
15
+ // imports the skinning package to animate blend shapes — the skin pass (prepareScene3DSkinning) is a
16
+ // separate call a skinned app makes, and the two deformers' consumers stay independent. The walk needs
17
+ // only @flighthq/node + @flighthq/mesh (both already scene dependencies). A scene with no morphed meshes
18
+ // may skip this call; it is a no-op for non-morphed meshes, and disabled subtrees are skipped whole.
19
+ export function prepareScene3DMorph(scene) {
20
+ if (!scene.enabled)
21
+ return;
22
+ // Structural mesh test (carries geometry), so it holds for meshes created with a custom kind — the
23
+ // same discrimination the render walk uses.
24
+ const mesh = scene;
25
+ if (mesh.geometry != null)
26
+ updateMeshMorph(mesh);
27
+ const children = getNodeRuntime(scene).children;
28
+ if (children !== null) {
29
+ for (let i = 0; i < children.length; i++) {
30
+ prepareScene3DMorph(children[i]);
31
+ }
32
+ }
33
+ }
34
+ //# sourceMappingURL=prepareScene3DMorph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareScene3DMorph.js","sourceRoot":"","sources":["../src/prepareScene3DMorph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,mGAAmG;AACnG,0GAA0G;AAC1G,uGAAuG;AACvG,+EAA+E;AAC/E,EAAE;AACF,sGAAsG;AACtG,wGAAwG;AACxG,sGAAsG;AACtG,oGAAoG;AACpG,oFAAoF;AACpF,EAAE;AACF,2GAA2G;AAC3G,qGAAqG;AACrG,uGAAuG;AACvG,yGAAyG;AACzG,qGAAqG;AACrG,MAAM,UAAU,mBAAmB,CAAC,KAAwB;IAC1D,IAAI,CAAC,KAAK,CAAC,OAAO;QAAE,OAAO;IAE3B,mGAAmG;IACnG,4CAA4C;IAC5C,MAAM,IAAI,GAAG,KAAwB,CAAC;IACtC,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI;QAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAEjD,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;IAChD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACzC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Scene3D, Node3D } from '@flighthq/types';
2
+ export declare function createScene3D(obj?: Readonly<Partial<Pick<Node3D, 'enabled' | 'name'>>>): Scene3D;
3
+ //# sourceMappingURL=scene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../src/scene.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAUvD,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAGhG"}
package/dist/scene.js ADDED
@@ -0,0 +1,12 @@
1
+ import { createEntity } from '@flighthq/entity';
2
+ import { Node3DKind } from '@flighthq/types';
3
+ import { createNode3D } from './sceneNode';
4
+ // Re-export the Scene3D document type so `@flighthq/scene3d` stays its import site.
5
+ // Allocates a Scene3D: a 3D content document Entity that owns a `root` Node3D (allocated here), not a node in
6
+ // the graph. Composes createEntity for the runtime slot; `animations`/`metadata` start empty and the importers
7
+ // (`createScene3DFrom*`) fill them. `obj` configures the root node (`enabled`/`name`).
8
+ export function createScene3D(obj) {
9
+ const root = createNode3D(Node3DKind, obj);
10
+ return createEntity({ animations: {}, metadata: null, root });
11
+ }
12
+ //# sourceMappingURL=scene.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene.js","sourceRoot":"","sources":["../src/scene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,oFAAoF;AAEpF,8GAA8G;AAC9G,+GAA+G;AAC/G,uFAAuF;AACvF,MAAM,UAAU,aAAa,CAAC,GAAyD;IACrF,MAAM,IAAI,GAAG,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IAC3C,OAAO,YAAY,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAY,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { AnimationClip } from '@flighthq/types';
2
+ export declare function applyAnimationClipToScene3D(clip: Readonly<AnimationClip>, time: number): void;
3
+ //# sourceMappingURL=sceneAnimation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sceneAnimation.d.ts","sourceRoot":"","sources":["../src/sceneAnimation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAgC,MAAM,iBAAiB,CAAC;AAWnF,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAwB7F"}
@@ -0,0 +1,43 @@
1
+ import { sampleAnimationTrack } from '@flighthq/animation';
2
+ import { setQuaternion, setVector3 } from '@flighthq/geometry';
3
+ import { invalidateNodeLocalTransform } from '@flighthq/node';
4
+ // Samples every channel of `clip` at `time` and applies it to its target's sink — the 3D binding layer
5
+ // over the target-free @flighthq/animation core (the core samples values; this maps a channel's opaque
6
+ // `targetRef`, a Scene3DAnimationTarget `{ node, path }`, onto the sink). TRS paths drive the node's
7
+ // transform: Translation/Scale consume a Vector3 (3 components), Rotation a unit quaternion (4). The
8
+ // Weights path drives the target Mesh's morph-target weight array (Mesh.morph.weights): the channel is
9
+ // sampled straight into that array (its width = the mesh's target count), and updateMeshMorph then
10
+ // blends the geometry from it. A Weights channel whose target node carries no morph is skipped.
11
+ // Channels whose targetRef is not a Scene3DAnimationTarget are skipped. This is the deformer split — one
12
+ // clip/animator/clock, only the sink differs (transform for TRS, weight array for morph).
13
+ export function applyAnimationClipToScene3D(clip, time) {
14
+ const channels = clip.channels;
15
+ for (let i = 0; i < channels.length; i++) {
16
+ const channel = channels[i];
17
+ const target = channel.targetRef;
18
+ if (target === null || typeof target !== 'object' || target.node === undefined)
19
+ continue;
20
+ if (target.path === 'Weights') {
21
+ const morph = target.node.morph;
22
+ if (morph == null)
23
+ continue;
24
+ // Sample straight into the live weight array — its length is the track's component width.
25
+ sampleAnimationTrack(morph.weights, channel.track, time);
26
+ continue;
27
+ }
28
+ sampleAnimationTrack(_scratch, channel.track, time);
29
+ const node = target.node;
30
+ if (target.path === 'Translation') {
31
+ setVector3(node.position, _scratch[0], _scratch[1], _scratch[2]);
32
+ }
33
+ else if (target.path === 'Scale') {
34
+ setVector3(node.scale, _scratch[0], _scratch[1], _scratch[2]);
35
+ }
36
+ else {
37
+ setQuaternion(node.rotation, _scratch[0], _scratch[1], _scratch[2], _scratch[3]);
38
+ }
39
+ invalidateNodeLocalTransform(node);
40
+ }
41
+ }
42
+ const _scratch = [0, 0, 0, 0];
43
+ //# sourceMappingURL=sceneAnimation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sceneAnimation.js","sourceRoot":"","sources":["../src/sceneAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAG9D,u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AAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACnF,CAAC;QACD,4BAA4B,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;AACH,CAAC;AAED,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Scene3D, Scene3DDocument } from '@flighthq/types';
2
+ export declare function createScene3DFromDocument(document: Readonly<Scene3DDocument>, sceneIndex?: number): Scene3D;
3
+ export declare function createScene3DsFromDocument(document: Readonly<Scene3DDocument>): Scene3D[];
4
+ //# sourceMappingURL=sceneDocument.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sceneDocument.d.ts","sourceRoot":"","sources":["../src/sceneDocument.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAIV,OAAO,EAEP,eAAe,EAIhB,MAAM,iBAAiB,CAAC;AAmBzB,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,EAAE,UAAU,SAAI,GAAG,OAAO,CAYtG;AAKD,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG,OAAO,EAAE,CAkBzF"}