@miris-inc/core 0.0.8-e6a94a6 → 0.0.8-e7873f9
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 +112 -13
- package/dist/core.js +426 -76
- package/dist/core.prod.js +1 -1
- package/dist/core.standalone.js +884 -534
- package/dist/core.standalone.prod.js +1 -1
- package/package.json +8 -1
- package/webshark.d.ts +318 -0
package/dist/AquaApi.wasm
CHANGED
|
Binary file
|
package/dist/aqua-parser.wasm
CHANGED
|
Binary file
|
package/dist/core.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
export declare const AssetFormat: {
|
|
2
|
+
readonly GaussianSplats: 1;
|
|
3
|
+
readonly GES: 2;
|
|
4
|
+
};
|
|
5
|
+
|
|
1
6
|
declare interface AttributeInfo extends EmbindObject {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
readonly
|
|
5
|
-
readonly
|
|
7
|
+
// Logical elements from the drop metadata: splats for a per-splat attribute, records for a
|
|
8
|
+
// per-surfel one. Not necessarily dataSizeBytes / bytesPerElement.
|
|
9
|
+
readonly elementCount: number;
|
|
10
|
+
readonly dataSizeBytes: number;
|
|
6
11
|
readonly clientSideId: bigint;
|
|
12
|
+
// An embind CompressionType value, compared by identity against MainModule.CompressionType
|
|
13
|
+
readonly compressionType: unknown;
|
|
14
|
+
readonly minValue: { x: number; y: number; z: number; w: number };
|
|
7
15
|
readonly maxValue: { x: number; y: number; z: number };
|
|
8
16
|
}
|
|
9
17
|
|
|
@@ -20,8 +28,18 @@ export declare class AttributeNames {
|
|
|
20
28
|
static readonly SPARK_EXTENDED_SH3_B: string;
|
|
21
29
|
static readonly UNUSED: string;
|
|
22
30
|
static readonly SHARK_ELLIPSOIDS: string;
|
|
31
|
+
static readonly SHARK_ELLIPSOIDS_COMPRESSED: string;
|
|
23
32
|
static readonly SHARK_SPHERICAL_HARMONICS: string;
|
|
33
|
+
static readonly COLOR: string;
|
|
24
34
|
static readonly OCTANT_OFFSETS: string;
|
|
35
|
+
static readonly SURFEL_OCTANT_OFFSETS: string;
|
|
36
|
+
static readonly SURFEL_COUNT: string;
|
|
37
|
+
static readonly SURFEL_OWNER_GROUPS: string;
|
|
38
|
+
static readonly OCTANT_CELL: string;
|
|
39
|
+
static readonly REFLECTANCE_DATA_V1: string;
|
|
40
|
+
static readonly GLASS_MESH_GEOMETRY: string;
|
|
41
|
+
static readonly GLASS_MESH_PANELS: string;
|
|
42
|
+
static readonly MOD_DEPTH: string;
|
|
25
43
|
}
|
|
26
44
|
|
|
27
45
|
declare type CachedAttribute = {
|
|
@@ -33,6 +51,8 @@ export declare class Camera {
|
|
|
33
51
|
#private;
|
|
34
52
|
readonly id: number;
|
|
35
53
|
update(): void;
|
|
54
|
+
get viewportHeight(): number;
|
|
55
|
+
set viewportHeight(viewportHeight: number);
|
|
36
56
|
get aspect(): number;
|
|
37
57
|
set aspect(aspect: number);
|
|
38
58
|
get fov(): number;
|
|
@@ -46,7 +66,7 @@ export declare class Camera {
|
|
|
46
66
|
readonly engine: Engine;
|
|
47
67
|
readonly miris: Miris;
|
|
48
68
|
readonly scene: Scene;
|
|
49
|
-
constructor({ aspect, fov, near, far, matrix, scene }: CameraInit);
|
|
69
|
+
constructor({ aspect, fov, near, far, matrix, scene, viewportHeight, }: CameraInit);
|
|
50
70
|
}
|
|
51
71
|
|
|
52
72
|
export declare type CameraInit = {
|
|
@@ -56,6 +76,7 @@ export declare type CameraInit = {
|
|
|
56
76
|
far: number;
|
|
57
77
|
matrix: Matrix4x4Tuple;
|
|
58
78
|
scene: Scene;
|
|
79
|
+
viewportHeight?: number;
|
|
59
80
|
};
|
|
60
81
|
|
|
61
82
|
export declare class Change {
|
|
@@ -107,6 +128,8 @@ declare class Client {
|
|
|
107
128
|
hasFeature(...args: ClientMethodParameters["hasFeature"]): boolean;
|
|
108
129
|
getFeatureVersion(...args: ClientMethodParameters["getFeatureVersion"]): number;
|
|
109
130
|
getFeatureState(...args: ClientMethodParameters["getFeatureState"]): number;
|
|
131
|
+
getAssetFormatVersion(...args: ClientMethodParameters["getAssetFormatVersion"]): number;
|
|
132
|
+
getDrMapLadderRoughnessLevels(...args: ClientMethodParameters["getDrMapLadderRoughnessLevels"]): number[];
|
|
110
133
|
getName(...args: ClientMethodParameters["getName"]): string;
|
|
111
134
|
setVariantSelection(...args: ClientMethodParameters["setVariantSelection"]): AquaStatus;
|
|
112
135
|
takeAttribute(...args: ClientMethodParameters["takeAttribute"]): AquaStatus;
|
|
@@ -114,7 +137,6 @@ declare class Client {
|
|
|
114
137
|
takeRenderRequired(...args: ClientMethodParameters["takeRenderRequired"]): boolean;
|
|
115
138
|
unlockScene(...args: ClientMethodParameters["unlockScene"]): boolean;
|
|
116
139
|
updateSceneExecution(...args: ClientMethodParameters["updateSceneExecution"]): AquaStatus;
|
|
117
|
-
recordFrameTime(...args: ClientMethodParameters["recordFrameTime"]): AquaStatus;
|
|
118
140
|
}
|
|
119
141
|
|
|
120
142
|
declare type ClientInit = {
|
|
@@ -178,6 +200,10 @@ declare class Engine {
|
|
|
178
200
|
get module(): MainModule;
|
|
179
201
|
constructor(moduleOptions?: Record<string, unknown>);
|
|
180
202
|
get AttributeInfo(): new () => AttributeInfo;
|
|
203
|
+
get CompressionType(): {
|
|
204
|
+
SHARK_ELLIPSOID_COMPRESSED: unknown;
|
|
205
|
+
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE: unknown;
|
|
206
|
+
};
|
|
181
207
|
get Handedness(): {
|
|
182
208
|
Right: number;
|
|
183
209
|
Left: number;
|
|
@@ -224,8 +250,8 @@ declare class Engine {
|
|
|
224
250
|
attributeName: string,
|
|
225
251
|
attributeInfo: AttributeInfo
|
|
226
252
|
]): AquaStatus;
|
|
227
|
-
getDefaultCameraId(...args: [handle: AquaClientHandle]): number;
|
|
228
|
-
getViewingVolumeId(...args: [handle: AquaClientHandle]): number;
|
|
253
|
+
getDefaultCameraId(...args: [handle: AquaClientHandle, streamObjectId: number]): number;
|
|
254
|
+
getViewingVolumeId(...args: [handle: AquaClientHandle, streamObjectId: number]): number;
|
|
229
255
|
getLocalBoundingBox(...args: [handle: AquaClientHandle, sceneObjectId: number, boxData: number]): AquaStatus;
|
|
230
256
|
getWorldBoundingBox(...args: [handle: AquaClientHandle, sceneObjectId: number, boxData: number]): AquaStatus;
|
|
231
257
|
getLodIndex(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
@@ -281,9 +307,11 @@ declare class Engine {
|
|
|
281
307
|
aspectRatio: number,
|
|
282
308
|
verticalFov: number,
|
|
283
309
|
nearPlane: number,
|
|
284
|
-
farPlane: number
|
|
310
|
+
farPlane: number,
|
|
311
|
+
viewportHeightPixels: number
|
|
285
312
|
]): AquaStatus;
|
|
286
313
|
setMaxCacheSize(...args: [maxSizeBytes: number]): void;
|
|
314
|
+
setPreferSharkEncodingProfiles(...args: [preferShark: boolean]): void;
|
|
287
315
|
setSceneObjectTransform(...args: [
|
|
288
316
|
handle: AquaClientHandle,
|
|
289
317
|
sceneObjectId: number,
|
|
@@ -292,6 +320,8 @@ declare class Engine {
|
|
|
292
320
|
hasFeature(...args: [handle: AquaClientHandle, sceneObjectId: number, feature: number]): boolean;
|
|
293
321
|
getFeatureVersion(...args: [handle: AquaClientHandle, sceneObjectId: number, feature: number]): number;
|
|
294
322
|
getFeatureState(...args: [handle: AquaClientHandle, sceneObjectId: number, feature: number]): number;
|
|
323
|
+
getDrMapLadderRoughnessLevels(...args: [handle: AquaClientHandle, sceneObjectId: number]): number[];
|
|
324
|
+
getAssetFormatVersion(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
295
325
|
getName(...args: [handle: AquaClientHandle, sceneObjectId: number]): string;
|
|
296
326
|
setVariantSelection(...args: [handle: AquaClientHandle, sceneObjectId: number]): AquaStatus;
|
|
297
327
|
takeAttribute(...args: [
|
|
@@ -304,8 +334,15 @@ declare class Engine {
|
|
|
304
334
|
getActiveClientSideIdsCheckSum(): number;
|
|
305
335
|
unlockScene(...args: [handle: AquaClientHandle]): boolean;
|
|
306
336
|
updateSceneExecution(...args: [handle: AquaClientHandle]): AquaStatus;
|
|
307
|
-
recordFrameTime(...args: [handle: AquaClientHandle, frameTimeMs: number]): AquaStatus;
|
|
308
337
|
takeRenderRequired(...args: [handle: AquaClientHandle]): boolean;
|
|
338
|
+
/**
|
|
339
|
+
* Advances the runtime by one frame and recomputes the streaming budget. Call once per
|
|
340
|
+
* displayed frame per context, before the per-client updateSceneExecution() calls.
|
|
341
|
+
* `previousFrameTimeMs` is how long the previous frame took; pass 0 when there is no plausible
|
|
342
|
+
* measurement (first frame, or a resume from a stall) and the frame advances without recording
|
|
343
|
+
* one.
|
|
344
|
+
*/
|
|
345
|
+
beginFrame(...args: [contextHandle: AquaContextHandle, previousFrameTimeMs: number]): AquaStatus;
|
|
309
346
|
createDeserializeWorker(_url: string, _workerUrl: string, poolSize: number): boolean;
|
|
310
347
|
cancelRequest(requestIdLow: number, requestIdHigh: number): boolean;
|
|
311
348
|
submitToWorker(requestIdLow: number, requestIdHigh: number, descriptorBuffer: ArrayBuffer, contextPtr: number): boolean;
|
|
@@ -351,9 +388,15 @@ export declare class Lod {
|
|
|
351
388
|
set _drawnOctantMask(mask: number);
|
|
352
389
|
get _octantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
353
390
|
get _hasOctantOffsets(): boolean;
|
|
391
|
+
get _surfelOctantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
392
|
+
get _surfelCount(): number;
|
|
393
|
+
get _surfelOwnerGroups(): Uint32Array<ArrayBuffer> | null;
|
|
394
|
+
get _octantCell(): Uint32Array<ArrayBuffer> | null;
|
|
354
395
|
_readOctantOffsets(engine: Engine): void;
|
|
355
396
|
hasAttribute(attributeName: string): boolean;
|
|
356
397
|
getDataFromAttribute(engine: Engine, attributeName: string, attributeInfo: AttributeInfo): CachedAttribute | null;
|
|
398
|
+
_getRawByteAttribute(engine: Engine, attributeName: string): Uint8Array<ArrayBuffer> | null;
|
|
399
|
+
_getRawByteAttributeWithBounds(engine: Engine, attributeName: string): RawByteAttributeWithBounds | null;
|
|
357
400
|
dispose(): void;
|
|
358
401
|
constructor({ id, modelRoot, lodStore, client }: LodInit);
|
|
359
402
|
}
|
|
@@ -378,6 +421,10 @@ export declare class LodStore {
|
|
|
378
421
|
|
|
379
422
|
declare interface MainModule {
|
|
380
423
|
AttributeInfo: new () => AttributeInfo;
|
|
424
|
+
CompressionType: {
|
|
425
|
+
SHARK_ELLIPSOID_COMPRESSED: unknown;
|
|
426
|
+
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE: unknown;
|
|
427
|
+
};
|
|
381
428
|
Handedness: { Right: number; Left: number };
|
|
382
429
|
HEAPF32: Float32Array<ArrayBuffer>;
|
|
383
430
|
HEAPU8: Uint8Array<ArrayBuffer>;
|
|
@@ -414,13 +461,17 @@ declare interface MainModule {
|
|
|
414
461
|
HasFeature(handle: number, sceneObjectId: number, feature: number): boolean;
|
|
415
462
|
GetFeatureVersion(handle: number, sceneObjectId: number, feature: number): number;
|
|
416
463
|
GetFeatureState(handle: number, sceneObjectId: number, feature: number): number;
|
|
464
|
+
GetAssetFormatVersion(handle: number, sceneObjectId: number): number;
|
|
465
|
+
GetDrMapLadderRoughnessLevels(handle: number, sceneObjectId: number): number[];
|
|
417
466
|
SetClientSpatialFormat(handle: number, spatialFormat: SpatialFormat): { value: number };
|
|
418
467
|
SetRuntimeSettings(handle: number, settings: RuntimeSettings): { value: number };
|
|
419
468
|
TakeEvictedClientSideAttributeIds(handle: number): EmbindVector<bigint>;
|
|
420
469
|
GetActiveClientSideIdsCheckSum(): number;
|
|
421
470
|
TakeRenderRequired(handle: number): boolean;
|
|
471
|
+
BeginFrame(contextHandle: number, previousFrameTimeMs: number): number;
|
|
422
472
|
modifiedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
423
473
|
setMaxCacheSize(maxSizeBytes: number): void;
|
|
474
|
+
SetPreferSharkEncodingProfiles(prefer: boolean): void;
|
|
424
475
|
}
|
|
425
476
|
|
|
426
477
|
/**
|
|
@@ -452,17 +503,27 @@ export declare class Miris {
|
|
|
452
503
|
protected _xrSession: XRSession | null;
|
|
453
504
|
protected _requestAnimationFrame: RequestAnimationFrameFn | null;
|
|
454
505
|
signalResumeFromIdle(): void;
|
|
506
|
+
get _splatCountBudget(): number;
|
|
455
507
|
/**
|
|
456
508
|
* Why 43? Because the AVP throttles down to 45Hz :(
|
|
457
509
|
*/
|
|
458
510
|
static readonly _XR_TARGET_FRAME_RATE = 43;
|
|
511
|
+
/* Excluded from this release type: _XR_SPLAT_COUNT_BUDGET */
|
|
512
|
+
/* Excluded from this release type: _SHARK_SPLAT_CAPACITY_MOBILE */
|
|
513
|
+
static readonly _SHARK_SPLAT_CAPACITY_DESKTOP = 3000000;
|
|
514
|
+
/* Excluded from this release type: _SHARK_SPLAT_BUDGET_CAP_MOBILE */
|
|
515
|
+
static readonly _SHARK_SPLAT_BUDGET_CAP_DESKTOP = 2500000;
|
|
516
|
+
/* Excluded from this release type: _isMobileDevice */
|
|
517
|
+
/* Excluded from this release type: _sharkSplatCapacity */
|
|
518
|
+
/* Excluded from this release type: _limitSharkSplatCapacity */
|
|
519
|
+
/* Excluded from this release type: _sharkSplatBudgetCap */
|
|
459
520
|
/* Excluded from this release type: _setTargetFrameRate */
|
|
460
521
|
/* Excluded from this release type: _setXRModeActive */
|
|
461
522
|
/* Excluded from this release type: _setSplatCountBudgetOverride */
|
|
462
523
|
/* Excluded from this release type: _update */
|
|
463
524
|
getLocalTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
464
525
|
getWorldTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
465
|
-
|
|
526
|
+
/* Excluded from this release type: _updateForScene */
|
|
466
527
|
applyChanges(_entries: Change[]): void;
|
|
467
528
|
_computeAdditionalRenderNeeded(): boolean;
|
|
468
529
|
onColorSpaceDetected(_isLinear: boolean): void;
|
|
@@ -491,6 +552,28 @@ export declare type ModelRootInit = {
|
|
|
491
552
|
stream: Stream;
|
|
492
553
|
};
|
|
493
554
|
|
|
555
|
+
/**
|
|
556
|
+
* The byte-exact counterpart of getRawUint32Attribute above: same no-padding, no-takeAttribute
|
|
557
|
+
* contract, returning bytes rather than words.
|
|
558
|
+
*
|
|
559
|
+
* Use this rather than that one wherever the stride is not a whole number of words:
|
|
560
|
+
* reflectanceDataV1's 26-byte record is not, and an odd record count would lose that record's
|
|
561
|
+
* last field to dataPtrView's truncation.
|
|
562
|
+
*/
|
|
563
|
+
export declare type RawByteAttributeWithBounds = {
|
|
564
|
+
bytes: Uint8Array<ArrayBuffer>;
|
|
565
|
+
minValue: {
|
|
566
|
+
x: number;
|
|
567
|
+
y: number;
|
|
568
|
+
z: number;
|
|
569
|
+
};
|
|
570
|
+
maxValue: {
|
|
571
|
+
x: number;
|
|
572
|
+
y: number;
|
|
573
|
+
z: number;
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
|
|
494
577
|
declare type RequestAnimationFrameFn = ((callback: FrameRequestCallback) => number) | ((callback: XRFrameRequestCallback) => void);
|
|
495
578
|
|
|
496
579
|
declare interface RuntimeSettings extends EmbindObject {
|
|
@@ -499,6 +582,7 @@ declare interface RuntimeSettings extends EmbindObject {
|
|
|
499
582
|
targetFramesPerSecond: number;
|
|
500
583
|
xrModeActive: boolean;
|
|
501
584
|
splatCountBudget: number;
|
|
585
|
+
splatCountBudgetCap: number;
|
|
502
586
|
}
|
|
503
587
|
|
|
504
588
|
export declare class Scene extends EventTarget {
|
|
@@ -510,6 +594,7 @@ export declare class Scene extends EventTarget {
|
|
|
510
594
|
readonly id: number;
|
|
511
595
|
get key(): unknown;
|
|
512
596
|
set key(key: unknown);
|
|
597
|
+
/* Excluded from this release type: _assetFormat */
|
|
513
598
|
get viewerKey(): string | null;
|
|
514
599
|
set viewerKey(viewerKey: string | null);
|
|
515
600
|
get streams(): Set<Stream>;
|
|
@@ -519,21 +604,33 @@ export declare class Scene extends EventTarget {
|
|
|
519
604
|
readonly client: Client;
|
|
520
605
|
readonly handle?: number;
|
|
521
606
|
constructor({ miris, viewerKey }: SceneInit);
|
|
607
|
+
/**
|
|
608
|
+
* Drives a frame and answers whether *this* scene's canvas needs repainting. Call it once per
|
|
609
|
+
* displayed frame from the host's animation loop, and render when it returns true.
|
|
610
|
+
*
|
|
611
|
+
* Every scene on the page calls this from its own loop. The first call in a displayed frame
|
|
612
|
+
* drives one engine tick for all of them; the rest recognise the frame and reuse it.
|
|
613
|
+
*
|
|
614
|
+
* @param ts the host's frame timestamp. Optional - the document timeline supplies one, and it
|
|
615
|
+
* reads the same for every scene in a displayed frame. Pass it when the host runs its own
|
|
616
|
+
* clock, as an immersive XR session does, because XRFrame time is not the document timeline.
|
|
617
|
+
*/
|
|
618
|
+
update(ts?: DOMHighResTimeStamp): boolean;
|
|
522
619
|
dispose(): void;
|
|
523
|
-
/* Excluded from this release type: _getViewingVolumeObb */
|
|
524
620
|
fetchAssets(tags?: string | Iterable<string>): Promise<{
|
|
525
621
|
name: string;
|
|
526
622
|
thumbnailUrl: string;
|
|
527
623
|
uuid: string;
|
|
528
624
|
tags: string[];
|
|
529
625
|
}[]>;
|
|
530
|
-
getDefaultCameraTransform(): Float32Array<ArrayBuffer> | null | undefined;
|
|
531
626
|
add(stream: Stream): void;
|
|
532
627
|
getStreamForId(streamObjectId: number): Stream | undefined;
|
|
533
628
|
getStreamForDescendentId(descendentObjectId: number): Stream | null;
|
|
534
629
|
getModelRootForDescendentId(descendentObjectId: number): ModelRoot | null;
|
|
630
|
+
_recordAssetFormat(modelRoot: ModelRoot, formatVersion: number): void;
|
|
535
631
|
/* Excluded from this release type: _getFeatureMesh */
|
|
536
632
|
/* Excluded from this release type: _getDrMap */
|
|
633
|
+
/* Excluded from this release type: _onDrMapLadder */
|
|
537
634
|
/* Excluded from this release type: _onFeatureData */
|
|
538
635
|
/* Excluded from this release type: _onSceneLoaded */
|
|
539
636
|
delete(stream: Stream): void;
|
|
@@ -624,6 +721,8 @@ export declare class Stream extends EventTarget {
|
|
|
624
721
|
constructor(options: StreamInit);
|
|
625
722
|
_initStream({ uuid }: StreamInit): void;
|
|
626
723
|
/* Excluded from this release type: _onStreamLoaded */
|
|
724
|
+
getDefaultCameraTransform(): Float32Array<ArrayBuffer> | null | undefined;
|
|
725
|
+
/* Excluded from this release type: _getViewingVolumeObb */
|
|
627
726
|
/* Excluded from this release type: _onRootLoaded */
|
|
628
727
|
add(modelRoot: ModelRoot): void;
|
|
629
728
|
end(): void;
|