@miris-inc/core 0.0.8-5ccc417 → 0.0.8-5e5c0db
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 +107 -11
- package/dist/core.js +416 -74
- package/dist/core.prod.js +1 -1
- package/dist/core.standalone.js +895 -533
- package/dist/core.standalone.prod.js +1 -1
- package/package.json +8 -1
- package/webshark.d.ts +321 -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,19 @@ 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 REFLECTANCE_DATA_V2: string;
|
|
41
|
+
static readonly GLASS_MESH_GEOMETRY: string;
|
|
42
|
+
static readonly GLASS_MESH_PANELS: string;
|
|
43
|
+
static readonly MOD_DEPTH: string;
|
|
25
44
|
}
|
|
26
45
|
|
|
27
46
|
declare type CachedAttribute = {
|
|
@@ -110,6 +129,8 @@ declare class Client {
|
|
|
110
129
|
hasFeature(...args: ClientMethodParameters["hasFeature"]): boolean;
|
|
111
130
|
getFeatureVersion(...args: ClientMethodParameters["getFeatureVersion"]): number;
|
|
112
131
|
getFeatureState(...args: ClientMethodParameters["getFeatureState"]): number;
|
|
132
|
+
getAssetFormatVersion(...args: ClientMethodParameters["getAssetFormatVersion"]): number;
|
|
133
|
+
getDrMapLadderRoughnessLevels(...args: ClientMethodParameters["getDrMapLadderRoughnessLevels"]): number[];
|
|
113
134
|
getName(...args: ClientMethodParameters["getName"]): string;
|
|
114
135
|
setVariantSelection(...args: ClientMethodParameters["setVariantSelection"]): AquaStatus;
|
|
115
136
|
takeAttribute(...args: ClientMethodParameters["takeAttribute"]): AquaStatus;
|
|
@@ -117,7 +138,6 @@ declare class Client {
|
|
|
117
138
|
takeRenderRequired(...args: ClientMethodParameters["takeRenderRequired"]): boolean;
|
|
118
139
|
unlockScene(...args: ClientMethodParameters["unlockScene"]): boolean;
|
|
119
140
|
updateSceneExecution(...args: ClientMethodParameters["updateSceneExecution"]): AquaStatus;
|
|
120
|
-
recordFrameTime(...args: ClientMethodParameters["recordFrameTime"]): AquaStatus;
|
|
121
141
|
}
|
|
122
142
|
|
|
123
143
|
declare type ClientInit = {
|
|
@@ -181,6 +201,10 @@ declare class Engine {
|
|
|
181
201
|
get module(): MainModule;
|
|
182
202
|
constructor(moduleOptions?: Record<string, unknown>);
|
|
183
203
|
get AttributeInfo(): new () => AttributeInfo;
|
|
204
|
+
get CompressionType(): {
|
|
205
|
+
SHARK_ELLIPSOID_COMPRESSED: unknown;
|
|
206
|
+
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE: unknown;
|
|
207
|
+
};
|
|
184
208
|
get Handedness(): {
|
|
185
209
|
Right: number;
|
|
186
210
|
Left: number;
|
|
@@ -227,8 +251,8 @@ declare class Engine {
|
|
|
227
251
|
attributeName: string,
|
|
228
252
|
attributeInfo: AttributeInfo
|
|
229
253
|
]): AquaStatus;
|
|
230
|
-
getDefaultCameraId(...args: [handle: AquaClientHandle]): number;
|
|
231
|
-
getViewingVolumeId(...args: [handle: AquaClientHandle]): number;
|
|
254
|
+
getDefaultCameraId(...args: [handle: AquaClientHandle, streamObjectId: number]): number;
|
|
255
|
+
getViewingVolumeId(...args: [handle: AquaClientHandle, streamObjectId: number]): number;
|
|
232
256
|
getLocalBoundingBox(...args: [handle: AquaClientHandle, sceneObjectId: number, boxData: number]): AquaStatus;
|
|
233
257
|
getWorldBoundingBox(...args: [handle: AquaClientHandle, sceneObjectId: number, boxData: number]): AquaStatus;
|
|
234
258
|
getLodIndex(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
@@ -288,6 +312,7 @@ declare class Engine {
|
|
|
288
312
|
viewportHeightPixels: number
|
|
289
313
|
]): AquaStatus;
|
|
290
314
|
setMaxCacheSize(...args: [maxSizeBytes: number]): void;
|
|
315
|
+
setPreferSharkEncodingProfiles(...args: [preferShark: boolean]): void;
|
|
291
316
|
setSceneObjectTransform(...args: [
|
|
292
317
|
handle: AquaClientHandle,
|
|
293
318
|
sceneObjectId: number,
|
|
@@ -296,6 +321,8 @@ declare class Engine {
|
|
|
296
321
|
hasFeature(...args: [handle: AquaClientHandle, sceneObjectId: number, feature: number]): boolean;
|
|
297
322
|
getFeatureVersion(...args: [handle: AquaClientHandle, sceneObjectId: number, feature: number]): number;
|
|
298
323
|
getFeatureState(...args: [handle: AquaClientHandle, sceneObjectId: number, feature: number]): number;
|
|
324
|
+
getDrMapLadderRoughnessLevels(...args: [handle: AquaClientHandle, sceneObjectId: number]): number[];
|
|
325
|
+
getAssetFormatVersion(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
299
326
|
getName(...args: [handle: AquaClientHandle, sceneObjectId: number]): string;
|
|
300
327
|
setVariantSelection(...args: [handle: AquaClientHandle, sceneObjectId: number]): AquaStatus;
|
|
301
328
|
takeAttribute(...args: [
|
|
@@ -308,8 +335,15 @@ declare class Engine {
|
|
|
308
335
|
getActiveClientSideIdsCheckSum(): number;
|
|
309
336
|
unlockScene(...args: [handle: AquaClientHandle]): boolean;
|
|
310
337
|
updateSceneExecution(...args: [handle: AquaClientHandle]): AquaStatus;
|
|
311
|
-
recordFrameTime(...args: [handle: AquaClientHandle, frameTimeMs: number]): AquaStatus;
|
|
312
338
|
takeRenderRequired(...args: [handle: AquaClientHandle]): boolean;
|
|
339
|
+
/**
|
|
340
|
+
* Advances the runtime by one frame and recomputes the streaming budget. Call once per
|
|
341
|
+
* displayed frame per context, before the per-client updateSceneExecution() calls.
|
|
342
|
+
* `previousFrameTimeMs` is how long the previous frame took; pass 0 when there is no plausible
|
|
343
|
+
* measurement (first frame, or a resume from a stall) and the frame advances without recording
|
|
344
|
+
* one.
|
|
345
|
+
*/
|
|
346
|
+
beginFrame(...args: [contextHandle: AquaContextHandle, previousFrameTimeMs: number]): AquaStatus;
|
|
313
347
|
createDeserializeWorker(_url: string, _workerUrl: string, poolSize: number): boolean;
|
|
314
348
|
cancelRequest(requestIdLow: number, requestIdHigh: number): boolean;
|
|
315
349
|
submitToWorker(requestIdLow: number, requestIdHigh: number, descriptorBuffer: ArrayBuffer, contextPtr: number): boolean;
|
|
@@ -355,9 +389,15 @@ export declare class Lod {
|
|
|
355
389
|
set _drawnOctantMask(mask: number);
|
|
356
390
|
get _octantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
357
391
|
get _hasOctantOffsets(): boolean;
|
|
392
|
+
get _surfelOctantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
393
|
+
get _surfelCount(): number;
|
|
394
|
+
get _surfelOwnerGroups(): Uint32Array<ArrayBuffer> | null;
|
|
395
|
+
get _octantCell(): Uint32Array<ArrayBuffer> | null;
|
|
358
396
|
_readOctantOffsets(engine: Engine): void;
|
|
359
397
|
hasAttribute(attributeName: string): boolean;
|
|
360
398
|
getDataFromAttribute(engine: Engine, attributeName: string, attributeInfo: AttributeInfo): CachedAttribute | null;
|
|
399
|
+
_getRawByteAttribute(engine: Engine, attributeName: string): Uint8Array<ArrayBuffer> | null;
|
|
400
|
+
_getRawByteAttributeWithBounds(engine: Engine, attributeName: string): RawByteAttributeWithBounds | null;
|
|
361
401
|
dispose(): void;
|
|
362
402
|
constructor({ id, modelRoot, lodStore, client }: LodInit);
|
|
363
403
|
}
|
|
@@ -382,6 +422,10 @@ export declare class LodStore {
|
|
|
382
422
|
|
|
383
423
|
declare interface MainModule {
|
|
384
424
|
AttributeInfo: new () => AttributeInfo;
|
|
425
|
+
CompressionType: {
|
|
426
|
+
SHARK_ELLIPSOID_COMPRESSED: unknown;
|
|
427
|
+
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE: unknown;
|
|
428
|
+
};
|
|
385
429
|
Handedness: { Right: number; Left: number };
|
|
386
430
|
HEAPF32: Float32Array<ArrayBuffer>;
|
|
387
431
|
HEAPU8: Uint8Array<ArrayBuffer>;
|
|
@@ -418,13 +462,17 @@ declare interface MainModule {
|
|
|
418
462
|
HasFeature(handle: number, sceneObjectId: number, feature: number): boolean;
|
|
419
463
|
GetFeatureVersion(handle: number, sceneObjectId: number, feature: number): number;
|
|
420
464
|
GetFeatureState(handle: number, sceneObjectId: number, feature: number): number;
|
|
465
|
+
GetAssetFormatVersion(handle: number, sceneObjectId: number): number;
|
|
466
|
+
GetDrMapLadderRoughnessLevels(handle: number, sceneObjectId: number): number[];
|
|
421
467
|
SetClientSpatialFormat(handle: number, spatialFormat: SpatialFormat): { value: number };
|
|
422
468
|
SetRuntimeSettings(handle: number, settings: RuntimeSettings): { value: number };
|
|
423
469
|
TakeEvictedClientSideAttributeIds(handle: number): EmbindVector<bigint>;
|
|
424
470
|
GetActiveClientSideIdsCheckSum(): number;
|
|
425
471
|
TakeRenderRequired(handle: number): boolean;
|
|
472
|
+
BeginFrame(contextHandle: number, previousFrameTimeMs: number): number;
|
|
426
473
|
modifiedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
427
474
|
setMaxCacheSize(maxSizeBytes: number): void;
|
|
475
|
+
SetPreferSharkEncodingProfiles(prefer: boolean): void;
|
|
428
476
|
}
|
|
429
477
|
|
|
430
478
|
/**
|
|
@@ -456,17 +504,27 @@ export declare class Miris {
|
|
|
456
504
|
protected _xrSession: XRSession | null;
|
|
457
505
|
protected _requestAnimationFrame: RequestAnimationFrameFn | null;
|
|
458
506
|
signalResumeFromIdle(): void;
|
|
507
|
+
get _splatCountBudget(): number;
|
|
459
508
|
/**
|
|
460
509
|
* Why 43? Because the AVP throttles down to 45Hz :(
|
|
461
510
|
*/
|
|
462
511
|
static readonly _XR_TARGET_FRAME_RATE = 43;
|
|
512
|
+
/* Excluded from this release type: _XR_SPLAT_COUNT_BUDGET */
|
|
513
|
+
/* Excluded from this release type: _SHARK_SPLAT_CAPACITY_MOBILE */
|
|
514
|
+
static readonly _SHARK_SPLAT_CAPACITY_DESKTOP = 3000000;
|
|
515
|
+
/* Excluded from this release type: _SHARK_SPLAT_BUDGET_CAP_MOBILE */
|
|
516
|
+
static readonly _SHARK_SPLAT_BUDGET_CAP_DESKTOP = 2500000;
|
|
517
|
+
/* Excluded from this release type: _isMobileDevice */
|
|
518
|
+
/* Excluded from this release type: _sharkSplatCapacity */
|
|
519
|
+
/* Excluded from this release type: _limitSharkSplatCapacity */
|
|
520
|
+
/* Excluded from this release type: _sharkSplatBudgetCap */
|
|
463
521
|
/* Excluded from this release type: _setTargetFrameRate */
|
|
464
522
|
/* Excluded from this release type: _setXRModeActive */
|
|
465
523
|
/* Excluded from this release type: _setSplatCountBudgetOverride */
|
|
466
524
|
/* Excluded from this release type: _update */
|
|
467
525
|
getLocalTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
468
526
|
getWorldTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
469
|
-
|
|
527
|
+
/* Excluded from this release type: _updateForScene */
|
|
470
528
|
applyChanges(_entries: Change[]): void;
|
|
471
529
|
_computeAdditionalRenderNeeded(): boolean;
|
|
472
530
|
onColorSpaceDetected(_isLinear: boolean): void;
|
|
@@ -495,6 +553,28 @@ export declare type ModelRootInit = {
|
|
|
495
553
|
stream: Stream;
|
|
496
554
|
};
|
|
497
555
|
|
|
556
|
+
/**
|
|
557
|
+
* The byte-exact counterpart of getRawUint32Attribute above: same no-padding, no-takeAttribute
|
|
558
|
+
* contract, returning bytes rather than words.
|
|
559
|
+
*
|
|
560
|
+
* Use this rather than that one wherever the stride is not a whole number of words: the
|
|
561
|
+
* reflectance records' 18- and 26-byte strides are not, and an odd record count would lose that
|
|
562
|
+
* record's last field to dataPtrView's truncation.
|
|
563
|
+
*/
|
|
564
|
+
export declare type RawByteAttributeWithBounds = {
|
|
565
|
+
bytes: Uint8Array<ArrayBuffer>;
|
|
566
|
+
minValue: {
|
|
567
|
+
x: number;
|
|
568
|
+
y: number;
|
|
569
|
+
z: number;
|
|
570
|
+
};
|
|
571
|
+
maxValue: {
|
|
572
|
+
x: number;
|
|
573
|
+
y: number;
|
|
574
|
+
z: number;
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
|
|
498
578
|
declare type RequestAnimationFrameFn = ((callback: FrameRequestCallback) => number) | ((callback: XRFrameRequestCallback) => void);
|
|
499
579
|
|
|
500
580
|
declare interface RuntimeSettings extends EmbindObject {
|
|
@@ -503,6 +583,7 @@ declare interface RuntimeSettings extends EmbindObject {
|
|
|
503
583
|
targetFramesPerSecond: number;
|
|
504
584
|
xrModeActive: boolean;
|
|
505
585
|
splatCountBudget: number;
|
|
586
|
+
splatCountBudgetCap: number;
|
|
506
587
|
}
|
|
507
588
|
|
|
508
589
|
export declare class Scene extends EventTarget {
|
|
@@ -514,6 +595,7 @@ export declare class Scene extends EventTarget {
|
|
|
514
595
|
readonly id: number;
|
|
515
596
|
get key(): unknown;
|
|
516
597
|
set key(key: unknown);
|
|
598
|
+
/* Excluded from this release type: _assetFormat */
|
|
517
599
|
get viewerKey(): string | null;
|
|
518
600
|
set viewerKey(viewerKey: string | null);
|
|
519
601
|
get streams(): Set<Stream>;
|
|
@@ -523,21 +605,33 @@ export declare class Scene extends EventTarget {
|
|
|
523
605
|
readonly client: Client;
|
|
524
606
|
readonly handle?: number;
|
|
525
607
|
constructor({ miris, viewerKey }: SceneInit);
|
|
608
|
+
/**
|
|
609
|
+
* Drives a frame and answers whether *this* scene's canvas needs repainting. Call it once per
|
|
610
|
+
* displayed frame from the host's animation loop, and render when it returns true.
|
|
611
|
+
*
|
|
612
|
+
* Every scene on the page calls this from its own loop. The first call in a displayed frame
|
|
613
|
+
* drives one engine tick for all of them; the rest recognise the frame and reuse it.
|
|
614
|
+
*
|
|
615
|
+
* @param ts the host's frame timestamp. Optional - the document timeline supplies one, and it
|
|
616
|
+
* reads the same for every scene in a displayed frame. Pass it when the host runs its own
|
|
617
|
+
* clock, as an immersive XR session does, because XRFrame time is not the document timeline.
|
|
618
|
+
*/
|
|
619
|
+
update(ts?: DOMHighResTimeStamp): boolean;
|
|
526
620
|
dispose(): void;
|
|
527
|
-
/* Excluded from this release type: _getViewingVolumeObb */
|
|
528
621
|
fetchAssets(tags?: string | Iterable<string>): Promise<{
|
|
529
622
|
name: string;
|
|
530
623
|
thumbnailUrl: string;
|
|
531
624
|
uuid: string;
|
|
532
625
|
tags: string[];
|
|
533
626
|
}[]>;
|
|
534
|
-
getDefaultCameraTransform(): Float32Array<ArrayBuffer> | null | undefined;
|
|
535
627
|
add(stream: Stream): void;
|
|
536
628
|
getStreamForId(streamObjectId: number): Stream | undefined;
|
|
537
629
|
getStreamForDescendentId(descendentObjectId: number): Stream | null;
|
|
538
630
|
getModelRootForDescendentId(descendentObjectId: number): ModelRoot | null;
|
|
631
|
+
_recordAssetFormat(modelRoot: ModelRoot, formatVersion: number): void;
|
|
539
632
|
/* Excluded from this release type: _getFeatureMesh */
|
|
540
633
|
/* Excluded from this release type: _getDrMap */
|
|
634
|
+
/* Excluded from this release type: _onDrMapLadder */
|
|
541
635
|
/* Excluded from this release type: _onFeatureData */
|
|
542
636
|
/* Excluded from this release type: _onSceneLoaded */
|
|
543
637
|
delete(stream: Stream): void;
|
|
@@ -628,6 +722,8 @@ export declare class Stream extends EventTarget {
|
|
|
628
722
|
constructor(options: StreamInit);
|
|
629
723
|
_initStream({ uuid }: StreamInit): void;
|
|
630
724
|
/* Excluded from this release type: _onStreamLoaded */
|
|
725
|
+
getDefaultCameraTransform(): Float32Array<ArrayBuffer> | null | undefined;
|
|
726
|
+
/* Excluded from this release type: _getViewingVolumeObb */
|
|
631
727
|
/* Excluded from this release type: _onRootLoaded */
|
|
632
728
|
add(modelRoot: ModelRoot): void;
|
|
633
729
|
end(): void;
|