@nebula-spatial/viewer 0.5.5 → 0.5.7

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 (35) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +142 -7
  3. package/USD-VISUAL-MATERIAL-SUPPORT.md +14 -3
  4. package/basis/basis_transcoder.js +19 -0
  5. package/basis/basis_transcoder.wasm +0 -0
  6. package/dist/assets/ground-grid.d.ts +6 -0
  7. package/dist/assets/types.d.ts +49 -0
  8. package/dist/assets/usd-worker-B-HuMXLo.js +1505 -0
  9. package/dist/collision-debug-B2CISPB9.js +792 -0
  10. package/dist/index-BTAC6njT.js +10123 -0
  11. package/dist/index.d.ts +10 -2
  12. package/dist/index.js +17 -12
  13. package/dist/inspection/types.d.ts +79 -2
  14. package/dist/{mjcf-visual-zWaLqVqd.js → mjcf-visual-BVT3h87h.js} +7 -7
  15. package/dist/mujoco-runtime-CAyK0LHM.js +698 -0
  16. package/dist/resources-CHhCm2f7.js +27 -0
  17. package/dist/session-BQ8eCFRL.js +786 -0
  18. package/dist/{session-DVCZX72J.js → session-Dwoi1H46.js} +6 -5
  19. package/dist/simulation/mujoco-wasm-module.d.ts +11 -0
  20. package/dist/simulation/openusd-wasm-module.d.ts +10 -0
  21. package/dist/simulation/usd-query.d.ts +50 -0
  22. package/dist/simulation/usd-resource-policy.d.ts +28 -0
  23. package/dist/{stage-DGMYxyAS.js → stage-DUC-YNhD.js} +158 -170
  24. package/dist/{urdf-session-CF8xOenk.js → urdf-session-E0Nnr4Vs.js} +559 -546
  25. package/dist/usd-session-BUD3KtCr.js +6875 -0
  26. package/dist/version.d.ts +1 -1
  27. package/dist/{xacro-DidnrxXF.js → xacro-F7rdDouN.js} +1 -1
  28. package/openusd/openusd-runtime-manifest.json +15 -0
  29. package/openusd/openusd_probe.js +14 -14
  30. package/openusd/openusd_probe.wasm +0 -0
  31. package/package.json +5 -2
  32. package/dist/index-bTlVsOHA.js +0 -8165
  33. package/dist/mujoco-runtime-DTxVmIzc.js +0 -349
  34. package/dist/session-CZghJvw6.js +0 -883
  35. package/dist/usd-session-DkwOFmds.js +0 -4254
@@ -29,10 +29,24 @@ export interface AssetResourceResolver {
29
29
  }
30
30
  /** Controls how USD references outside the entry package are handled. */
31
31
  export type UsdExternalReferenceMode = 'package' | 'complete';
32
+ /** Selects an authored OpenUSD variant before stage data is read. */
33
+ export interface UsdVariantSelection {
34
+ readonly primPath: string;
35
+ readonly setName: string;
36
+ readonly selection: string;
37
+ }
32
38
  export interface ViewerAssetOptions {
33
39
  readonly dracoDecoderPath?: string;
40
+ /** Directory containing `basis_transcoder.js` and `basis_transcoder.wasm`. */
41
+ readonly ktx2TranscoderPath?: string;
34
42
  readonly openUsdBaseUrl?: string;
43
+ /** Runtime build id appended as `?v=` to the OpenUSD JS and WASM URLs. */
44
+ readonly openUsdRuntimeId?: string;
45
+ /** Caller-owned compiled Probe module shared across Workers and Viewer instances. */
46
+ readonly openUsdWasmModule?: WebAssembly.Module | Promise<WebAssembly.Module>;
35
47
  readonly mujocoBaseUrl?: string;
48
+ /** Caller-owned compiled MuJoCo module shared across simulation instances. */
49
+ readonly mujocoWasmModule?: WebAssembly.Module | Promise<WebAssembly.Module>;
36
50
  }
