@miris-inc/core 0.0.8-ed96f19 → 0.0.8-ef900ea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AquaApi.wasm +0 -0
- package/dist/aqua-parser.wasm +0 -0
- package/dist/core.d.ts +86 -45
- package/dist/core.js +2213 -2452
- package/dist/core.prod.js +1 -1
- package/dist/core.standalone.js +5856 -5423
- package/dist/core.standalone.prod.js +1 -1
- package/package.json +16 -16
- package/dist/AquaApi.js +0 -15
- package/dist/aqua-parser.js +0 -14
package/dist/AquaApi.wasm
CHANGED
|
Binary file
|
package/dist/aqua-parser.wasm
CHANGED
|
Binary file
|
package/dist/core.d.ts
CHANGED
|
@@ -7,10 +7,36 @@ declare interface AttributeInfo extends EmbindObject {
|
|
|
7
7
|
readonly maxValue: { x: number; y: number; z: number };
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
export declare class AttributeNames {
|
|
11
|
+
static readonly SPARK_PACKED_SPLAT: string;
|
|
12
|
+
static readonly SPARK_EXTENDED_SPLAT_LOW: string;
|
|
13
|
+
static readonly SPARK_EXTENDED_SPLAT_HIGH: string;
|
|
14
|
+
static readonly SPARK_PACKED_SH1: string;
|
|
15
|
+
static readonly SPARK_PACKED_SH2: string;
|
|
16
|
+
static readonly SPARK_PACKED_SH3: string;
|
|
17
|
+
static readonly SPARK_EXTENDED_SH1: string;
|
|
18
|
+
static readonly SPARK_EXTENDED_SH2: string;
|
|
19
|
+
static readonly SPARK_EXTENDED_SH3_A: string;
|
|
20
|
+
static readonly SPARK_EXTENDED_SH3_B: string;
|
|
21
|
+
static readonly UNUSED: string;
|
|
22
|
+
static readonly SHARK_ELLIPSOIDS: string;
|
|
23
|
+
static readonly SHARK_ELLIPSOIDS_COMPRESSED: string;
|
|
24
|
+
static readonly SHARK_SPHERICAL_HARMONICS: string;
|
|
25
|
+
static readonly COLOR: string;
|
|
26
|
+
static readonly OCTANT_OFFSETS: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare type CachedAttribute = {
|
|
30
|
+
paddedData: Uint32Array<ArrayBuffer>;
|
|
31
|
+
originalSizeInUints: number;
|
|
32
|
+
};
|
|
33
|
+
|
|
10
34
|
export declare class Camera {
|
|
11
35
|
#private;
|
|
12
36
|
readonly id: number;
|
|
13
37
|
update(): void;
|
|
38
|
+
get viewportHeight(): number;
|
|
39
|
+
set viewportHeight(viewportHeight: number);
|
|
14
40
|
get aspect(): number;
|
|
15
41
|
set aspect(aspect: number);
|
|
16
42
|
get fov(): number;
|
|
@@ -24,7 +50,7 @@ export declare class Camera {
|
|
|
24
50
|
readonly engine: Engine;
|
|
25
51
|
readonly miris: Miris;
|
|
26
52
|
readonly scene: Scene;
|
|
27
|
-
constructor({ aspect, fov, near, far, matrix, scene }: CameraInit);
|
|
53
|
+
constructor({ aspect, fov, near, far, matrix, scene, viewportHeight, }: CameraInit);
|
|
28
54
|
}
|
|
29
55
|
|
|
30
56
|
export declare type CameraInit = {
|
|
@@ -34,6 +60,7 @@ export declare type CameraInit = {
|
|
|
34
60
|
far: number;
|
|
35
61
|
matrix: Matrix4x4Tuple;
|
|
36
62
|
scene: Scene;
|
|
63
|
+
viewportHeight?: number;
|
|
37
64
|
};
|
|
38
65
|
|
|
39
66
|
export declare class Change {
|
|
@@ -43,7 +70,7 @@ export declare class Change {
|
|
|
43
70
|
}
|
|
44
71
|
|
|
45
72
|
export declare type ChangeInit = {
|
|
46
|
-
type: "created" | "activated" | "modified" | "deactivated" | "deleted";
|
|
73
|
+
type: "created" | "activated" | "modified" | "deactivated" | "deleted" | "remasked";
|
|
47
74
|
lod: Lod;
|
|
48
75
|
};
|
|
49
76
|
|
|
@@ -56,7 +83,6 @@ declare class Client {
|
|
|
56
83
|
constructor({ engine, context }: ClientInit);
|
|
57
84
|
dispose(): void;
|
|
58
85
|
addStreamById(...args: ClientMethodParameters["addStreamById"]): number;
|
|
59
|
-
addPrefetchStreamById(...args: ClientMethodParameters["addPrefetchStreamById"]): number;
|
|
60
86
|
destroyClient(...args: ClientMethodParameters["destroyClient"]): AquaStatus;
|
|
61
87
|
getAssetsAsync(...args: ClientMethodParameters["getAssetsAsync"]): AssetInfo[];
|
|
62
88
|
getAttribute(...args: ClientMethodParameters["getAttribute"]): AquaStatus;
|
|
@@ -70,6 +96,7 @@ declare class Client {
|
|
|
70
96
|
getSceneMetadata(...args: ClientMethodParameters["getSceneMetadata"]): number;
|
|
71
97
|
getSceneObjectParent(...args: ClientMethodParameters["getSceneObjectParent"]): number;
|
|
72
98
|
getSceneObjectType(...args: ClientMethodParameters["getSceneObjectType"]): SceneObjectType;
|
|
99
|
+
getDrawnOctantMask(...args: ClientMethodParameters["getDrawnOctantMask"]): number;
|
|
73
100
|
getLocalTransform(...args: ClientMethodParameters["getLocalTransform"]): AquaStatus;
|
|
74
101
|
getWorldTransform(...args: ClientMethodParameters["getWorldTransform"]): AquaStatus;
|
|
75
102
|
hasAttribute(...args: ClientMethodParameters["hasAttribute"]): boolean;
|
|
@@ -92,7 +119,6 @@ declare class Client {
|
|
|
92
119
|
takeRenderRequired(...args: ClientMethodParameters["takeRenderRequired"]): boolean;
|
|
93
120
|
unlockScene(...args: ClientMethodParameters["unlockScene"]): boolean;
|
|
94
121
|
updateSceneExecution(...args: ClientMethodParameters["updateSceneExecution"]): AquaStatus;
|
|
95
|
-
recordFrameTime(...args: ClientMethodParameters["recordFrameTime"]): AquaStatus;
|
|
96
122
|
}
|
|
97
123
|
|
|
98
124
|
declare type ClientInit = {
|
|
@@ -183,13 +209,6 @@ declare class Engine {
|
|
|
183
209
|
assetId: string,
|
|
184
210
|
doNotRefine: boolean
|
|
185
211
|
]): number;
|
|
186
|
-
addPrefetchStreamById(...args: [
|
|
187
|
-
handle: AquaClientHandle,
|
|
188
|
-
streamName: string,
|
|
189
|
-
assetId: string,
|
|
190
|
-
maxPrefetchDepth: number,
|
|
191
|
-
keepPrefetch: boolean
|
|
192
|
-
]): number;
|
|
193
212
|
allocateSceneChangesArrays(...args: [sceneChangeIds: SceneChangeIds]): void;
|
|
194
213
|
createContext(...args: []): AquaContextHandle;
|
|
195
214
|
destroyContext(...args: [handle: AquaContextHandle]): AquaStatus;
|
|
@@ -198,6 +217,8 @@ declare class Engine {
|
|
|
198
217
|
deletedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
|
|
199
218
|
dataPtrView(...args: [attributeInfo: AttributeInfo]): Uint32Array;
|
|
200
219
|
deactivatedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
|
|
220
|
+
remaskedObjectIdsView(...args: [sceneChangeIds: SceneChangeIds]): Uint32Array;
|
|
221
|
+
getDrawnOctantMask(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
201
222
|
destroyClient(...args: [handle: AquaClientHandle]): AquaStatus;
|
|
202
223
|
free(...args: [size: number]): number;
|
|
203
224
|
getAssetsAsync(...args: [handle: AquaClientHandle, tags: StringVector]): AssetInfo[];
|
|
@@ -264,9 +285,11 @@ declare class Engine {
|
|
|
264
285
|
aspectRatio: number,
|
|
265
286
|
verticalFov: number,
|
|
266
287
|
nearPlane: number,
|
|
267
|
-
farPlane: number
|
|
288
|
+
farPlane: number,
|
|
289
|
+
viewportHeightPixels: number
|
|
268
290
|
]): AquaStatus;
|
|
269
291
|
setMaxCacheSize(...args: [maxSizeBytes: number]): void;
|
|
292
|
+
setPreferSharkEncodingProfiles(...args: [preferShark: boolean]): void;
|
|
270
293
|
setSceneObjectTransform(...args: [
|
|
271
294
|
handle: AquaClientHandle,
|
|
272
295
|
sceneObjectId: number,
|
|
@@ -287,8 +310,15 @@ declare class Engine {
|
|
|
287
310
|
getActiveClientSideIdsCheckSum(): number;
|
|
288
311
|
unlockScene(...args: [handle: AquaClientHandle]): boolean;
|
|
289
312
|
updateSceneExecution(...args: [handle: AquaClientHandle]): AquaStatus;
|
|
290
|
-
recordFrameTime(...args: [handle: AquaClientHandle, frameTimeMs: number]): AquaStatus;
|
|
291
313
|
takeRenderRequired(...args: [handle: AquaClientHandle]): boolean;
|
|
314
|
+
/**
|
|
315
|
+
* Advances the runtime by one frame and recomputes the streaming budget. Call once per
|
|
316
|
+
* displayed frame per context, before the per-client updateSceneExecution() calls.
|
|
317
|
+
* `previousFrameTimeMs` is how long the previous frame took; pass 0 when there is no plausible
|
|
318
|
+
* measurement (first frame, or a resume from a stall) and the frame advances without recording
|
|
319
|
+
* one.
|
|
320
|
+
*/
|
|
321
|
+
beginFrame(...args: [contextHandle: AquaContextHandle, previousFrameTimeMs: number]): AquaStatus;
|
|
292
322
|
createDeserializeWorker(_url: string, _workerUrl: string, poolSize: number): boolean;
|
|
293
323
|
cancelRequest(requestIdLow: number, requestIdHigh: number): boolean;
|
|
294
324
|
submitToWorker(requestIdLow: number, requestIdHigh: number, descriptorBuffer: ArrayBuffer, contextPtr: number): boolean;
|
|
@@ -306,25 +336,9 @@ export declare class Lod {
|
|
|
306
336
|
#private;
|
|
307
337
|
readonly id: LodInit["id"];
|
|
308
338
|
readonly store: LodStore;
|
|
309
|
-
useExtSplats: boolean;
|
|
310
|
-
splatsExtendedData: Uint32Array<ArrayBuffer> | null;
|
|
311
|
-
sh1Data: Uint32Array<ArrayBuffer> | null;
|
|
312
|
-
sh1Max: number;
|
|
313
|
-
sh2Data: Uint32Array<ArrayBuffer> | null;
|
|
314
|
-
sh2Max: number;
|
|
315
|
-
sh3Data: Uint32Array<ArrayBuffer> | null;
|
|
316
|
-
sh3Max: number;
|
|
317
|
-
sh3ExtendedData: Uint32Array<ArrayBuffer> | null;
|
|
318
339
|
get key(): unknown;
|
|
319
340
|
set key(key: unknown);
|
|
320
341
|
readonly modelRoot: ModelRoot;
|
|
321
|
-
set splats(splats: Uint32Array<ArrayBuffer> | null);
|
|
322
|
-
get splats(): Uint32Array<ArrayBuffer> | null;
|
|
323
|
-
/**
|
|
324
|
-
* Sets the cached world bounds of this object
|
|
325
|
-
*
|
|
326
|
-
* @deprecated set the local bounds and transform as needed
|
|
327
|
-
*/
|
|
328
342
|
set bounds(bounds: Float32Array<ArrayBuffer> | null);
|
|
329
343
|
/**
|
|
330
344
|
* Retrieves the cached world bounds of this object
|
|
@@ -342,21 +356,26 @@ export declare class Lod {
|
|
|
342
356
|
get localBounds(): Float32Array<ArrayBuffer> | null;
|
|
343
357
|
set lodIndex(index: number);
|
|
344
358
|
get lodIndex(): number | null;
|
|
345
|
-
set
|
|
346
|
-
get
|
|
359
|
+
set paddingSplatsCount(count: number);
|
|
360
|
+
get paddingSplatsCount(): number;
|
|
347
361
|
set transform(transform: Float32Array<ArrayBuffer> | null);
|
|
348
362
|
get transform(): Float32Array<ArrayBuffer> | null;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
363
|
+
get _drawnOctantMask(): number;
|
|
364
|
+
set _drawnOctantMask(mask: number);
|
|
365
|
+
get _octantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
366
|
+
get _hasOctantOffsets(): boolean;
|
|
367
|
+
_readOctantOffsets(engine: Engine): void;
|
|
368
|
+
hasAttribute(attributeName: string): boolean;
|
|
369
|
+
getDataFromAttribute(engine: Engine, attributeName: string, attributeInfo: AttributeInfo): CachedAttribute | null;
|
|
352
370
|
dispose(): void;
|
|
353
|
-
constructor({ id, modelRoot, lodStore }: LodInit);
|
|
371
|
+
constructor({ id, modelRoot, lodStore, client }: LodInit);
|
|
354
372
|
}
|
|
355
373
|
|
|
356
374
|
export declare type LodInit = {
|
|
357
375
|
id: number;
|
|
358
376
|
modelRoot: ModelRoot;
|
|
359
377
|
lodStore: LodStore;
|
|
378
|
+
client: Client;
|
|
360
379
|
};
|
|
361
380
|
|
|
362
381
|
export declare class LodStore {
|
|
@@ -397,7 +416,9 @@ declare interface MainModule {
|
|
|
397
416
|
createdObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
398
417
|
dataPtrView(attributeInfo: AttributeInfo): Uint32Array;
|
|
399
418
|
deactivatedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
419
|
+
remaskedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
400
420
|
deletedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
421
|
+
GetDrawnOctantMask(handle: number, sceneObjectId: number): number;
|
|
401
422
|
GetAssetsAsync(handle: number, tags: StringVector): unknown[];
|
|
402
423
|
GetSceneChanges(handle: number, sceneChangeIds: SceneChangeIds): void;
|
|
403
424
|
GetSceneChangesCounts(handle: number, sceneChangeIds: SceneChangeIds): void;
|
|
@@ -411,8 +432,10 @@ declare interface MainModule {
|
|
|
411
432
|
TakeEvictedClientSideAttributeIds(handle: number): EmbindVector<bigint>;
|
|
412
433
|
GetActiveClientSideIdsCheckSum(): number;
|
|
413
434
|
TakeRenderRequired(handle: number): boolean;
|
|
435
|
+
BeginFrame(contextHandle: number, previousFrameTimeMs: number): number;
|
|
414
436
|
modifiedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
415
437
|
setMaxCacheSize(maxSizeBytes: number): void;
|
|
438
|
+
SetPreferSharkEncodingProfiles(prefer: boolean): void;
|
|
416
439
|
}
|
|
417
440
|
|
|
418
441
|
/**
|
|
@@ -425,6 +448,7 @@ declare interface MainModule {
|
|
|
425
448
|
*/
|
|
426
449
|
export declare class Miris {
|
|
427
450
|
#private;
|
|
451
|
+
static tryUseShark: boolean;
|
|
428
452
|
static _instance: Miris;
|
|
429
453
|
static instance<T extends typeof Miris>(this: T): Promise<InstanceType<T>>;
|
|
430
454
|
readonly engine: Engine;
|
|
@@ -443,17 +467,19 @@ export declare class Miris {
|
|
|
443
467
|
protected _xrSession: XRSession | null;
|
|
444
468
|
protected _requestAnimationFrame: RequestAnimationFrameFn | null;
|
|
445
469
|
signalResumeFromIdle(): void;
|
|
470
|
+
get _splatCountBudget(): number;
|
|
446
471
|
/**
|
|
447
472
|
* Why 43? Because the AVP throttles down to 45Hz :(
|
|
448
473
|
*/
|
|
449
474
|
static readonly _XR_TARGET_FRAME_RATE = 43;
|
|
475
|
+
/* Excluded from this release type: _XR_SPLAT_COUNT_BUDGET */
|
|
450
476
|
/* Excluded from this release type: _setTargetFrameRate */
|
|
451
477
|
/* Excluded from this release type: _setXRModeActive */
|
|
452
478
|
/* Excluded from this release type: _setSplatCountBudgetOverride */
|
|
453
479
|
/* Excluded from this release type: _update */
|
|
454
480
|
getLocalTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
455
481
|
getWorldTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
456
|
-
|
|
482
|
+
/* Excluded from this release type: _updateForScene */
|
|
457
483
|
applyChanges(_entries: Change[]): void;
|
|
458
484
|
_computeAdditionalRenderNeeded(): boolean;
|
|
459
485
|
onColorSpaceDetected(_isLinear: boolean): void;
|
|
@@ -510,8 +536,20 @@ export declare class Scene extends EventTarget {
|
|
|
510
536
|
readonly client: Client;
|
|
511
537
|
readonly handle?: number;
|
|
512
538
|
constructor({ miris, viewerKey }: SceneInit);
|
|
539
|
+
/**
|
|
540
|
+
* Drives a frame and answers whether *this* scene's canvas needs repainting. Call it once per
|
|
541
|
+
* displayed frame from the host's animation loop, and render when it returns true.
|
|
542
|
+
*
|
|
543
|
+
* Every scene on the page calls this from its own loop. The first call in a displayed frame
|
|
544
|
+
* drives one engine tick for all of them; the rest recognise the frame and reuse it.
|
|
545
|
+
*
|
|
546
|
+
* @param ts the host's frame timestamp. Optional - the document timeline supplies one, and it
|
|
547
|
+
* reads the same for every scene in a displayed frame. Pass it when the host runs its own
|
|
548
|
+
* clock, as an immersive XR session does, because XRFrame time is not the document timeline.
|
|
549
|
+
*/
|
|
550
|
+
update(ts?: DOMHighResTimeStamp): boolean;
|
|
513
551
|
dispose(): void;
|
|
514
|
-
/* Excluded from this release type:
|
|
552
|
+
/* Excluded from this release type: _getViewingVolumeObb */
|
|
515
553
|
fetchAssets(tags?: string | Iterable<string>): Promise<{
|
|
516
554
|
name: string;
|
|
517
555
|
thumbnailUrl: string;
|
|
@@ -537,6 +575,7 @@ declare interface SceneChangeIds extends EmbindObject {
|
|
|
537
575
|
readonly modifiedObjectsCount: number;
|
|
538
576
|
readonly deactivatedObjectsCount: number;
|
|
539
577
|
readonly deletedObjectsCount: number;
|
|
578
|
+
readonly remaskedObjectsCount: number;
|
|
540
579
|
}
|
|
541
580
|
|
|
542
581
|
export declare type SceneInit = {
|
|
@@ -548,6 +587,13 @@ declare interface SceneMetadata extends EmbindObject {
|
|
|
548
587
|
readonly inputColorSpace: string;
|
|
549
588
|
}
|
|
550
589
|
|
|
590
|
+
declare type SparkAttributeInfo = {
|
|
591
|
+
elementsPerSplat: number;
|
|
592
|
+
discard: boolean;
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
export declare const sparkAttributeList: Record<string, SparkAttributeInfo>;
|
|
596
|
+
|
|
551
597
|
declare interface SpatialFormat extends EmbindObject {
|
|
552
598
|
metersPerUnit: number;
|
|
553
599
|
upAxis: number;
|
|
@@ -575,6 +621,8 @@ export declare class Stream extends EventTarget {
|
|
|
575
621
|
set key(key: unknown);
|
|
576
622
|
get matrix(): Matrix4x4Tuple;
|
|
577
623
|
set matrix(matrix: Matrix4x4Tuple);
|
|
624
|
+
get opacity(): number;
|
|
625
|
+
set opacity(opacity: number);
|
|
578
626
|
get boundingBox(): {
|
|
579
627
|
min: {
|
|
580
628
|
x: number;
|
|
@@ -603,7 +651,7 @@ export declare class Stream extends EventTarget {
|
|
|
603
651
|
*/
|
|
604
652
|
get chunks(): Set<ModelRoot>;
|
|
605
653
|
constructor(options: StreamInit);
|
|
606
|
-
_initStream({ uuid
|
|
654
|
+
_initStream({ uuid }: StreamInit): void;
|
|
607
655
|
/* Excluded from this release type: _onStreamLoaded */
|
|
608
656
|
/* Excluded from this release type: _onRootLoaded */
|
|
609
657
|
add(modelRoot: ModelRoot): void;
|
|
@@ -615,13 +663,6 @@ export declare type StreamInit = {
|
|
|
615
663
|
scene: Scene;
|
|
616
664
|
authToken?: string;
|
|
617
665
|
drmKey?: string;
|
|
618
|
-
/** When true the stream runs in prefetch-only mode: it downloads and caches
|
|
619
|
-
* octree node data up to `prefetchMaxDepth` without rendering anything. */
|
|
620
|
-
prefetch?: boolean;
|
|
621
|
-
/** Maximum octree depth to prefetch. Set to -1 to disable prefetching. If omitted, defaults to 3 */
|
|
622
|
-
prefetchMaxDepth?: number;
|
|
623
|
-
/** Retain all prefetched data by the stream (make it non evictable) */
|
|
624
|
-
keepPrefetch?: boolean;
|
|
625
666
|
};
|
|
626
667
|
|
|
627
668
|
declare type StringVector = EmbindVector<string>;
|