ice3 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 (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +52 -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
@@ -0,0 +1,173 @@
1
+ import { ICEEventDispatcher, ICEScene, type ICEGeometryBounds, type ICEPerspectiveCamera } from '../../core/index.js';
2
+ import { type ICETilesetSnapshot } from '../../assets/index.js';
3
+ import type { ICE3 } from '../ICE3.js';
4
+ import { ICETilesetScheduler } from './ICETilesetScheduler.js';
5
+ import { type ICERenderBatchingOptions } from '../batching/ICEAdaptiveRenderBatchController.js';
6
+ export type ICETilesetTileState = 'pending' | 'loading' | 'loaded' | 'failed' | 'evicted';
7
+ export interface ICETilesetStats {
8
+ readonly total: number;
9
+ readonly pending: number;
10
+ readonly loading: number;
11
+ readonly loaded: number;
12
+ readonly failed: number;
13
+ readonly evicted: number;
14
+ readonly visible: number;
15
+ readonly resident: number;
16
+ readonly residentBytes: number;
17
+ readonly residentContents: number;
18
+ readonly loadingContents: number;
19
+ readonly lod: ICELodStats;
20
+ }
21
+ export interface ICELodStats {
22
+ readonly target: number;
23
+ readonly resident: number;
24
+ readonly coarseResident: number;
25
+ readonly fineResident: number;
26
+ readonly transitioning: number;
27
+ readonly fallback: number;
28
+ readonly maxScreenSpaceErrorPixels: number;
29
+ }
30
+ export interface ICETilesetEvent {
31
+ readonly stats: ICETilesetStats;
32
+ readonly tileId?: string;
33
+ }
34
+ export interface ICETilesetLoaderOptions {
35
+ readonly fetch?: typeof globalThis.fetch;
36
+ readonly camera: ICEPerspectiveCamera;
37
+ readonly maxConcurrentTiles?: number;
38
+ readonly maxResidentTiles?: number;
39
+ readonly maxResidentBytes?: number;
40
+ readonly prefetchMarginRatio?: number;
41
+ readonly unloadMarginRatio?: number;
42
+ readonly maxCommitsPerFrame?: number;
43
+ readonly maxScreenSpaceErrorPixels?: number;
44
+ readonly lodSettleDelayMs?: number;
45
+ readonly renderBatching?: ICERenderBatchingOptions;
46
+ }
47
+ export interface ICETilesetOpenOptions {
48
+ readonly signal?: AbortSignal;
49
+ }
50
+ export declare class ICETilesetLoader {
51
+ private readonly engine;
52
+ private readonly fetcher;
53
+ private readonly camera;
54
+ private readonly maxConcurrentTiles;
55
+ private readonly maxCommitsPerFrame;
56
+ private readonly scheduler;
57
+ private readonly maxScreenSpaceErrorPixels;
58
+ private readonly lodSettleDelayMs;
59
+ private readonly renderBatching;
60
+ constructor(engine: ICE3, options: ICETilesetLoaderOptions);
61
+ open(url: string, options?: ICETilesetOpenOptions): Promise<ICETilesetHandle>;
62
+ }
63
+ export declare class ICETilesetHandle extends ICEEventDispatcher {
64
+ private readonly engine;
65
+ private readonly snapshot;
66
+ private readonly camera;
67
+ private readonly scheduler;
68
+ private readonly maxConcurrentTiles;
69
+ private readonly maxCommitsPerFrame;
70
+ private readonly maxScreenSpaceErrorPixels;
71
+ readonly scene: ICEScene;
72
+ readonly bounds: ICEGeometryBounds;
73
+ private readonly states;
74
+ private readonly tilesById;
75
+ private readonly resident;
76
+ private readonly candidates;
77
+ private readonly activeIds;
78
+ private readonly prefetchIds;
79
+ private readonly failedLodFallbacks;
80
+ private readonly lodAncestorCache;
81
+ private readonly idleWaiters;
82
+ private readonly assetLoader;
83
+ private readonly lodSelector;
84
+ private readonly abortController;
85
+ private readonly readyPromise;
86
+ private readonly lodSettleDelayMs;
87
+ private requestQueue;
88
+ private commitQueue;
89
+ private workSet;
90
+ private residentBytes;
91
+ private activeRequests;
92
+ private resolveReady;
93
+ private rejectReady;
94
+ private readySettled;
95
+ private started;
96
+ private disposed;
97
+ private removeCallerAbort;
98
+ private workSetUpdateScheduled;
99
+ private workSetDirty;
100
+ private workSetForce;
101
+ private lastSignature;
102
+ private commitScheduled;
103
+ private budgetWarningActive;
104
+ private idleEmitted;
105
+ private lodSelection;
106
+ private lastLodTarget;
107
+ private lastLodFallbacks;
108
+ private cameraMoving;
109
+ private lodSettleTimer;
110
+ private motionFallbackId;
111
+ private readonly adaptiveController;
112
+ private readonly batchWorkerPool;
113
+ private readonly adaptivePlanner;
114
+ private readonly adaptiveUploadBytesPerFrame;
115
+ private readonly adaptiveMaxExtraGpuBytes;
116
+ private readonly adaptiveIdleTaskBudgetMs;
117
+ private adaptiveAbortController;
118
+ private adaptiveUploadHandle;
119
+ private adaptiveState;
120
+ private adaptivePlanningSignature;
121
+ private readonly renderBatchingMode;
122
+ private visibleCoverageIds;
123
+ constructor(engine: ICE3, snapshot: ICETilesetSnapshot, camera: ICEPerspectiveCamera, scheduler: ICETilesetScheduler, fetch: typeof globalThis.fetch, maxConcurrentTiles: number, maxCommitsPerFrame: number, maxScreenSpaceErrorPixels: number, lodSettleDelayMs: number, renderBatching: ICERenderBatchingOptions | undefined, callerSignal?: AbortSignal);
124
+ get stats(): ICETilesetStats;
125
+ get adaptiveStats(): Readonly<{
126
+ mode: ICERenderBatchingOptions['mode'];
127
+ activeGeneration: number;
128
+ candidateGeneration?: number;
129
+ adaptiveBatchCount: number;
130
+ }>;
131
+ private lodAncestors;
132
+ private lodAncestorIds;
133
+ private lodCoverageId;
134
+ private lodCoverageIds;
135
+ private lodNextTiles;
136
+ private lodUnsettledIds;
137
+ private recordLodFailure;
138
+ tileState(tileId: string): ICETilesetTileState | undefined;
139
+ whenReady(): Promise<void>;
140
+ whenIdle(): Promise<void>;
141
+ dispose(): void;
142
+ start(): void;
143
+ private readonly handleAfterRender;
144
+ private requestWorkSetUpdate;
145
+ private updateWorkSet;
146
+ private pumpRequests;
147
+ private loadTile;
148
+ private scheduleCommit;
149
+ private commitBatch;
150
+ private discardCandidate;
151
+ private discardCandidateRecord;
152
+ private unloadTile;
153
+ private hasPendingVisibleTargets;
154
+ private enterCameraMotion;
155
+ private promoteReadyVisibleTargets;
156
+ private lodReadyVisibleCoverage;
157
+ private reconcileSelectionVisibility;
158
+ private rejectReadyIfVisibleSetFailed;
159
+ private updateBudgetWarning;
160
+ private residentBudgetReached;
161
+ private residentBudgetExceeded;
162
+ private canCommitWithinBudget;
163
+ private enforceResidentBudget;
164
+ private maybeStartAdaptiveBatch;
165
+ private executeAdaptiveBatch;
166
+ private activateAdaptiveScene;
167
+ private restoreAdaptiveScene;
168
+ private cancelAdaptiveCandidate;
169
+ private settleIdleWaiters;
170
+ private abort;
171
+ private emit;
172
+ }
173
+ //# sourceMappingURL=ICETilesetLoader.d.ts.map
@@ -0,0 +1,34 @@
1
+ import { type ICEGeometryBounds, type ICEPerspectiveCamera } from '../../core/index.js';
2
+ import type { ICETilesetTile } from '../../assets/index.js';
3
+ import type { ICEViewport } from '../../renderer/index.js';
4
+ export interface ICETilesetSchedulerOptions {
5
+ readonly maxResidentTiles: number;
6
+ readonly maxResidentBytes: number;
7
+ readonly prefetchMarginRatio: number;
8
+ readonly unloadMarginRatio: number;
9
+ }
10
+ export interface ICETilesetWorkSetInput {
11
+ readonly assetBounds: ICEGeometryBounds;
12
+ readonly tiles: readonly ICETilesetTile[];
13
+ readonly camera: ICEPerspectiveCamera;
14
+ readonly viewport: ICEViewport;
15
+ readonly residentBytes: ReadonlyMap<string, number>;
16
+ }
17
+ export interface ICETilesetWorkSet {
18
+ readonly visible: readonly ICETilesetTile[];
19
+ readonly prefetch: readonly ICETilesetTile[];
20
+ readonly retainIds: ReadonlySet<string>;
21
+ readonly ordered: readonly ICETilesetTile[];
22
+ readonly budgetExceeded: boolean;
23
+ }
24
+ export declare class ICETilesetScheduler {
25
+ private readonly maxResidentTiles;
26
+ private readonly maxResidentBytes;
27
+ private readonly prefetchMarginRatio;
28
+ private readonly unloadMarginRatio;
29
+ constructor(options: ICETilesetSchedulerOptions);
30
+ get residentTileLimit(): number;
31
+ get residentByteLimit(): number;
32
+ update(input: ICETilesetWorkSetInput): ICETilesetWorkSet;
33
+ }
34
+ //# sourceMappingURL=ICETilesetScheduler.d.ts.map
@@ -0,0 +1,59 @@
1
+ import type { ICERenderBatchPlan } from './ICERenderBatchPlan.js';
2
+ export type ICERenderBatchingMode = 'asset' | 'adaptive' | 'off';
3
+ export interface ICERenderBatchingOptions {
4
+ readonly mode: ICERenderBatchingMode;
5
+ readonly maxWorkers?: number;
6
+ readonly idleTaskBudgetMs?: number;
7
+ readonly uploadBytesPerFrame?: number;
8
+ readonly maxExtraGpuBytes?: number;
9
+ }
10
+ export interface ICEAdaptiveBatchRequest {
11
+ readonly cameraMoving: boolean;
12
+ readonly generation: number;
13
+ readonly plan: ICERenderBatchPlan;
14
+ }
15
+ export type ICEAdaptiveBatchExecutionResult = {
16
+ readonly kind: 'completed';
17
+ readonly estimatedBytes: number;
18
+ } | {
19
+ readonly kind: 'failed';
20
+ readonly reason: 'worker' | 'upload';
21
+ readonly error: unknown;
22
+ };
23
+ export type ICEAdaptiveBatchRequestResult = {
24
+ readonly kind: 'disabled';
25
+ } | {
26
+ readonly kind: 'deferred';
27
+ } | {
28
+ readonly kind: 'started';
29
+ readonly generation: number;
30
+ } | {
31
+ readonly kind: 'rejected';
32
+ readonly reason: 'plan' | 'memory' | 'superseded' | 'busy';
33
+ };
34
+ export interface ICEAdaptiveRenderBatchControllerOptions {
35
+ readonly mode: ICERenderBatchingMode;
36
+ readonly activeGeneration: number;
37
+ readonly maxExtraGpuBytes?: number;
38
+ readonly execute: (request: ICEAdaptiveBatchRequest) => Promise<ICEAdaptiveBatchExecutionResult>;
39
+ readonly onDiagnostic?: (code: string, generation: number, message: string) => void;
40
+ }
41
+ export declare class ICEAdaptiveRenderBatchController {
42
+ private generation;
43
+ private candidateGeneration;
44
+ private readonly mode;
45
+ private readonly maxExtraGpuBytes;
46
+ private readonly execute;
47
+ private readonly onDiagnostic;
48
+ private readonly emitted;
49
+ constructor(options: ICEAdaptiveRenderBatchControllerOptions);
50
+ get activeGeneration(): number;
51
+ get candidate(): number | undefined;
52
+ request(request: ICEAdaptiveBatchRequest): ICEAdaptiveBatchRequestResult;
53
+ cancel(generation: number): void;
54
+ cameraMotion(): void;
55
+ dispose(): void;
56
+ private finish;
57
+ private diagnostic;
58
+ }
59
+ //# sourceMappingURL=ICEAdaptiveRenderBatchController.d.ts.map
@@ -0,0 +1,27 @@
1
+ import type { ICEBatchWorkerRequest, ICEBatchWorkerResponse } from './ICEBatchWorkerProtocol.js';
2
+ export interface ICEBatchWorkerLike {
3
+ postMessage(message: unknown, transfer?: readonly Transferable[]): void;
4
+ addEventListener(type: string, listener: (event: MessageEvent | ErrorEvent) => void): void;
5
+ removeEventListener(type: string, listener: (event: MessageEvent | ErrorEvent) => void): void;
6
+ terminate(): void;
7
+ }
8
+ export interface ICEBatchWorkerPoolOptions {
9
+ readonly maxWorkers?: number;
10
+ readonly workerFactory?: () => ICEBatchWorkerLike;
11
+ }
12
+ export declare class ICEBatchWorkerPool {
13
+ private readonly maxWorkers;
14
+ private readonly workerFactory;
15
+ private readonly queue;
16
+ private readonly active;
17
+ private disposed;
18
+ private nextJobId;
19
+ constructor(options?: ICEBatchWorkerPoolOptions);
20
+ run(request: ICEBatchWorkerRequest, signal: AbortSignal): Promise<ICEBatchWorkerResponse>;
21
+ dispose(): void;
22
+ private pump;
23
+ private start;
24
+ private settle;
25
+ private cancel;
26
+ }
27
+ //# sourceMappingURL=ICEBatchWorkerPool.d.ts.map
@@ -0,0 +1,40 @@
1
+ import type { ICEGeometryBounds } from '../../core/index.js';
2
+ export interface ICEBatchWorkerSource {
3
+ readonly id: string;
4
+ readonly materialKey: string;
5
+ readonly positions: ArrayBuffer;
6
+ readonly indices: ArrayBuffer;
7
+ readonly semanticIndices: ArrayBuffer;
8
+ readonly semanticIds: readonly string[];
9
+ readonly semanticNodeIds: readonly string[];
10
+ readonly semanticSelectionIds: readonly string[];
11
+ }
12
+ export interface ICEBatchWorkerOutput {
13
+ readonly id: string;
14
+ readonly materialKey: string;
15
+ readonly positions: ArrayBuffer;
16
+ readonly indices: ArrayBuffer;
17
+ readonly semanticIndices: ArrayBuffer;
18
+ readonly semanticIds: readonly string[];
19
+ readonly semanticNodeIds: readonly string[];
20
+ readonly semanticSelectionIds: readonly string[];
21
+ readonly bounds: ICEGeometryBounds;
22
+ readonly triangleCount: number;
23
+ }
24
+ export interface ICEBatchWorkerRequest {
25
+ readonly type: 'build';
26
+ readonly generation: number;
27
+ readonly maxTrianglesPerBatch: number;
28
+ readonly maxBytesPerBatch: number;
29
+ readonly sources: readonly ICEBatchWorkerSource[];
30
+ }
31
+ export type ICEBatchWorkerResponse = {
32
+ readonly type: 'built';
33
+ readonly generation: number;
34
+ readonly batches: readonly ICEBatchWorkerOutput[];
35
+ } | {
36
+ readonly type: 'failed';
37
+ readonly generation: number;
38
+ readonly message: string;
39
+ };
40
+ //# sourceMappingURL=ICEBatchWorkerProtocol.d.ts.map
@@ -0,0 +1,24 @@
1
+ import type { ICEGeometryBounds } from '../../core/index.js';
2
+ export interface ICERenderBatchCandidate {
3
+ readonly id: string;
4
+ readonly materialKey: string;
5
+ readonly triangleCount: number;
6
+ readonly byteLength: number;
7
+ readonly bounds: ICEGeometryBounds;
8
+ }
9
+ export interface ICERenderBatchPlanInput {
10
+ readonly generation: number;
11
+ readonly visibleBatchIds: readonly string[];
12
+ readonly batches: readonly ICERenderBatchCandidate[];
13
+ readonly maxExtraGpuBytes: number;
14
+ }
15
+ export interface ICERenderBatchPlan {
16
+ readonly generation: number;
17
+ readonly sourceBatchIds: readonly string[];
18
+ readonly estimatedDrawCallsSaved: number;
19
+ readonly estimatedBytes: number;
20
+ readonly estimatedGainMs: number;
21
+ readonly estimatedCostMs: number;
22
+ readonly accepted: boolean;
23
+ }
24
+ //# sourceMappingURL=ICERenderBatchPlan.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { ICERenderBatchPlan, ICERenderBatchPlanInput } from './ICERenderBatchPlan.js';
2
+ export declare class ICERenderBatchPlanner {
3
+ plan(input: ICERenderBatchPlanInput): ICERenderBatchPlan;
4
+ }
5
+ //# sourceMappingURL=ICERenderBatchPlanner.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { ICEBatchWorkerLike } from './ICEBatchWorkerPool.js';
2
+ export declare function createBatchWorker(): ICEBatchWorkerLike;
3
+ //# sourceMappingURL=createBatchWorker.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type { ICEGeometryBounds } from '../../core/index.js';
2
+ import type { ICEBatchWorkerSource } from './ICEBatchWorkerProtocol.js';
3
+ export interface ICEMergedBatchBuffer {
4
+ readonly id: string;
5
+ readonly materialKey: string;
6
+ readonly positions: Float32Array;
7
+ readonly indices: Uint32Array;
8
+ readonly semanticIndices: Uint32Array;
9
+ readonly semanticIds: readonly string[];
10
+ readonly semanticNodeIds: readonly string[];
11
+ readonly semanticSelectionIds: readonly string[];
12
+ readonly bounds: ICEGeometryBounds;
13
+ readonly triangleCount: number;
14
+ }
15
+ export interface ICEMergeBatchBuffersOptions {
16
+ readonly maxTrianglesPerBatch?: number;
17
+ readonly maxBytesPerBatch?: number;
18
+ }
19
+ export declare function mergeBatchBuffers(inputs: readonly ICEBatchWorkerSource[], options?: ICEMergeBatchBuffersOptions): readonly ICEMergedBatchBuffer[];
20
+ //# sourceMappingURL=mergeBatchBuffers.d.ts.map
@@ -0,0 +1,36 @@
1
+ export * from '../core/index.js';
2
+ export * from '../renderer/index.js';
3
+ export { ICE2DLayer } from './layer/ICE2DLayer.js';
4
+ export type { ICE2DLayerOptions } from './layer/ICE2DLayer.js';
5
+ export { ICE2DLayerRouter } from './layer/ICE2DLayerRouter.js';
6
+ export type { ICELayerHit } from './layer/ICE2DLayerRouter.js';
7
+ export { ICEWorldLayer } from './layer/ICEWorldLayer.js';
8
+ export { ICEScreenLayer } from './layer/ICEScreenLayer.js';
9
+ export { ICELabel } from './layer/ICELabel.js';
10
+ export type { ICELabelOptions, ICELabelRect } from './layer/ICELabel.js';
11
+ export { ICE3 } from './ICE3.js';
12
+ export type { ICE3Options, ICEEngineDiagnostics, } from './ICE3.js';
13
+ export { projectWorldPoint } from './ICEProjection.js';
14
+ export type { ICEProjectedPoint } from './ICEProjection.js';
15
+ export { ICEInteractionState } from './ICEInteractionState.js';
16
+ export { BrowserRenderScheduler } from './ICERenderScheduler.js';
17
+ export type { ICERenderScheduler } from './ICERenderScheduler.js';
18
+ export { ICEInputRouter } from './input/ICEInputRouter.js';
19
+ export type { ICEInputEvent, ICEInputTarget, ICEKeyboardInputEvent, } from './input/ICEInputRouter.js';
20
+ export { ICEOrbitController } from './input/ICEOrbitController.js';
21
+ export { SELECTION_CLICK_THRESHOLD_PX, isSelectionClick, selectionForOutcome, } from './input/ICESelectionGesture.js';
22
+ export type { ICEPickOutcome } from './input/ICESelectionGesture.js';
23
+ export * from './asset/ICEAssetSceneBuilder.js';
24
+ export { ICERenderBatch, type ICERenderBatchOptions, } from './asset/ICERenderBatch.js';
25
+ export { ICEAssetLoader, type ICEAssetHandle, type ICEAssetLoaderOptions, type ICEAssetLoadOptions, } from './asset/ICEAssetLoader.js';
26
+ export { ICETilesetHandle, ICETilesetLoader, type ICETilesetEvent, type ICETilesetLoaderOptions, type ICETilesetOpenOptions, type ICETilesetStats, type ICETilesetTileState, } from './asset/ICETilesetLoader.js';
27
+ export { ICETilesetScheduler, type ICETilesetSchedulerOptions, type ICETilesetWorkSet, type ICETilesetWorkSetInput, } from './asset/ICETilesetScheduler.js';
28
+ export { ICELodSelector, type ICELodSelection, type ICELodSelectionInput, } from './asset/ICELodSelector.js';
29
+ export type { ICELodStats } from './asset/ICETilesetLoader.js';
30
+ export { collectSceneItems, raycastSceneNode, type ICERay, type ICESceneItem, type ICESceneQuery, } from './query/ICESceneQuery.js';
31
+ export type { ICEPreparedContract, ICEPreparedStats, } from '../assets/index.js';
32
+ export { ICEAdaptiveRenderBatchController, } from './batching/ICEAdaptiveRenderBatchController.js';
33
+ export type { ICEAdaptiveBatchExecutionResult, ICEAdaptiveBatchRequest, ICEAdaptiveBatchRequestResult, ICERenderBatchingMode, ICERenderBatchingOptions, } from './batching/ICEAdaptiveRenderBatchController.js';
34
+ export { ICERenderBatchPlanner } from './batching/ICERenderBatchPlanner.js';
35
+ export type { ICERenderBatchCandidate, ICERenderBatchPlan, ICERenderBatchPlanInput, } from './batching/ICERenderBatchPlan.js';
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,62 @@
1
+ export type ICEInputTarget = {
2
+ readonly kind: 'layer';
3
+ readonly layerId: string;
4
+ readonly labelId: string;
5
+ } | {
6
+ readonly kind: 'scene';
7
+ readonly nodeId?: string;
8
+ };
9
+ export type ICEInputEvent = {
10
+ readonly type: 'pointerdown' | 'pointermove' | 'pointerup' | 'pointercancel' | 'wheel';
11
+ readonly point: Readonly<{
12
+ x: number;
13
+ y: number;
14
+ }>;
15
+ readonly pointerId?: number;
16
+ readonly deltaY?: number;
17
+ readonly deltaMode?: number;
18
+ };
19
+ export type ICEKeyboardInputEvent = {
20
+ readonly type: 'keydown' | 'keyup';
21
+ readonly code: string;
22
+ readonly key: string;
23
+ readonly repeat: boolean;
24
+ };
25
+ export interface ICEInputRouterOptions {
26
+ readonly hitTestLayer: (point: {
27
+ x: number;
28
+ y: number;
29
+ }) => ICEInputTarget | undefined;
30
+ readonly pickScene: (point: {
31
+ x: number;
32
+ y: number;
33
+ }) => ICEInputTarget | undefined;
34
+ readonly dispatch?: (target: ICEInputTarget, event: ICEInputEvent) => void;
35
+ }
36
+ export declare class ICEInputRouter {
37
+ private readonly options;
38
+ private readonly captured;
39
+ constructor(options: ICEInputRouterOptions);
40
+ route(point: {
41
+ x: number;
42
+ y: number;
43
+ }): ICEInputTarget | undefined;
44
+ pointerDown(point: {
45
+ x: number;
46
+ y: number;
47
+ }, pointerId: number): ICEInputTarget | undefined;
48
+ pointerMove(point: {
49
+ x: number;
50
+ y: number;
51
+ }, pointerId: number): ICEInputTarget | undefined;
52
+ pointerUp(point: {
53
+ x: number;
54
+ y: number;
55
+ }, pointerId: number): ICEInputTarget | undefined;
56
+ pointerCancel(pointerId: number): void;
57
+ wheel(deltaY: number, point: {
58
+ x: number;
59
+ y: number;
60
+ }, deltaMode?: number): ICEInputTarget | undefined;
61
+ }
62
+ //# sourceMappingURL=ICEInputRouter.d.ts.map
@@ -0,0 +1,51 @@
1
+ import { ICEPerspectiveCamera } from '../../core/index.js';
2
+ import type { ICE3 } from '../ICE3.js';
3
+ export declare class ICEOrbitController {
4
+ private readonly engine;
5
+ private readonly camera;
6
+ private target;
7
+ private yaw;
8
+ private pitch;
9
+ private distance;
10
+ private targetYaw;
11
+ private targetPitch;
12
+ private targetDistance;
13
+ private lastMotionAt;
14
+ private draggingPointer;
15
+ private lastPoint;
16
+ private readonly activePointers;
17
+ private pinchDistance;
18
+ private readonly pressedKeys;
19
+ private started;
20
+ private disposed;
21
+ private readonly onPointerDown;
22
+ private readonly onPointerMove;
23
+ private readonly onPointerUp;
24
+ private readonly onWheel;
25
+ private readonly onKeyDown;
26
+ private readonly onKeyUp;
27
+ private readonly onKeyCancel;
28
+ private readonly onBeforeRender;
29
+ constructor(engine: ICE3, camera: ICEPerspectiveCamera);
30
+ focus(target: {
31
+ readonly bounds: {
32
+ readonly min: readonly [number, number, number];
33
+ readonly max: readonly [number, number, number];
34
+ };
35
+ }, options?: {
36
+ readonly padding?: number;
37
+ readonly animate?: boolean;
38
+ }): this;
39
+ rotateBy(deltaX: number, deltaY: number): this;
40
+ zoomBy(delta: number): this;
41
+ start(): this;
42
+ stop(): this;
43
+ dispose(): void;
44
+ private applyPosition;
45
+ private applyKeyboardMovement;
46
+ private prepareMotion;
47
+ private motionSettled;
48
+ private assertActive;
49
+ private distanceBetweenPointers;
50
+ }
51
+ //# sourceMappingURL=ICEOrbitController.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { ICEPerspectiveCamera, ICEScene, type ICENode } from '../../core/index.js';
2
+ import type { ICEViewport } from '../../renderer/index.js';
3
+ export declare function pickSceneNode(scene: ICEScene, camera: ICEPerspectiveCamera, viewport: ICEViewport, point: {
4
+ readonly x: number;
5
+ readonly y: number;
6
+ }): ICENode | undefined;
7
+ //# sourceMappingURL=ICEScenePicker.d.ts.map
@@ -0,0 +1,18 @@
1
+ export declare const SELECTION_CLICK_THRESHOLD_PX = 4;
2
+ export declare function isSelectionClick(start: Readonly<{
3
+ x: number;
4
+ y: number;
5
+ }>, end: Readonly<{
6
+ x: number;
7
+ y: number;
8
+ }>): boolean;
9
+ export type ICEPickOutcome = {
10
+ readonly kind: 'hit';
11
+ readonly id: string;
12
+ } | {
13
+ readonly kind: 'empty';
14
+ } | {
15
+ readonly kind: 'error';
16
+ };
17
+ export declare function selectionForOutcome(outcome: ICEPickOutcome): readonly string[] | undefined;
18
+ //# sourceMappingURL=ICESelectionGesture.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { ICEViewport } from '../../renderer/index.js';
2
+ import type { ICE2DLayer } from './ICE2DLayer.js';
3
+ export declare class ICE2DCanvasPainter {
4
+ paint(canvas: HTMLCanvasElement, layers: readonly ICE2DLayer[], viewport: ICEViewport, dpr: number): void;
5
+ }
6
+ //# sourceMappingURL=ICE2DCanvasPainter.d.ts.map
@@ -0,0 +1,29 @@
1
+ import { ICEEventDispatcher } from '../../core/index.js';
2
+ import type { ICEViewport } from '../../renderer/index.js';
3
+ import { ICELabel } from './ICELabel.js';
4
+ export interface ICE2DLayerOptions {
5
+ readonly id: string;
6
+ readonly order?: number;
7
+ readonly visible?: boolean;
8
+ readonly interactive?: boolean;
9
+ readonly passThrough?: boolean;
10
+ }
11
+ export declare class ICE2DLayer extends ICEEventDispatcher {
12
+ readonly id: string;
13
+ readonly order: number;
14
+ visible: boolean;
15
+ interactive: boolean;
16
+ passThrough: boolean;
17
+ protected readonly labels: ICELabel[];
18
+ constructor(options: ICE2DLayerOptions);
19
+ addChild(child: ICELabel): this;
20
+ removeChild(child: ICELabel): this;
21
+ hitTest(point: {
22
+ readonly x: number;
23
+ readonly y: number;
24
+ }): ICELabel | undefined;
25
+ getLabels(): readonly ICELabel[];
26
+ paint(context: CanvasRenderingContext2D, _viewport: ICEViewport): void;
27
+ dispose(): void;
28
+ }
29
+ //# sourceMappingURL=ICE2DLayer.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type { ICE2DLayer } from './ICE2DLayer.js';
2
+ import type { ICELabel } from './ICELabel.js';
3
+ export type ICELayerHit = {
4
+ readonly layer: ICE2DLayer;
5
+ readonly label: ICELabel;
6
+ };
7
+ export declare class ICE2DLayerRouter {
8
+ private readonly getLayers;
9
+ constructor(getLayers: () => readonly ICE2DLayer[]);
10
+ hitTest(point: {
11
+ readonly x: number;
12
+ readonly y: number;
13
+ }): ICELayerHit | undefined;
14
+ shouldPassThrough(point: {
15
+ readonly x: number;
16
+ readonly y: number;
17
+ }): boolean;
18
+ private topDown;
19
+ }
20
+ //# sourceMappingURL=ICE2DLayerRouter.d.ts.map
@@ -0,0 +1,42 @@
1
+ import { ICEEventDispatcher } from '../../core/index.js';
2
+ export interface ICELabelOptions {
3
+ readonly id: string;
4
+ readonly text: string;
5
+ readonly anchorId?: string;
6
+ readonly screenPosition?: readonly [number, number];
7
+ readonly color?: string;
8
+ readonly background?: string;
9
+ readonly padding?: number;
10
+ readonly interactive?: boolean;
11
+ }
12
+ export interface ICELabelRect {
13
+ readonly x: number;
14
+ readonly y: number;
15
+ readonly width: number;
16
+ readonly height: number;
17
+ }
18
+ export declare class ICELabel extends ICEEventDispatcher {
19
+ readonly id: string;
20
+ readonly anchorId: string | undefined;
21
+ readonly color: string;
22
+ readonly background: string;
23
+ readonly padding: number;
24
+ readonly interactive: boolean;
25
+ visible: boolean;
26
+ private currentText;
27
+ private currentScreenPosition;
28
+ private rect;
29
+ constructor(options: ICELabelOptions);
30
+ get text(): string;
31
+ get screenPosition(): readonly [number, number] | undefined;
32
+ setText(text: string): this;
33
+ setScreenPosition(position: readonly [number, number]): this;
34
+ setWorldAnchor(position: readonly [number, number], visible?: boolean): this;
35
+ measure(context: CanvasRenderingContext2D): ICELabelRect;
36
+ getRect(): ICELabelRect;
37
+ containsPoint(point: {
38
+ readonly x: number;
39
+ readonly y: number;
40
+ }): boolean;
41
+ }
42
+ //# sourceMappingURL=ICELabel.d.ts.map