@miris-inc/core 0.0.8-14e5abe → 0.0.8-16ba21d
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 +105 -11
- package/dist/core.js +401 -73
- package/dist/core.prod.js +1 -1
- package/dist/core.standalone.js +798 -450
- 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 = {
|
|
@@ -110,6 +128,8 @@ declare class Client {
|
|
|
110
128
|
hasFeature(...args: ClientMethodParameters["hasFeature"]): boolean;
|
|
111
129
|
getFeatureVersion(...args: ClientMethodParameters["getFeatureVersion"]): number;
|
|
112
130
|
getFeatureState(...args: ClientMethodParameters["getFeatureState"]): number;
|
|
131
|
+
getAssetFormatVersion(...args: ClientMethodParameters["getAssetFormatVersion"]): number;
|
|
132
|
+
getDrMapLadderRoughnessLevels(...args: ClientMethodParameters["getDrMapLadderRoughnessLevels"]): number[];
|
|
113
133
|
getName(...args: ClientMethodParameters["getName"]): string;
|
|
114
134
|
setVariantSelection(...args: ClientMethodParameters["setVariantSelection"]): AquaStatus;
|
|
115
135
|
takeAttribute(...args: ClientMethodParameters["takeAttribute"]): AquaStatus;
|
|
@@ -117,7 +137,6 @@ declare class Client {
|
|
|
117
137
|
takeRenderRequired(...args: ClientMethodParameters["takeRenderRequired"]): boolean;
|
|
118
138
|
unlockScene(...args: ClientMethodParameters["unlockScene"]): boolean;
|
|
119
139
|
updateSceneExecution(...args: ClientMethodParameters["updateSceneExecution"]): AquaStatus;
|
|
120
|
-
recordFrameTime(...args: ClientMethodParameters["recordFrameTime"]): AquaStatus;
|
|
121
140
|
}
|
|
122
141
|
|
|
123
142
|
declare type ClientInit = {
|
|
@@ -181,6 +200,10 @@ declare class Engine {
|
|
|
181
200
|
get module(): MainModule;
|
|
182
201
|
constructor(moduleOptions?: Record<string, unknown>);
|
|
183
202
|
get AttributeInfo(): new () => AttributeInfo;
|
|
203
|
+
get CompressionType(): {
|
|
204
|
+
SHARK_ELLIPSOID_COMPRESSED: unknown;
|
|
205
|
+
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE: unknown;
|
|
206
|
+
};
|
|
184
207
|
get Handedness(): {
|
|
185
208
|
Right: number;
|
|
186
209
|
Left: number;
|
|
@@ -227,8 +250,8 @@ declare class Engine {
|
|
|
227
250
|
attributeName: string,
|
|
228
251
|
attributeInfo: AttributeInfo
|
|
229
252
|
]): AquaStatus;
|
|
230
|
-
getDefaultCameraId(...args: [handle: AquaClientHandle]): number;
|
|
231
|
-
getViewingVolumeId(...args: [handle: AquaClientHandle]): number;
|
|
253
|
+
getDefaultCameraId(...args: [handle: AquaClientHandle, streamObjectId: number]): number;
|
|
254
|
+
getViewingVolumeId(...args: [handle: AquaClientHandle, streamObjectId: number]): number;
|
|
232
255
|
getLocalBoundingBox(...args: [handle: AquaClientHandle, sceneObjectId: number, boxData: number]): AquaStatus;
|
|
233
256
|
getWorldBoundingBox(...args: [handle: AquaClientHandle, sceneObjectId: number, boxData: number]): AquaStatus;
|
|
234
257
|
getLodIndex(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
@@ -288,6 +311,7 @@ declare class Engine {
|
|
|
288
311
|
viewportHeightPixels: number
|
|
289
312
|
]): AquaStatus;
|
|
290
313
|
setMaxCacheSize(...args: [maxSizeBytes: number]): void;
|
|
314
|
+
setPreferSharkEncodingProfiles(...args: [preferShark: boolean]): void;
|
|
291
315
|
setSceneObjectTransform(...args: [
|
|
292
316
|
handle: AquaClientHandle,
|
|
293
317
|
sceneObjectId: number,
|
|
@@ -296,6 +320,8 @@ declare class Engine {
|
|
|
296
320
|
hasFeature(...args: [handle: AquaClientHandle, sceneObjectId: number, feature: number]): boolean;
|
|
297
321
|
getFeatureVersion(...args: [handle: AquaClientHandle, sceneObjectId: number, feature: number]): number;
|
|
298
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;
|
|
299
325
|
getName(...args: [handle: AquaClientHandle, sceneObjectId: number]): string;
|
|
300
326
|
setVariantSelection(...args: [handle: AquaClientHandle, sceneObjectId: number]): AquaStatus;
|
|
301
327
|
takeAttribute(...args: [
|
|
@@ -308,8 +334,15 @@ declare class Engine {
|
|
|
308
334
|
getActiveClientSideIdsCheckSum(): number;
|
|
309
335
|
unlockScene(...args: [handle: AquaClientHandle]): boolean;
|
|
310
336
|
updateSceneExecution(...args: [handle: AquaClientHandle]): AquaStatus;
|
|
311
|
-
recordFrameTime(...args: [handle: AquaClientHandle, frameTimeMs: number]): AquaStatus;
|
|
312
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;
|
|
313
346
|
createDeserializeWorker(_url: string, _workerUrl: string, poolSize: number): boolean;
|
|
314
347
|
cancelRequest(requestIdLow: number, requestIdHigh: number): boolean;
|
|
315
348
|
submitToWorker(requestIdLow: number, requestIdHigh: number, descriptorBuffer: ArrayBuffer, contextPtr: number): boolean;
|
|
@@ -355,9 +388,15 @@ export declare class Lod {
|
|
|
355
388
|
set _drawnOctantMask(mask: number);
|
|
356
389
|
get _octantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
357
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;
|
|
358
395
|
_readOctantOffsets(engine: Engine): void;
|
|
359
396
|
hasAttribute(attributeName: string): boolean;
|
|
360
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;
|
|
361
400
|
dispose(): void;
|
|
362
401
|
constructor({ id, modelRoot, lodStore, client }: LodInit);
|
|
363
402
|
}
|
|
@@ -382,6 +421,10 @@ export declare class LodStore {
|
|
|
382
421
|
|
|
383
422
|
declare interface MainModule {
|
|
384
423
|
AttributeInfo: new () => AttributeInfo;
|
|
424
|
+
CompressionType: {
|
|
425
|
+
SHARK_ELLIPSOID_COMPRESSED: unknown;
|
|
426
|
+
SHARK_ELLIPSOID_COMPRESSED_ROOT_RELATIVE: unknown;
|
|
427
|
+
};
|
|
385
428
|
Handedness: { Right: number; Left: number };
|
|
386
429
|
HEAPF32: Float32Array<ArrayBuffer>;
|
|
387
430
|
HEAPU8: Uint8Array<ArrayBuffer>;
|
|
@@ -418,13 +461,17 @@ declare interface MainModule {
|
|
|
418
461
|
HasFeature(handle: number, sceneObjectId: number, feature: number): boolean;
|
|
419
462
|
GetFeatureVersion(handle: number, sceneObjectId: number, feature: number): number;
|
|
420
463
|
GetFeatureState(handle: number, sceneObjectId: number, feature: number): number;
|
|
464
|
+
GetAssetFormatVersion(handle: number, sceneObjectId: number): number;
|
|
465
|
+
GetDrMapLadderRoughnessLevels(handle: number, sceneObjectId: number): number[];
|
|
421
466
|
SetClientSpatialFormat(handle: number, spatialFormat: SpatialFormat): { value: number };
|
|
422
467
|
SetRuntimeSettings(handle: number, settings: RuntimeSettings): { value: number };
|
|
423
468
|
TakeEvictedClientSideAttributeIds(handle: number): EmbindVector<bigint>;
|
|
424
469
|
GetActiveClientSideIdsCheckSum(): number;
|
|
425
470
|
TakeRenderRequired(handle: number): boolean;
|
|
471
|
+
BeginFrame(contextHandle: number, previousFrameTimeMs: number): number;
|
|
426
472
|
modifiedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
427
473
|
setMaxCacheSize(maxSizeBytes: number): void;
|
|
474
|
+
SetPreferSharkEncodingProfiles(prefer: boolean): void;
|
|
428
475
|
}
|
|
429
476
|
|
|
430
477
|
/**
|
|
@@ -461,13 +508,22 @@ export declare class Miris {
|
|
|
461
508
|
* Why 43? Because the AVP throttles down to 45Hz :(
|
|
462
509
|
*/
|
|
463
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 */
|
|
464
520
|
/* Excluded from this release type: _setTargetFrameRate */
|
|
465
521
|
/* Excluded from this release type: _setXRModeActive */
|
|
466
522
|
/* Excluded from this release type: _setSplatCountBudgetOverride */
|
|
467
523
|
/* Excluded from this release type: _update */
|
|
468
524
|
getLocalTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
469
525
|
getWorldTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
470
|
-
|
|
526
|
+
/* Excluded from this release type: _updateForScene */
|
|
471
527
|
applyChanges(_entries: Change[]): void;
|
|
472
528
|
_computeAdditionalRenderNeeded(): boolean;
|
|
473
529
|
onColorSpaceDetected(_isLinear: boolean): void;
|
|
@@ -496,6 +552,28 @@ export declare type ModelRootInit = {
|
|
|
496
552
|
stream: Stream;
|
|
497
553
|
};
|
|
498
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
|
+
|
|
499
577
|
declare type RequestAnimationFrameFn = ((callback: FrameRequestCallback) => number) | ((callback: XRFrameRequestCallback) => void);
|
|
500
578
|
|
|
501
579
|
declare interface RuntimeSettings extends EmbindObject {
|
|
@@ -504,6 +582,7 @@ declare interface RuntimeSettings extends EmbindObject {
|
|
|
504
582
|
targetFramesPerSecond: number;
|
|
505
583
|
xrModeActive: boolean;
|
|
506
584
|
splatCountBudget: number;
|
|
585
|
+
splatCountBudgetCap: number;
|
|
507
586
|
}
|
|
508
587
|
|
|
509
588
|
export declare class Scene extends EventTarget {
|
|
@@ -515,6 +594,7 @@ export declare class Scene extends EventTarget {
|
|
|
515
594
|
readonly id: number;
|
|
516
595
|
get key(): unknown;
|
|
517
596
|
set key(key: unknown);
|
|
597
|
+
/* Excluded from this release type: _assetFormat */
|
|
518
598
|
get viewerKey(): string | null;
|
|
519
599
|
set viewerKey(viewerKey: string | null);
|
|
520
600
|
get streams(): Set<Stream>;
|
|
@@ -524,21 +604,33 @@ export declare class Scene extends EventTarget {
|
|
|
524
604
|
readonly client: Client;
|
|
525
605
|
readonly handle?: number;
|
|
526
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;
|
|
527
619
|
dispose(): void;
|
|
528
|
-
/* Excluded from this release type: _getViewingVolumeObb */
|
|
529
620
|
fetchAssets(tags?: string | Iterable<string>): Promise<{
|
|
530
621
|
name: string;
|
|
531
622
|
thumbnailUrl: string;
|
|
532
623
|
uuid: string;
|
|
533
624
|
tags: string[];
|
|
534
625
|
}[]>;
|
|
535
|
-
getDefaultCameraTransform(): Float32Array<ArrayBuffer> | null | undefined;
|
|
536
626
|
add(stream: Stream): void;
|
|
537
627
|
getStreamForId(streamObjectId: number): Stream | undefined;
|
|
538
628
|
getStreamForDescendentId(descendentObjectId: number): Stream | null;
|
|
539
629
|
getModelRootForDescendentId(descendentObjectId: number): ModelRoot | null;
|
|
630
|
+
_recordAssetFormat(modelRoot: ModelRoot, formatVersion: number): void;
|
|
540
631
|
/* Excluded from this release type: _getFeatureMesh */
|
|
541
632
|
/* Excluded from this release type: _getDrMap */
|
|
633
|
+
/* Excluded from this release type: _onDrMapLadder */
|
|
542
634
|
/* Excluded from this release type: _onFeatureData */
|
|
543
635
|
/* Excluded from this release type: _onSceneLoaded */
|
|
544
636
|
delete(stream: Stream): void;
|
|
@@ -629,6 +721,8 @@ export declare class Stream extends EventTarget {
|
|
|
629
721
|
constructor(options: StreamInit);
|
|
630
722
|
_initStream({ uuid }: StreamInit): void;
|
|
631
723
|
/* Excluded from this release type: _onStreamLoaded */
|
|
724
|
+
getDefaultCameraTransform(): Float32Array<ArrayBuffer> | null | undefined;
|
|
725
|
+
/* Excluded from this release type: _getViewingVolumeObb */
|
|
632
726
|
/* Excluded from this release type: _onRootLoaded */
|
|
633
727
|
add(modelRoot: ModelRoot): void;
|
|
634
728
|
end(): void;
|