ice3 0.0.0-stage → 0.1.1

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 (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -2
  3. package/dist/_types/assets/ICEGLBReader.d.ts +4 -0
  4. package/dist/_types/assets/ICEPreparedGLB.d.ts +87 -0
  5. package/dist/_types/assets/ICEProfileValidator.d.ts +11 -0
  6. package/dist/_types/assets/ICETileset.d.ts +17 -0
  7. package/dist/_types/assets/ICETilesetReader.d.ts +3 -0
  8. package/dist/_types/assets/index.d.ts +5 -0
  9. package/dist/_types/core/camera/ICEPerspectiveCamera.d.ts +25 -0
  10. package/dist/_types/core/culling/ICEFrustum.d.ts +9 -0
  11. package/dist/_types/core/diagnostics/ICEDiagnostic.d.ts +9 -0
  12. package/dist/_types/core/diagnostics/ICEEngineError.d.ts +8 -0
  13. package/dist/_types/core/event/ICEEvent.d.ts +7 -0
  14. package/dist/_types/core/event/ICEEventDispatcher.d.ts +11 -0
  15. package/dist/_types/core/geometry/ICEBoxGeometry.d.ts +19 -0
  16. package/dist/_types/core/geometry/ICEGeometry.d.ts +15 -0
  17. package/dist/_types/core/geometry/ICEIndexedGeometry.d.ts +22 -0
  18. package/dist/_types/core/index.d.ts +27 -0
  19. package/dist/_types/core/material/ICEBasicMaterial.d.ts +12 -0
  20. package/dist/_types/core/math/ICEMatrix4.d.ts +11 -0
  21. package/dist/_types/core/math/ICEVector3.d.ts +10 -0
  22. package/dist/_types/core/scene/ICEMesh.d.ts +18 -0
  23. package/dist/_types/core/scene/ICENode.d.ts +77 -0
  24. package/dist/_types/core/scene/ICEScene.d.ts +6 -0
  25. package/dist/_types/core/serialization/serializeScene.d.ts +18 -0
  26. package/dist/_types/core/types/ICETypeRegistry.d.ts +12 -0
  27. package/dist/_types/renderer/FakeRendererBackend.d.ts +27 -0
  28. package/dist/_types/renderer/ICEWebGL2BatchGenerationUploader.d.ts +31 -0
  29. package/dist/_types/renderer/WebGL2GeometryBatch.d.ts +10 -0
  30. package/dist/_types/renderer/WebGL2GeometryCache.d.ts +42 -0
  31. package/dist/_types/renderer/WebGL2InstanceBatch.d.ts +41 -0
  32. package/dist/_types/renderer/WebGL2PickCodec.d.ts +3 -0
  33. package/dist/_types/renderer/WebGL2Picker.d.ts +24 -0
  34. package/dist/_types/renderer/WebGL2Program.d.ts +25 -0
  35. package/dist/_types/renderer/WebGL2RenderBatch.d.ts +17 -0
  36. package/dist/_types/renderer/WebGL2RendererBackend.d.ts +44 -0
  37. package/dist/_types/renderer/WebGL2SemanticProgram.d.ts +21 -0
  38. package/dist/_types/renderer/index.d.ts +12 -0
  39. package/dist/_types/renderer/types.d.ts +51 -0
  40. package/dist/_types/runtime/ICE3.d.ts +121 -0
  41. package/dist/_types/runtime/ICEInteractionState.d.ts +7 -0
  42. package/dist/_types/runtime/ICEProjection.d.ts +10 -0
  43. package/dist/_types/runtime/ICERenderScheduler.d.ts +14 -0
  44. package/dist/_types/runtime/asset/ICEAssetLoader.d.ts +30 -0
  45. package/dist/_types/runtime/asset/ICEAssetSceneBuilder.d.ts +9 -0
  46. package/dist/_types/runtime/asset/ICELodSelector.d.ts +21 -0
  47. package/dist/_types/runtime/asset/ICERenderBatch.d.ts +21 -0
  48. package/dist/_types/runtime/asset/ICETilesetLoader.d.ts +173 -0
  49. package/dist/_types/runtime/asset/ICETilesetScheduler.d.ts +34 -0
  50. package/dist/_types/runtime/batching/ICEAdaptiveRenderBatchController.d.ts +59 -0
  51. package/dist/_types/runtime/batching/ICEBatchWorkerPool.d.ts +27 -0
  52. package/dist/_types/runtime/batching/ICEBatchWorkerProtocol.d.ts +40 -0
  53. package/dist/_types/runtime/batching/ICERenderBatchPlan.d.ts +24 -0
  54. package/dist/_types/runtime/batching/ICERenderBatchPlanner.d.ts +5 -0
  55. package/dist/_types/runtime/batching/createBatchWorker.d.ts +3 -0
  56. package/dist/_types/runtime/batching/mergeBatchBuffers.d.ts +20 -0
  57. package/dist/_types/runtime/index.d.ts +36 -0
  58. package/dist/_types/runtime/input/ICEInputRouter.d.ts +62 -0
  59. package/dist/_types/runtime/input/ICEOrbitController.d.ts +51 -0
  60. package/dist/_types/runtime/input/ICEScenePicker.d.ts +7 -0
  61. package/dist/_types/runtime/input/ICESelectionGesture.d.ts +18 -0
  62. package/dist/_types/runtime/layer/ICE2DCanvasPainter.d.ts +6 -0
  63. package/dist/_types/runtime/layer/ICE2DLayer.d.ts +29 -0
  64. package/dist/_types/runtime/layer/ICE2DLayerRouter.d.ts +20 -0
  65. package/dist/_types/runtime/layer/ICELabel.d.ts +42 -0
  66. package/dist/_types/runtime/layer/ICEScreenLayer.d.ts +5 -0
  67. package/dist/_types/runtime/layer/ICEWorldLayer.d.ts +9 -0
  68. package/dist/_types/runtime/query/ICESceneQuery.d.ts +24 -0
  69. package/dist/_types/runtime/workers/renderBatchWorker.d.ts +2 -0
  70. package/dist/index.d.ts +3 -0
  71. package/dist/index.js +6729 -0
  72. package/dist/index.js.map +7 -0
  73. package/package.json +38 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ICE3 contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,58 @@
1
- # Temporary Holding Version
1
+ # ICE3
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > Document ID: ICE3-ENG-RM-002
4
+ >
5
+ > Status: Active
6
+ >
7
+ > Owner: ICE3 Engine maintainers
8
+
9
+ ICE3 是面向工业场景的浏览器 3D Runtime。公开代码通过单向 facade 暴露 Scene、
10
+ Geometry、Camera、Asset 和 Tileset API。
11
+
12
+ ## 安装
13
+
14
+ ```bash
15
+ npm install ice3
16
+ ```
17
+
18
+ ## 最小使用
19
+
20
+ ```ts
21
+ import {
22
+ ICE3,
23
+ ICEBasicMaterial,
24
+ ICEBoxGeometry,
25
+ ICEMesh,
26
+ ICEPerspectiveCamera,
27
+ ICEScene,
28
+ } from 'ice3';
29
+
30
+ const host = document.querySelector<HTMLElement>('#stage');
31
+ if (!host) throw new Error('stage element is required');
32
+
33
+ const engine = new ICE3().init(host);
34
+ const scene = new ICEScene({ id: 'main' });
35
+ const camera = new ICEPerspectiveCamera({
36
+ id: 'camera',
37
+ position: [3, 2, 4],
38
+ target: [0, 0, 0],
39
+ });
40
+
41
+ scene.addChild(new ICEMesh({
42
+ id: 'sample',
43
+ geometry: new ICEBoxGeometry({ width: 1, height: 1, depth: 1 }),
44
+ material: new ICEBasicMaterial({ color: '#2f81f7' }),
45
+ }));
46
+
47
+ engine.setScene(scene).setCamera(camera).start();
48
+ ```
49
+
50
+ 完整文档和相关工具见
51
+ [Engine 文档](https://github.com/ice-3d/ice3-engine/blob/main/README.md)。
52
+
53
+ 工业模型接入 Runtime 前,使用配套的
54
+ [ICE3 Toolchain](https://github.com/ice-3d/ice3-toolchain/blob/main/README.md)
55
+ 进行离线格式转换、验证、切分、LOD 和 Tileset 发布。功能与格式支持见
56
+ [Toolchain 功能指南](https://github.com/ice-3d/ice3-toolchain/blob/main/docs/guides/capabilities.md)。
57
+
58
+ 本项目采用 MIT License。
@@ -0,0 +1,4 @@
1
+ import type { ICEPreparedAssetSnapshot } from './ICEPreparedGLB.js';
2
+ export declare function readPreparedGLB(bytes: ArrayBuffer): ICEPreparedAssetSnapshot;
3
+ export declare function verifyPreparedGLBIntegrity(bytes: ArrayBuffer): Promise<boolean>;
4
+ //# sourceMappingURL=ICEGLBReader.d.ts.map
@@ -0,0 +1,87 @@
1
+ import type { ICEGeometryBounds, ICEMatrix4Tuple } from '../core/index.js';
2
+ export interface ICEPreparedNode {
3
+ readonly id: string;
4
+ readonly selectionId: string;
5
+ readonly name: string;
6
+ readonly metadata?: Readonly<Record<string, unknown>>;
7
+ readonly parent: number | null;
8
+ readonly matrix: ICEMatrix4Tuple;
9
+ readonly visible: boolean;
10
+ }
11
+ export interface ICEPreparedGeometry {
12
+ readonly id: string;
13
+ readonly positions: Float32Array;
14
+ readonly indices: Uint16Array | Uint32Array;
15
+ readonly edgeIndices?: Uint16Array | Uint32Array;
16
+ readonly colors?: Float32Array;
17
+ readonly semanticIndices?: Uint32Array;
18
+ readonly bounds: ICEGeometryBounds;
19
+ }
20
+ export interface ICEPreparedMaterial {
21
+ readonly id: string;
22
+ readonly baseColor: string;
23
+ readonly edgeColor?: string;
24
+ }
25
+ export interface ICEPreparedMesh {
26
+ readonly id: string;
27
+ readonly node: number;
28
+ readonly geometry: number;
29
+ readonly material: number;
30
+ }
31
+ export interface ICEPreparedBatch {
32
+ readonly id: string;
33
+ readonly mesh: number;
34
+ readonly primitive: number;
35
+ readonly material: number;
36
+ readonly mode: 4 | 1;
37
+ readonly triangleCount: number;
38
+ readonly bounds: ICEGeometryBounds;
39
+ }
40
+ export interface ICEPreparedBatching {
41
+ readonly version: '1.0';
42
+ readonly semanticIds: readonly string[];
43
+ readonly semanticNodeIds: readonly string[];
44
+ readonly semanticSelectionIds: readonly string[];
45
+ readonly batches: readonly ICEPreparedBatch[];
46
+ }
47
+ export interface ICEPreparedStats {
48
+ readonly nodeCount: number;
49
+ readonly maxNodeDepth: number;
50
+ readonly meshCount: number;
51
+ readonly primitiveCount: number;
52
+ readonly triangleCount: number;
53
+ readonly edgeSegmentCount: number;
54
+ readonly materialCount: number;
55
+ readonly selectionGroupCount: number;
56
+ }
57
+ export interface ICEPreparedContract {
58
+ readonly status: 'active' | 'legacy';
59
+ readonly version?: string;
60
+ readonly preparation?: Readonly<{
61
+ runtimeConversionRequired: false;
62
+ sourceFormat: 'gltf-2.0';
63
+ unitsNormalized: true;
64
+ matrixTransformsBaked: true;
65
+ requiredCompressionDecoded: true;
66
+ edgesPrepared: boolean;
67
+ selectionGroupsPrepared: true;
68
+ }>;
69
+ readonly budget?: Readonly<{
70
+ profile: string;
71
+ status: 'pass' | 'warning' | 'error';
72
+ warningCount: number;
73
+ errorCount: number;
74
+ }>;
75
+ }
76
+ export interface ICEPreparedAssetSnapshot {
77
+ readonly assetId: string;
78
+ readonly bounds: ICEGeometryBounds;
79
+ readonly stats: ICEPreparedStats;
80
+ readonly contract: ICEPreparedContract;
81
+ readonly nodes: readonly ICEPreparedNode[];
82
+ readonly geometries: readonly ICEPreparedGeometry[];
83
+ readonly materials: readonly ICEPreparedMaterial[];
84
+ readonly meshes: readonly ICEPreparedMesh[];
85
+ readonly batching?: ICEPreparedBatching;
86
+ }
87
+ //# sourceMappingURL=ICEPreparedGLB.d.ts.map
@@ -0,0 +1,11 @@
1
+ type JSONRecord = Record<string, unknown>;
2
+ export interface ICEProfileValidation {
3
+ readonly json: JSONRecord;
4
+ readonly binary: Uint8Array;
5
+ readonly profile: JSONRecord;
6
+ }
7
+ export declare function validatePreparedProfile(json: JSONRecord, binary: Uint8Array): ICEProfileValidation;
8
+ export declare function records(value: unknown): JSONRecord[];
9
+ export declare function record(value: unknown): JSONRecord | undefined;
10
+ export {};
11
+ //# sourceMappingURL=ICEProfileValidator.d.ts.map
@@ -0,0 +1,17 @@
1
+ import type { ICEGeometryBounds } from '../core/index.js';
2
+ export interface ICETilesetTile {
3
+ readonly id: string;
4
+ readonly bounds: ICEGeometryBounds;
5
+ readonly contentUris: readonly string[];
6
+ readonly contentUri?: string;
7
+ readonly children: readonly ICETilesetTile[];
8
+ readonly geometricError: number;
9
+ readonly transform?: readonly number[];
10
+ }
11
+ export interface ICETilesetSnapshot {
12
+ readonly assetId: string;
13
+ readonly root: ICETilesetTile;
14
+ readonly bounds: ICEGeometryBounds;
15
+ readonly tiles: readonly ICETilesetTile[];
16
+ }
17
+ //# sourceMappingURL=ICETileset.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { ICETilesetSnapshot } from './ICETileset.js';
2
+ export declare function readTileset(text: string, baseUrl: string): ICETilesetSnapshot;
3
+ //# sourceMappingURL=ICETilesetReader.d.ts.map
@@ -0,0 +1,5 @@
1
+ export { readPreparedGLB, verifyPreparedGLBIntegrity, } from './ICEGLBReader.js';
2
+ export type { ICEPreparedAssetSnapshot, ICEPreparedBatch, ICEPreparedBatching, ICEPreparedContract, ICEPreparedGeometry, ICEPreparedMaterial, ICEPreparedMesh, ICEPreparedNode, ICEPreparedStats, } from './ICEPreparedGLB.js';
3
+ export { readTileset } from './ICETilesetReader.js';
4
+ export type { ICETilesetSnapshot, ICETilesetTile, } from './ICETileset.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { ICEMatrix4 } from '../math/ICEMatrix4.js';
2
+ import { ICEVector3, type ICEVector3Tuple } from '../math/ICEVector3.js';
3
+ export interface ICEPerspectiveCameraOptions {
4
+ readonly id: string;
5
+ readonly fov: number;
6
+ readonly near: number;
7
+ readonly far: number;
8
+ readonly position: ICEVector3Tuple;
9
+ readonly target?: ICEVector3Tuple;
10
+ }
11
+ export declare class ICEPerspectiveCamera {
12
+ readonly id: string;
13
+ readonly fov: number;
14
+ readonly near: number;
15
+ readonly far: number;
16
+ private eye;
17
+ private lookTarget;
18
+ constructor(options: ICEPerspectiveCameraOptions);
19
+ setPosition(position: ICEVector3Tuple): this;
20
+ setTarget(target: ICEVector3Tuple): this;
21
+ getPosition(): ICEVector3;
22
+ getTarget(): ICEVector3;
23
+ getViewProjectionMatrix(aspect: number): ICEMatrix4;
24
+ }
25
+ //# sourceMappingURL=ICEPerspectiveCamera.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { ICEGeometryBounds } from '../geometry/ICEGeometry.js';
2
+ import type { ICEMatrix4 } from '../math/ICEMatrix4.js';
3
+ export declare class ICEFrustum {
4
+ private readonly planes;
5
+ private constructor();
6
+ static fromViewProjection(matrix: ICEMatrix4): ICEFrustum;
7
+ intersectsBounds(bounds: ICEGeometryBounds, margin?: number): boolean;
8
+ }
9
+ //# sourceMappingURL=ICEFrustum.d.ts.map
@@ -0,0 +1,9 @@
1
+ export type ICEDiagnosticSeverity = 'error' | 'warning' | 'info';
2
+ export interface ICEDiagnostic {
3
+ readonly severity: ICEDiagnosticSeverity;
4
+ readonly code: string;
5
+ readonly message: string;
6
+ readonly path?: string;
7
+ readonly details?: Readonly<Record<string, unknown>>;
8
+ }
9
+ //# sourceMappingURL=ICEDiagnostic.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { ICEDiagnostic } from './ICEDiagnostic.js';
2
+ export declare class ICEEngineError extends Error {
3
+ readonly code: string;
4
+ readonly details?: Readonly<Record<string, unknown>> | undefined;
5
+ readonly diagnostic?: Readonly<ICEDiagnostic> | undefined;
6
+ constructor(code: string, message: string, details?: Readonly<Record<string, unknown>> | undefined, diagnostic?: Readonly<ICEDiagnostic> | undefined);
7
+ }
8
+ //# sourceMappingURL=ICEEngineError.d.ts.map
@@ -0,0 +1,7 @@
1
+ export declare class ICEEvent<T = unknown> {
2
+ readonly type: string;
3
+ readonly target: unknown;
4
+ readonly param?: T | undefined;
5
+ constructor(type: string, target: unknown, param?: T | undefined);
6
+ }
7
+ //# sourceMappingURL=ICEEvent.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { ICEEvent } from './ICEEvent.js';
2
+ export declare class ICEEventDispatcher {
3
+ private readonly listeners;
4
+ on<T>(type: string, listener: (event: ICEEvent<T>) => void): this;
5
+ once<T>(type: string, listener: (event: ICEEvent<T>) => void): this;
6
+ off<T>(type: string, listener?: (event: ICEEvent<T>) => void): this;
7
+ removeAllListeners(): this;
8
+ trigger<T>(type: string, param?: T): this;
9
+ private add;
10
+ }
11
+ //# sourceMappingURL=ICEEventDispatcher.d.ts.map
@@ -0,0 +1,19 @@
1
+ export interface ICEBoxGeometryOptions {
2
+ readonly width: number;
3
+ readonly height: number;
4
+ readonly depth: number;
5
+ }
6
+ export declare class ICEBoxGeometry implements ICEGeometry {
7
+ readonly typeId = "ice3:BoxGeometry";
8
+ readonly width: number;
9
+ readonly height: number;
10
+ readonly depth: number;
11
+ readonly positions: Float32Array;
12
+ readonly indices: Uint16Array;
13
+ readonly edgeIndices: Uint16Array;
14
+ constructor(options: ICEBoxGeometryOptions);
15
+ getBounds(): ICEGeometryBounds;
16
+ toJSON(): Record<string, unknown>;
17
+ }
18
+ import type { ICEGeometry, ICEGeometryBounds } from './ICEGeometry.js';
19
+ //# sourceMappingURL=ICEBoxGeometry.d.ts.map
@@ -0,0 +1,15 @@
1
+ export interface ICEGeometryBounds {
2
+ readonly min: readonly [number, number, number];
3
+ readonly max: readonly [number, number, number];
4
+ }
5
+ export interface ICEGeometry {
6
+ readonly typeId: string;
7
+ readonly positions: Float32Array;
8
+ readonly indices: Uint16Array | Uint32Array;
9
+ readonly edgeIndices?: Uint16Array | Uint32Array;
10
+ readonly colors?: Float32Array;
11
+ readonly semanticIndices?: Uint32Array;
12
+ getBounds(): ICEGeometryBounds;
13
+ toJSON(): Record<string, unknown>;
14
+ }
15
+ //# sourceMappingURL=ICEGeometry.d.ts.map
@@ -0,0 +1,22 @@
1
+ import type { ICEGeometry, ICEGeometryBounds } from './ICEGeometry.js';
2
+ export interface ICEIndexedGeometryOptions {
3
+ readonly id: string;
4
+ readonly positions: Float32Array;
5
+ readonly indices: Uint16Array | Uint32Array;
6
+ readonly edgeIndices?: Uint16Array | Uint32Array;
7
+ readonly colors?: Float32Array;
8
+ readonly semanticIndices?: Uint32Array;
9
+ }
10
+ export declare class ICEIndexedGeometry implements ICEGeometry {
11
+ readonly typeId = "ice3:IndexedGeometry";
12
+ readonly id: string;
13
+ readonly positions: Float32Array;
14
+ readonly indices: Uint16Array | Uint32Array;
15
+ readonly edgeIndices?: Uint16Array | Uint32Array;
16
+ readonly colors?: Float32Array;
17
+ readonly semanticIndices?: Uint32Array;
18
+ constructor(options: ICEIndexedGeometryOptions);
19
+ getBounds(): ICEGeometryBounds;
20
+ toJSON(): Record<string, unknown>;
21
+ }
22
+ //# sourceMappingURL=ICEIndexedGeometry.d.ts.map
@@ -0,0 +1,27 @@
1
+ export { ICEVector3 } from './math/ICEVector3.js';
2
+ export type { ICEVector3Tuple } from './math/ICEVector3.js';
3
+ export { ICEMatrix4 } from './math/ICEMatrix4.js';
4
+ export { ICEEvent } from './event/ICEEvent.js';
5
+ export { ICEEventDispatcher } from './event/ICEEventDispatcher.js';
6
+ export { ICEBoxGeometry } from './geometry/ICEBoxGeometry.js';
7
+ export type { ICEBoxGeometryOptions } from './geometry/ICEBoxGeometry.js';
8
+ export { ICEIndexedGeometry } from './geometry/ICEIndexedGeometry.js';
9
+ export type { ICEIndexedGeometryOptions } from './geometry/ICEIndexedGeometry.js';
10
+ export type { ICEGeometry, ICEGeometryBounds } from './geometry/ICEGeometry.js';
11
+ export { ICEBasicMaterial } from './material/ICEBasicMaterial.js';
12
+ export type { ICEBasicMaterialOptions } from './material/ICEBasicMaterial.js';
13
+ export { ICEPerspectiveCamera } from './camera/ICEPerspectiveCamera.js';
14
+ export type { ICEPerspectiveCameraOptions } from './camera/ICEPerspectiveCamera.js';
15
+ export { ICEFrustum } from './culling/ICEFrustum.js';
16
+ export { ICENode } from './scene/ICENode.js';
17
+ export type { ICEMatrix4Tuple, ICENodeOptions, ICESerializedNode, } from './scene/ICENode.js';
18
+ export { ICEScene } from './scene/ICEScene.js';
19
+ export { ICEMesh } from './scene/ICEMesh.js';
20
+ export type { ICEMeshOptions } from './scene/ICEMesh.js';
21
+ export { ICETypeRegistry } from './types/ICETypeRegistry.js';
22
+ export type { ICENodeType } from './types/ICETypeRegistry.js';
23
+ export { deserializeScene, serializeScene, } from './serialization/serializeScene.js';
24
+ export type { ICEDeserializedScene, ICESerializedScene, } from './serialization/serializeScene.js';
25
+ export { ICEEngineError } from './diagnostics/ICEEngineError.js';
26
+ export type { ICEDiagnostic, ICEDiagnosticSeverity } from './diagnostics/ICEDiagnostic.js';
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,12 @@
1
+ export interface ICEBasicMaterialOptions {
2
+ readonly color: string;
3
+ readonly edgeColor?: string;
4
+ }
5
+ export declare class ICEBasicMaterial {
6
+ readonly typeId = "ice3:BasicMaterial";
7
+ readonly color: string;
8
+ readonly edgeColor: string | undefined;
9
+ constructor(options: ICEBasicMaterialOptions);
10
+ toJSON(): Record<string, unknown>;
11
+ }
12
+ //# sourceMappingURL=ICEBasicMaterial.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { ICEVector3 } from './ICEVector3.js';
2
+ export declare class ICEMatrix4 {
3
+ readonly elements: Float32Array<ArrayBuffer>;
4
+ constructor();
5
+ identity(): this;
6
+ multiply(other: ICEMatrix4): this;
7
+ perspective(fovDegrees: number, aspect: number, near: number, far: number): this;
8
+ lookAt(eye: ICEVector3, target: ICEVector3, up: ICEVector3): this;
9
+ transformPoint(point: ICEVector3): [number, number, number, number];
10
+ }
11
+ //# sourceMappingURL=ICEMatrix4.d.ts.map
@@ -0,0 +1,10 @@
1
+ export type ICEVector3Tuple = readonly [number, number, number];
2
+ export declare class ICEVector3 {
3
+ readonly x: number;
4
+ readonly y: number;
5
+ readonly z: number;
6
+ constructor(x?: number, y?: number, z?: number);
7
+ clone(): ICEVector3;
8
+ toArray(): [number, number, number];
9
+ }
10
+ //# sourceMappingURL=ICEVector3.d.ts.map
@@ -0,0 +1,18 @@
1
+ import type { ICEGeometry } from '../geometry/ICEGeometry.js';
2
+ import type { ICEBasicMaterial } from '../material/ICEBasicMaterial.js';
3
+ import { ICENode, type ICENodeOptions, type ICESerializedNode } from './ICENode.js';
4
+ export interface ICEMeshOptions extends ICENodeOptions {
5
+ readonly geometry: ICEGeometry;
6
+ readonly material: ICEBasicMaterial;
7
+ }
8
+ export declare class ICEMesh extends ICENode {
9
+ static readonly typeId = "ice3:Mesh";
10
+ readonly geometry: ICEGeometry;
11
+ readonly material: ICEBasicMaterial;
12
+ readonly selectionId: string;
13
+ constructor(options: ICEMeshOptions);
14
+ get typeId(): string;
15
+ toJSON(): ICESerializedNode;
16
+ static fromJSON(value: ICESerializedNode): ICEMesh;
17
+ }
18
+ //# sourceMappingURL=ICEMesh.d.ts.map
@@ -0,0 +1,77 @@
1
+ import { ICEEventDispatcher } from '../event/ICEEventDispatcher.js';
2
+ import { ICEMatrix4 } from '../math/ICEMatrix4.js';
3
+ import { ICEVector3, type ICEVector3Tuple } from '../math/ICEVector3.js';
4
+ export interface ICENodeOptions {
5
+ readonly id: string;
6
+ readonly displayName?: string;
7
+ readonly selectionId?: string;
8
+ readonly metadata?: Readonly<Record<string, unknown>>;
9
+ readonly position?: ICEVector3Tuple;
10
+ readonly rotation?: ICEVector3Tuple;
11
+ readonly scale?: ICEVector3Tuple;
12
+ readonly matrix?: ICEMatrix4Tuple;
13
+ }
14
+ export type ICEMatrix4Tuple = readonly [
15
+ number,
16
+ number,
17
+ number,
18
+ number,
19
+ number,
20
+ number,
21
+ number,
22
+ number,
23
+ number,
24
+ number,
25
+ number,
26
+ number,
27
+ number,
28
+ number,
29
+ number,
30
+ number
31
+ ];
32
+ export interface ICESerializedNode {
33
+ readonly id: string;
34
+ readonly displayName?: string;
35
+ readonly metadata?: Readonly<Record<string, unknown>>;
36
+ readonly typeId: string;
37
+ readonly visible: boolean;
38
+ readonly position: ICEVector3Tuple;
39
+ readonly rotation: ICEVector3Tuple;
40
+ readonly scale: ICEVector3Tuple;
41
+ readonly matrix?: ICEMatrix4Tuple;
42
+ readonly children: readonly ICESerializedNode[];
43
+ readonly [key: string]: unknown;
44
+ }
45
+ export declare class ICENode extends ICEEventDispatcher {
46
+ readonly id: string;
47
+ readonly displayName: string;
48
+ readonly selectionId?: string;
49
+ readonly metadata?: Readonly<Record<string, unknown>>;
50
+ readonly position: ICEVector3;
51
+ readonly rotation: ICEVector3;
52
+ readonly scale: ICEVector3;
53
+ visible: boolean;
54
+ private _parent;
55
+ private readonly _children;
56
+ private readonly worldMatrix;
57
+ private localMatrixOverride;
58
+ constructor(options: ICENodeOptions);
59
+ get typeId(): string;
60
+ get parent(): ICENode | null;
61
+ get children(): readonly ICENode[];
62
+ addChild(node: ICENode): this;
63
+ removeChild(node: ICENode, options?: {
64
+ readonly dispose?: boolean;
65
+ }): this;
66
+ findByID(id: string): ICENode | undefined;
67
+ updateWorldMatrix(parentMatrix?: ICEMatrix4): ICEMatrix4;
68
+ getWorldPosition(): ICEVector3;
69
+ setLocalMatrix(matrix: ICEMatrix4Tuple): this;
70
+ clearLocalMatrix(): this;
71
+ toJSON(): ICESerializedNode;
72
+ dispose(): void;
73
+ private getRoot;
74
+ private isAncestorOf;
75
+ private localMatrix;
76
+ }
77
+ //# sourceMappingURL=ICENode.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { ICENode, type ICENodeOptions } from './ICENode.js';
2
+ export declare class ICEScene extends ICENode {
3
+ constructor(options: ICENodeOptions);
4
+ get typeId(): string;
5
+ }
6
+ //# sourceMappingURL=ICEScene.d.ts.map
@@ -0,0 +1,18 @@
1
+ import type { ICEDiagnostic } from '../diagnostics/ICEDiagnostic.js';
2
+ import type { ICETypeRegistry } from '../types/ICETypeRegistry.js';
3
+ import { type ICESerializedNode } from '../scene/ICENode.js';
4
+ import { ICEScene } from '../scene/ICEScene.js';
5
+ export interface ICESerializedScene {
6
+ readonly schemaVersion: 1;
7
+ readonly typeId: 'ice3:Scene';
8
+ readonly scene: ICESerializedNode;
9
+ }
10
+ export interface ICEDeserializedScene {
11
+ readonly scene: ICEScene;
12
+ readonly report: Readonly<{
13
+ errors: readonly ICEDiagnostic[];
14
+ }>;
15
+ }
16
+ export declare function serializeScene(scene: ICEScene): ICESerializedScene;
17
+ export declare function deserializeScene(value: ICESerializedScene, registry: ICETypeRegistry): ICEDeserializedScene;
18
+ //# sourceMappingURL=serializeScene.d.ts.map
@@ -0,0 +1,12 @@
1
+ import type { ICENode, ICESerializedNode } from '../scene/ICENode.js';
2
+ export interface ICENodeType {
3
+ readonly typeId: string;
4
+ fromJSON(value: ICESerializedNode): ICENode;
5
+ }
6
+ export declare class ICETypeRegistry {
7
+ private readonly types;
8
+ private readonly typeIds;
9
+ register(typeId: string, type: ICENodeType): this;
10
+ get(typeId: string): ICENodeType | undefined;
11
+ }
12
+ //# sourceMappingURL=ICETypeRegistry.d.ts.map
@@ -0,0 +1,27 @@
1
+ import type { ICERendererBackend, ICERendererCapabilities, ICEFrame, ICERendererStats, ICEViewport } from './types.js';
2
+ export declare class FakeRendererBackend implements ICERendererBackend {
3
+ readonly capabilities: Readonly<ICERendererCapabilities>;
4
+ readonly stats: Readonly<ICERendererStats>;
5
+ readonly frames: ICEFrame[];
6
+ lastViewport: ICEViewport;
7
+ lastBackgroundColor: string;
8
+ pickResult: string | undefined;
9
+ pickError: Error | undefined;
10
+ private disposed;
11
+ private disposals;
12
+ constructor(options?: {
13
+ readonly picking?: boolean;
14
+ readonly stats?: ICERendererStats;
15
+ });
16
+ initialize(): void;
17
+ resize(viewport: ICEViewport): void;
18
+ setBackgroundColor(color: string): void;
19
+ prepareBatchGeometry(): void;
20
+ releaseBatchGeometry(): void;
21
+ render(frame: ICEFrame): void;
22
+ pick(): string | undefined;
23
+ dispose(): void;
24
+ get disposeCount(): number;
25
+ private assertActive;
26
+ }
27
+ //# sourceMappingURL=FakeRendererBackend.d.ts.map
@@ -0,0 +1,31 @@
1
+ import type { ICEGeometryBounds } from '../core/index.js';
2
+ export interface ICEBatchUploadBuffer {
3
+ readonly id: string;
4
+ readonly materialKey: string;
5
+ readonly positions: Float32Array;
6
+ readonly indices: Uint32Array;
7
+ readonly semanticIndices: Uint32Array;
8
+ readonly semanticIds: readonly string[];
9
+ readonly semanticNodeIds: readonly string[];
10
+ readonly semanticSelectionIds: readonly string[];
11
+ readonly bounds: ICEGeometryBounds;
12
+ readonly triangleCount: number;
13
+ readonly byteLength: number;
14
+ }
15
+ export interface ICEBatchUploadOptions {
16
+ readonly generation: number;
17
+ readonly bytesPerFrame: number;
18
+ readonly onUploaded: (generation: number) => void;
19
+ readonly onFailed: (generation: number, error: unknown) => void;
20
+ readonly upload?: (buffer: ICEBatchUploadBuffer) => unknown;
21
+ readonly release?: (resource: unknown) => void;
22
+ readonly onActivate?: (generation: number, resources: readonly unknown[]) => void;
23
+ readonly schedule?: (callback: FrameRequestCallback) => number;
24
+ readonly cancelSchedule?: (id: number) => void;
25
+ readonly isCurrent?: () => boolean;
26
+ }
27
+ export interface ICEBatchGenerationHandle {
28
+ cancel(): void;
29
+ }
30
+ export declare function queueBatchGeneration(buffers: readonly ICEBatchUploadBuffer[], options: ICEBatchUploadOptions): ICEBatchGenerationHandle;
31
+ //# sourceMappingURL=ICEWebGL2BatchGenerationUploader.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { ICEMesh, type ICEScene } from '../core/index.js';
2
+ export interface ICEGeometryRenderable {
3
+ readonly id: string;
4
+ readonly mesh: ICEMesh;
5
+ readonly worldMatrix: Float32Array;
6
+ }
7
+ export declare function collectRenderables(scene: ICEScene, output?: ICEGeometryRenderable[]): readonly ICEGeometryRenderable[];
8
+ export declare const selectionIdentity: (mesh: ICEMesh) => string;
9
+ export { collectRenderBatches, semanticSelectionId, type ICERenderBatchDraw, type ICERenderBatchNode, } from './WebGL2RenderBatch.js';
10
+ //# sourceMappingURL=WebGL2GeometryBatch.d.ts.map