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