37
51
  export interface OpenAssetOptions {
38
52
  /** Browser Xacro subset; unsupported Python/ROS features fail explicitly. */
@@ -57,11 +71,34 @@ export interface OpenAssetOptions {
57
71
  * authority and is never bypassed.
58
72
  */
59
73
  readonly usdExternalReferenceMode?: UsdExternalReferenceMode;
74
+ /**
75
+ * USD-only variant selections applied after composition and before scene or
76
+ * physics extraction. Later entries override earlier entries for the same
77
+ * prim and variant set.
78
+ */
79
+ readonly usdVariantSelections?: readonly UsdVariantSelection[];
80
+ /**
81
+ * USD physics variant strategy. `auto-mujoco` selects a Newton/Mjc/MuJoCo
82
+ * branch while preserving the authored grip mode, then falls back to the
83
+ * authored branch when no compatible variant exists. Defaults to `authored`,
84
+ * preserving the asset's topology and explicit mimic relations for preview.
85
+ */
86
+ readonly usdVariantSelectionMode?: 'auto-mujoco' | 'authored';
87
+ /** Automatically play the USD joint animation once after loading. Explicit playback remains available. Defaults to true. */
88
+ readonly jointIntro?: boolean;
60
89
  /** @deprecated Auto detection never falls back to CAD; pass an explicit format instead. */
61
90
  readonly unknownFormatPolicy?: 'cad' | 'error';
62
91
  readonly dracoDecoderPath?: string;
92
+ /** Overrides `assets.ktx2TranscoderPath` for this open operation. */
93
+ readonly ktx2TranscoderPath?: string;
63
94
  readonly mujocoBaseUrl?: string;
64
95
  readonly openUsdBaseUrl?: string;
96
+ /** Overrides the packaged runtime id when hosting a matching CDN build. */
97
+ readonly openUsdRuntimeId?: string;
98
+ /** Caller-owned compiled Probe module shared across Workers and Viewer instances. */
99
+ readonly openUsdWasmModule?: WebAssembly.Module | Promise<WebAssembly.Module>;
100
+ /** Caller-owned compiled MuJoCo module shared across simulation instances. */
101
+ readonly mujocoWasmModule?: WebAssembly.Module | Promise<WebAssembly.Module>;
65
102
  /**
66
103
  * Which authored axis is "up". FBX first uses a supported positive Y/Z
67
104
  * declaration from GlobalSettings, then falls back to 'y' when it is missing
@@ -121,11 +158,19 @@ export interface AssetErrorSnapshot {
121
158
  readonly stage: string;
122
159
  readonly fatal: boolean;
123
160
  }
161
+ export type AssetNoticeKind = 'not-authored' | 'unsupported-by-viewer' | 'lossy-mapping' | 'invalid-asset' | 'resource-limit' | 'runtime-failure' | 'visual-adaptation' | 'load-warning';
162
+ export interface AssetNoticeSnapshot {
163
+ readonly kind: AssetNoticeKind;
164
+ readonly title: string;
165
+ readonly summary: string;
166
+ readonly tone: 'info' | 'warning' | 'error';
167
+ }
124
168
  /** Non-fatal condition that changed how an otherwise usable asset is presented. */
125
169
  export interface AssetWarningSnapshot {
126
170
  readonly code: string;
127
171
  readonly message: string;
128
172
  readonly stage: string;
173
+ readonly notice?: AssetNoticeSnapshot;
129
174
  }
130
175
  /** Physics availability is independent of the visual asset's ready phase. */
131
176
  export type AssetPhysicsState = {
@@ -229,6 +274,8 @@ export interface AssetLoaderContext {
229
274
  readonly options: OpenAssetOptions;
230
275
  readonly source: NormalizedAssetSource;
231
276
  readonly format: AssetFormat;
277
+ /** Present when the host runtime owns a WebGL renderer. */
278
+ getRenderer?(): WebGLRenderer;
232
279
  requestRender(): void;
233
280
  fit(root: Object3D | Box3, options?: {
234
281
  readonly viewMode?: ViewerViewMode;
@@ -274,6 +321,8 @@ export interface AssetSession {
274
321
  pause?(): void;
275
322
  reset?(): void;
276
323
  update?(deltaSeconds: number): boolean;
324
+ /** Advances bounded interactive physics while playback stays paused. Returns whether the view changed. */
325
+ updatePaused?(deltaSeconds: number): boolean;
277
326
  beginGrab?(event: PointerEvent, camera: import('three').Camera, canvas: HTMLElement): boolean;
278
327
  moveGrab?(event: PointerEvent, camera: import('three').Camera, canvas: HTMLElement): void;
279
328
  endGrab?(): void;