@nebula-spatial/viewer 0.5.18 → 0.6.0

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +63 -35
  2. package/dist/asset-ir-BEDGD9CL.js +637 -0
  3. package/dist/assets/source-types.d.ts +10 -0
  4. package/dist/assets/types.d.ts +59 -6
  5. package/dist/index-DoxM1Msk.js +17223 -0
  6. package/dist/index.d.ts +20 -1
  7. package/dist/index.js +29 -18
  8. package/dist/{mjcf-visual-CtY2Wk3w.js → mjcf-visual-CQEeWkL_.js} +12 -13
  9. package/dist/mujoco-runtime-BmuEJ_ST.js +791 -0
  10. package/dist/physics-guide-size-CplAlsve.js +12 -0
  11. package/dist/scene/instances.d.ts +36 -0
  12. package/dist/scene/joints.d.ts +129 -0
  13. package/dist/scene/session.d.ts +26 -0
  14. package/dist/scene/types.d.ts +284 -0
  15. package/dist/session-BnNntPUE.js +9169 -0
  16. package/dist/{session-DxTeRKCd.js → session-Cz4tFSlO.js} +6 -8
  17. package/dist/session-sBOJEWpK.js +559 -0
  18. package/dist/simulation/physics-runtime-state.d.ts +73 -0
  19. package/dist/simulation/types.d.ts +151 -0
  20. package/dist/simulation/usd-dependency-probe.d.ts +42 -0
  21. package/dist/simulation/usd-inspection.d.ts +66 -0
  22. package/dist/types.d.ts +46 -1
  23. package/dist/ui/camera-axis-gizmo.d.ts +5 -0
  24. package/dist/urdf-session-HKelZnMM.js +1230 -0
  25. package/dist/{usd-session-tW3LxVFs.js → usd-session-Cn6whyh4.js} +3915 -3687
  26. package/dist/version.d.ts +1 -1
  27. package/dist/visual/classification.d.ts +20 -0
  28. package/dist/{xacro-x2TeKQ7T.js → xacro-Cl7vUCSC.js} +1 -1
  29. package/package.json +2 -1
  30. package/runtime-assets.d.mts +9 -9
  31. package/runtime-assets.mjs +11 -11
  32. package/vite.d.mts +7 -7
  33. package/vite.mjs +115 -115
  34. package/dist/collision-debug-BSJoz5J7.js +0 -2947
  35. package/dist/index-E8DHSeyT.js +0 -11499
  36. package/dist/mujoco-runtime-fDWdXNEc.js +0 -739
  37. package/dist/resources-CHhCm2f7.js +0 -27
  38. package/dist/session-DB-osaBL.js +0 -801
  39. package/dist/stage-BnRjc-Rp.js +0 -592
  40. package/dist/urdf-session-Q_c3Rd1M.js +0 -1264
