@miris-inc/core 0.0.8-07cb68c → 0.0.8-07e9c0a
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 +90 -11
- package/dist/core.js +366 -72
- package/dist/core.prod.js +1 -1
- package/dist/core.standalone.js +727 -433
- package/dist/core.standalone.prod.js +1 -1
- package/package.json +8 -1
- package/webshark.d.ts +290 -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,15 @@
|
|
|
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
|
+
readonly minValue: { x: number; y: number; z: number };
|
|
7
13
|
readonly maxValue: { x: number; y: number; z: number };
|
|
8
14
|
}
|
|
9
15
|
|
|
@@ -20,8 +26,16 @@ export declare class AttributeNames {
|
|
|
20
26
|
static readonly SPARK_EXTENDED_SH3_B: string;
|
|
21
27
|
static readonly UNUSED: string;
|
|
22
28
|
static readonly SHARK_ELLIPSOIDS: string;
|
|
29
|
+
static readonly SHARK_ELLIPSOIDS_COMPRESSED: string;
|
|
23
30
|
static readonly SHARK_SPHERICAL_HARMONICS: string;
|
|
31
|
+
static readonly COLOR: string;
|
|
24
32
|
static readonly OCTANT_OFFSETS: string;
|
|
33
|
+
static readonly SURFEL_OCTANT_OFFSETS: string;
|
|
34
|
+
static readonly SURFEL_COUNT: string;
|
|
35
|
+
static readonly REFLECTANCE_DATA_V1: string;
|
|
36
|
+
static readonly GLASS_MESH_GEOMETRY: string;
|
|
37
|
+
static readonly GLASS_MESH_PANELS: string;
|
|
38
|
+
static readonly MOD_DEPTH: string;
|
|
25
39
|
}
|
|
26
40
|
|
|
27
41
|
declare type CachedAttribute = {
|
|
@@ -110,6 +124,8 @@ declare class Client {
|
|
|
110
124
|
hasFeature(...args: ClientMethodParameters["hasFeature"]): boolean;
|
|
111
125
|
getFeatureVersion(...args: ClientMethodParameters["getFeatureVersion"]): number;
|
|
112
126
|
getFeatureState(...args: ClientMethodParameters["getFeatureState"]): number;
|
|
127
|
+
getAssetFormatVersion(...args: ClientMethodParameters["getAssetFormatVersion"]): number;
|
|
128
|
+
getDrMapLadderRoughnessLevels(...args: ClientMethodParameters["getDrMapLadderRoughnessLevels"]): number[];
|
|
113
129
|
getName(...args: ClientMethodParameters["getName"]): string;
|
|
114
130
|
setVariantSelection(...args: ClientMethodParameters["setVariantSelection"]): AquaStatus;
|
|
115
131
|
takeAttribute(...args: ClientMethodParameters["takeAttribute"]): AquaStatus;
|
|
@@ -117,7 +133,6 @@ declare class Client {
|
|
|
117
133
|
takeRenderRequired(...args: ClientMethodParameters["takeRenderRequired"]): boolean;
|
|
118
134
|
unlockScene(...args: ClientMethodParameters["unlockScene"]): boolean;
|
|
119
135
|
updateSceneExecution(...args: ClientMethodParameters["updateSceneExecution"]): AquaStatus;
|
|
120
|
-
recordFrameTime(...args: ClientMethodParameters["recordFrameTime"]): AquaStatus;
|
|
121
136
|
}
|
|
122
137
|
|
|
123
138
|
declare type ClientInit = {
|
|
@@ -227,8 +242,8 @@ declare class Engine {
|
|
|
227
242
|
attributeName: string,
|
|
228
243
|
attributeInfo: AttributeInfo
|
|
229
244
|
]): AquaStatus;
|
|
230
|
-
getDefaultCameraId(...args: [handle: AquaClientHandle]): number;
|
|
231
|
-
getViewingVolumeId(...args: [handle: AquaClientHandle]): number;
|
|
245
|
+
getDefaultCameraId(...args: [handle: AquaClientHandle, streamObjectId: number]): number;
|
|
246
|
+
getViewingVolumeId(...args: [handle: AquaClientHandle, streamObjectId: number]): number;
|
|
232
247
|
getLocalBoundingBox(...args: [handle: AquaClientHandle, sceneObjectId: number, boxData: number]): AquaStatus;
|
|
233
248
|
getWorldBoundingBox(...args: [handle: AquaClientHandle, sceneObjectId: number, boxData: number]): AquaStatus;
|
|
234
249
|
getLodIndex(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
@@ -288,6 +303,7 @@ declare class Engine {
|
|
|
288
303
|
viewportHeightPixels: number
|
|
289
304
|
]): AquaStatus;
|
|
290
305
|
setMaxCacheSize(...args: [maxSizeBytes: number]): void;
|
|
306
|
+
setPreferSharkEncodingProfiles(...args: [preferShark: boolean]): void;
|
|
291
307
|
setSceneObjectTransform(...args: [
|
|
292
308
|
handle: AquaClientHandle,
|
|
293
309
|
sceneObjectId: number,
|
|
@@ -296,6 +312,8 @@ declare class Engine {
|
|
|
296
312
|
hasFeature(...args: [handle: AquaClientHandle, sceneObjectId: number, feature: number]): boolean;
|
|
297
313
|
getFeatureVersion(...args: [handle: AquaClientHandle, sceneObjectId: number, feature: number]): number;
|
|
298
314
|
getFeatureState(...args: [handle: AquaClientHandle, sceneObjectId: number, feature: number]): number;
|
|
315
|
+
getDrMapLadderRoughnessLevels(...args: [handle: AquaClientHandle, sceneObjectId: number]): number[];
|
|
316
|
+
getAssetFormatVersion(...args: [handle: AquaClientHandle, sceneObjectId: number]): number;
|
|
299
317
|
getName(...args: [handle: AquaClientHandle, sceneObjectId: number]): string;
|
|
300
318
|
setVariantSelection(...args: [handle: AquaClientHandle, sceneObjectId: number]): AquaStatus;
|
|
301
319
|
takeAttribute(...args: [
|
|
@@ -308,8 +326,15 @@ declare class Engine {
|
|
|
308
326
|
getActiveClientSideIdsCheckSum(): number;
|
|
309
327
|
unlockScene(...args: [handle: AquaClientHandle]): boolean;
|
|
310
328
|
updateSceneExecution(...args: [handle: AquaClientHandle]): AquaStatus;
|
|
311
|
-
recordFrameTime(...args: [handle: AquaClientHandle, frameTimeMs: number]): AquaStatus;
|
|
312
329
|
takeRenderRequired(...args: [handle: AquaClientHandle]): boolean;
|
|
330
|
+
/**
|
|
331
|
+
* Advances the runtime by one frame and recomputes the streaming budget. Call once per
|
|
332
|
+
* displayed frame per context, before the per-client updateSceneExecution() calls.
|
|
333
|
+
* `previousFrameTimeMs` is how long the previous frame took; pass 0 when there is no plausible
|
|
334
|
+
* measurement (first frame, or a resume from a stall) and the frame advances without recording
|
|
335
|
+
* one.
|
|
336
|
+
*/
|
|
337
|
+
beginFrame(...args: [contextHandle: AquaContextHandle, previousFrameTimeMs: number]): AquaStatus;
|
|
313
338
|
createDeserializeWorker(_url: string, _workerUrl: string, poolSize: number): boolean;
|
|
314
339
|
cancelRequest(requestIdLow: number, requestIdHigh: number): boolean;
|
|
315
340
|
submitToWorker(requestIdLow: number, requestIdHigh: number, descriptorBuffer: ArrayBuffer, contextPtr: number): boolean;
|
|
@@ -355,9 +380,13 @@ export declare class Lod {
|
|
|
355
380
|
set _drawnOctantMask(mask: number);
|
|
356
381
|
get _octantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
357
382
|
get _hasOctantOffsets(): boolean;
|
|
383
|
+
get _surfelOctantOffsets(): Uint32Array<ArrayBuffer> | null;
|
|
384
|
+
get _surfelCount(): number;
|
|
358
385
|
_readOctantOffsets(engine: Engine): void;
|
|
359
386
|
hasAttribute(attributeName: string): boolean;
|
|
360
387
|
getDataFromAttribute(engine: Engine, attributeName: string, attributeInfo: AttributeInfo): CachedAttribute | null;
|
|
388
|
+
_getRawByteAttribute(engine: Engine, attributeName: string): Uint8Array<ArrayBuffer> | null;
|
|
389
|
+
_getRawByteAttributeWithBounds(engine: Engine, attributeName: string): RawByteAttributeWithBounds | null;
|
|
361
390
|
dispose(): void;
|
|
362
391
|
constructor({ id, modelRoot, lodStore, client }: LodInit);
|
|
363
392
|
}
|
|
@@ -418,13 +447,17 @@ declare interface MainModule {
|
|
|
418
447
|
HasFeature(handle: number, sceneObjectId: number, feature: number): boolean;
|
|
419
448
|
GetFeatureVersion(handle: number, sceneObjectId: number, feature: number): number;
|
|
420
449
|
GetFeatureState(handle: number, sceneObjectId: number, feature: number): number;
|
|
450
|
+
GetAssetFormatVersion(handle: number, sceneObjectId: number): number;
|
|
451
|
+
GetDrMapLadderRoughnessLevels(handle: number, sceneObjectId: number): number[];
|
|
421
452
|
SetClientSpatialFormat(handle: number, spatialFormat: SpatialFormat): { value: number };
|
|
422
453
|
SetRuntimeSettings(handle: number, settings: RuntimeSettings): { value: number };
|
|
423
454
|
TakeEvictedClientSideAttributeIds(handle: number): EmbindVector<bigint>;
|
|
424
455
|
GetActiveClientSideIdsCheckSum(): number;
|
|
425
456
|
TakeRenderRequired(handle: number): boolean;
|
|
457
|
+
BeginFrame(contextHandle: number, previousFrameTimeMs: number): number;
|
|
426
458
|
modifiedObjectIdsView(sceneChangeIds: SceneChangeIds): Uint32Array;
|
|
427
459
|
setMaxCacheSize(maxSizeBytes: number): void;
|
|
460
|
+
SetPreferSharkEncodingProfiles(prefer: boolean): void;
|
|
428
461
|
}
|
|
429
462
|
|
|
430
463
|
/**
|
|
@@ -461,13 +494,21 @@ export declare class Miris {
|
|
|
461
494
|
* Why 43? Because the AVP throttles down to 45Hz :(
|
|
462
495
|
*/
|
|
463
496
|
static readonly _XR_TARGET_FRAME_RATE = 43;
|
|
497
|
+
/* Excluded from this release type: _XR_SPLAT_COUNT_BUDGET */
|
|
498
|
+
/* Excluded from this release type: _SHARK_SPLAT_CAPACITY_MOBILE */
|
|
499
|
+
static readonly _SHARK_SPLAT_CAPACITY_DESKTOP = 3000000;
|
|
500
|
+
/* Excluded from this release type: _SHARK_SPLAT_BUDGET_CAP_MOBILE */
|
|
501
|
+
static readonly _SHARK_SPLAT_BUDGET_CAP_DESKTOP = 2500000;
|
|
502
|
+
/* Excluded from this release type: _isMobileDevice */
|
|
503
|
+
/* Excluded from this release type: _sharkSplatCapacity */
|
|
504
|
+
/* Excluded from this release type: _sharkSplatBudgetCap */
|
|
464
505
|
/* Excluded from this release type: _setTargetFrameRate */
|
|
465
506
|
/* Excluded from this release type: _setXRModeActive */
|
|
466
507
|
/* Excluded from this release type: _setSplatCountBudgetOverride */
|
|
467
508
|
/* Excluded from this release type: _update */
|
|
468
509
|
getLocalTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
469
510
|
getWorldTransform(client: Client, sceneObjectId: number): Float32Array<ArrayBuffer> | undefined;
|
|
470
|
-
|
|
511
|
+
/* Excluded from this release type: _updateForScene */
|
|
471
512
|
applyChanges(_entries: Change[]): void;
|
|
472
513
|
_computeAdditionalRenderNeeded(): boolean;
|
|
473
514
|
onColorSpaceDetected(_isLinear: boolean): void;
|
|
@@ -496,6 +537,28 @@ export declare type ModelRootInit = {
|
|
|
496
537
|
stream: Stream;
|
|
497
538
|
};
|
|
498
539
|
|
|
540
|
+
/**
|
|
541
|
+
* The byte-exact counterpart of getRawUint32Attribute above: same no-padding, no-takeAttribute
|
|
542
|
+
* contract, returning bytes rather than words.
|
|
543
|
+
*
|
|
544
|
+
* Use this rather than that one wherever the stride is not a whole number of words:
|
|
545
|
+
* reflectanceDataV1's 26-byte record is not, and an odd record count would lose that record's
|
|
546
|
+
* last field to dataPtrView's truncation.
|
|
547
|
+
*/
|
|
548
|
+
export declare type RawByteAttributeWithBounds = {
|
|
549
|
+
bytes: Uint8Array<ArrayBuffer>;
|
|
550
|
+
minValue: {
|
|
551
|
+
x: number;
|
|
552
|
+
y: number;
|
|
553
|
+
z: number;
|
|
554
|
+
};
|
|
555
|
+
maxValue: {
|
|
556
|
+
x: number;
|
|
557
|
+
y: number;
|
|
558
|
+
z: number;
|
|
559
|
+
};
|
|
560
|
+
};
|
|
561
|
+
|
|
499
562
|
declare type RequestAnimationFrameFn = ((callback: FrameRequestCallback) => number) | ((callback: XRFrameRequestCallback) => void);
|
|
500
563
|
|
|
501
564
|
declare interface RuntimeSettings extends EmbindObject {
|
|
@@ -504,6 +567,7 @@ declare interface RuntimeSettings extends EmbindObject {
|
|
|
504
567
|
targetFramesPerSecond: number;
|
|
505
568
|
xrModeActive: boolean;
|
|
506
569
|
splatCountBudget: number;
|
|
570
|
+
splatCountBudgetCap: number;
|
|
507
571
|
}
|
|
508
572
|
|
|
509
573
|
export declare class Scene extends EventTarget {
|
|
@@ -515,6 +579,7 @@ export declare class Scene extends EventTarget {
|
|
|
515
579
|
readonly id: number;
|
|
516
580
|
get key(): unknown;
|
|
517
581
|
set key(key: unknown);
|
|
582
|
+
/* Excluded from this release type: _assetFormat */
|
|
518
583
|
get viewerKey(): string | null;
|
|
519
584
|
set viewerKey(viewerKey: string | null);
|
|
520
585
|
get streams(): Set<Stream>;
|
|
@@ -524,21 +589,33 @@ export declare class Scene extends EventTarget {
|
|
|
524
589
|
readonly client: Client;
|
|
525
590
|
readonly handle?: number;
|
|
526
591
|
constructor({ miris, viewerKey }: SceneInit);
|
|
592
|
+
/**
|
|
593
|
+
* Drives a frame and answers whether *this* scene's canvas needs repainting. Call it once per
|
|
594
|
+
* displayed frame from the host's animation loop, and render when it returns true.
|
|
595
|
+
*
|
|
596
|
+
* Every scene on the page calls this from its own loop. The first call in a displayed frame
|
|
597
|
+
* drives one engine tick for all of them; the rest recognise the frame and reuse it.
|
|
598
|
+
*
|
|
599
|
+
* @param ts the host's frame timestamp. Optional - the document timeline supplies one, and it
|
|
600
|
+
* reads the same for every scene in a displayed frame. Pass it when the host runs its own
|
|
601
|
+
* clock, as an immersive XR session does, because XRFrame time is not the document timeline.
|
|
602
|
+
*/
|
|
603
|
+
update(ts?: DOMHighResTimeStamp): boolean;
|
|
527
604
|
dispose(): void;
|
|
528
|
-
/* Excluded from this release type: _getViewingVolumeObb */
|
|
529
605
|
fetchAssets(tags?: string | Iterable<string>): Promise<{
|
|
530
606
|
name: string;
|
|
531
607
|
thumbnailUrl: string;
|
|
532
608
|
uuid: string;
|
|
533
609
|
tags: string[];
|
|
534
610
|
}[]>;
|
|
535
|
-
getDefaultCameraTransform(): Float32Array<ArrayBuffer> | null | undefined;
|
|
536
611
|
add(stream: Stream): void;
|
|
537
612
|
getStreamForId(streamObjectId: number): Stream | undefined;
|
|
538
613
|
getStreamForDescendentId(descendentObjectId: number): Stream | null;
|
|
539
614
|
getModelRootForDescendentId(descendentObjectId: number): ModelRoot | null;
|
|
615
|
+
_recordAssetFormat(modelRoot: ModelRoot, formatVersion: number): void;
|
|
540
616
|
/* Excluded from this release type: _getFeatureMesh */
|
|
541
617
|
/* Excluded from this release type: _getDrMap */
|
|
618
|
+
/* Excluded from this release type: _onDrMapLadder */
|
|
542
619
|
/* Excluded from this release type: _onFeatureData */
|
|
543
620
|
/* Excluded from this release type: _onSceneLoaded */
|
|
544
621
|
delete(stream: Stream): void;
|
|
@@ -629,6 +706,8 @@ export declare class Stream extends EventTarget {
|
|
|
629
706
|
constructor(options: StreamInit);
|
|
630
707
|
_initStream({ uuid }: StreamInit): void;
|
|
631
708
|
/* Excluded from this release type: _onStreamLoaded */
|
|
709
|
+
getDefaultCameraTransform(): Float32Array<ArrayBuffer> | null | undefined;
|
|
710
|
+
/* Excluded from this release type: _getViewingVolumeObb */
|
|
632
711
|
/* Excluded from this release type: _onRootLoaded */
|
|
633
712
|
add(modelRoot: ModelRoot): void;
|
|
634
713
|
end(): void;
|