@@ -25,6 +25,8 @@ export type AssetSource = AssetSingleSource | Extract<CadLoadSource, {
25
25
  export interface AssetResourceResolver {
26
26
  resolve(path: string, options?: {
27
27
  readonly signal?: AbortSignal;
28
+ readonly url?: string;
29
+ readonly canonicalPath?: string;
28
30
  }): string | URL | Blob | Promise<string | URL | Blob>;
29
31
  /**
30
32
  * Optional metadata-only view of resources available through this resolver.
@@ -119,8 +121,9 @@ export interface OpenAssetOptions {
119
121
  * Which authored axis is "up". FBX first uses a supported positive Y/Z
120
122
  * declaration from GlobalSettings, then falls back to 'y' when it is missing
121
123
  * or cannot be read. GLB/glTF default to 'y' per the glTF coordinate
122
- * convention. An explicit value always wins. 'y' rotates the model root into
123
- * world +Z.
124
+ * convention. Gaussian/3DGS assets default to 'y-down' because their source
125
+ * +Y points down. An explicit value always wins. 'y' rotates authored +Y into
126
+ * world +Z; 'y-down' rotates authored +Y into world -Z.
124
127
  *
125
128
  * Also seeds the initial up axis of simulation assets. URDF/XACRO/MJCF are
126
129
  * Z-up by specification; USD defaults to 'z' because the loader has already
@@ -129,11 +132,21 @@ export interface OpenAssetOptions {
129
132
  * consistent with what is rendered.
130
133
  */
131
134
  readonly upAxis?: AssetUpAxis;
135
+ /** Gaussian bounds are the default; exact mode enables per-splat raycasts. */
136
+ readonly visualSelectionMode?: 'bounds' | 'exact';
137
+ readonly visualAppearance?: {
138
+ /** Linear RGB in 0..1. */
139
+ readonly color?: readonly [number, number, number];
140
+ readonly opacity?: number;
141
+ };
132
142
  /** CAD-specific compatibility options. `filename` and `signal` above take precedence. */
133
143
  readonly cad?: Omit<CadOpenOptions, 'filename' | 'signal'>;
134
144
  }
135
- /** World axis a model was authored to treat as up. See `OpenAssetOptions.upAxis`. */
136
- export type AssetUpAxis = 'y' | 'z';
145
+ /**
146
+ * World axis a model was authored to treat as up. `'y-down'` means source +Y
147
+ * points down, so it maps to world -Z. See `OpenAssetOptions.upAxis`.
148
+ */
149
+ export type AssetUpAxis = 'y' | 'y-down' | 'z';
137
150
  export interface AssetPreviewCapabilities {
138
151
  readonly canPlay: boolean;
139
152
  readonly canPause: boolean;
@@ -290,9 +303,15 @@ export interface NormalizedAssetSource {
290
303
  readonly signal: AbortSignal;
291
304
  readonly baseUrl: string | null;
292
305
  readonly hasResourceResolver: boolean;
293
- /** Entry-relative resource identities exposed by the host resolver. */
306
+ /** Present when the source carries a prefetched remote entry. */
307
+ readonly entryBlob?: Blob | null;
308
+ /** Known package identities or canonical remote URLs used during resolution. */
294
309
  readonly resourcePaths?: readonly string[];
295
- resolve(path: string, signal?: AbortSignal): Promise<string>;
310
+ resolve(path: string, contextOrSignal?: {
311
+ readonly signal?: AbortSignal;
312
+ readonly url?: string;
313
+ readonly canonicalPath?: string;
314
+ } | AbortSignal): Promise<string>;
296
315
  release(): void;
297
316
  }
298
317
  export interface AssetDetectionResult {
@@ -324,6 +343,12 @@ export interface AssetLoaderContext {
324
343
  export interface AssetSession {
325
344
  readonly autoPlay?: boolean;
326
345
  readonly inspection?: AssetInspection | null;
346
+ setInspectionOverlay?(kind: 'jointAxis' | 'centerOfMass' | 'inertia', visible: boolean): boolean;
347
+ getInspectionOverlayCapabilities?(): {
348
+ jointAxis: boolean;
349
+ centerOfMass: boolean;
350
+ inertia: boolean;
351
+ } | null;
327
352
  isPlaying?(): boolean;
328
353
  setTheme?(theme: 'dark' | 'light'): void;
329
354
  beforeRender?(renderer: WebGLRenderer, scene: Scene, camera: Camera): (() => void) | void;
@@ -359,6 +384,34 @@ export interface AssetSession {
359
384
  beginGrab?(event: PointerEvent, camera: import('three').Camera, canvas: HTMLElement): boolean;
360
385
  moveGrab?(event: PointerEvent, camera: import('three').Camera, canvas: HTMLElement): void;
361
386
  endGrab?(): void;
387
+ /**
388
+ * Hidden authored/compiled collision geometry ready for placement probing.
389
+ * Scene sessions consume it so an uncommitted instance pose can be validated
390
+ * against the same colliders the asset session already builds lazily.
391
+ */
392
+ getCollisionRoot?(): import('three').Object3D | null;
393
+ /**
394
+ * Internal scene bridge: exposes the already-compiled MJCF and the exact
395
+ * visual body objects so multiple instances can be merged into one physical
396
+ * world without re-parsing USD/MJCF.
397
+ */
398
+ getScenePhysics?(): ScenePhysicsSource | null;
399
+ }
400
+ export interface ScenePhysicsSource {
401
+ readonly format: 'mjcf';
402
+ readonly xml: string;
403
+ readonly files: ReadonlyMap<string, Uint8Array>;
404
+ readonly initialControls?: readonly number[];
405
+ readonly initialJoints?: Readonly<Record<string, number>>;
406
+ readonly massOverrides?: readonly {
407
+ readonly body: string;
408
+ readonly mass: number;
409
+ }[];
410
+ readonly initialVelocities?: readonly {
411
+ readonly body: string;
412
+ readonly velocity: readonly number[];
413
+ }[];
414
+ readonly visualBindings: ReadonlyMap<string, import('three').Object3D>;
362
415
  }
363
416
  export interface AssetLoaderContribution {
364
417
  readonly kind: 'asset-loader';