@nebula-spatial/viewer 0.6.0 → 0.6.2
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/CHANGELOG.md +47 -0
- package/README.md +11 -3
- package/USD-VISUAL-MATERIAL-SUPPORT.md +5 -5
- package/dist/{asset-ir-BEDGD9CL.js → asset-ir-DrGD8GAH.js} +1 -1
- package/dist/assets/types.d.ts +2 -0
- package/dist/assets/{usd-worker-B6-1I5dT.js → usd-worker-jdyS9s6r.js} +671 -584
- package/dist/{index-DoxM1Msk.js → index-D4V1Rbos.js} +4609 -4155
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{mjcf-visual-CQEeWkL_.js → mjcf-visual-CgZcMQ20.js} +1 -1
- package/dist/{mujoco-runtime-BmuEJ_ST.js → mujoco-runtime-D2vfQAaN.js} +1 -1
- package/dist/scene/types.d.ts +27 -4
- package/dist/{session-Cz4tFSlO.js → session-CBFf-74J.js} +581 -565
- package/dist/session-CyTb_7S9.js +562 -0
- package/dist/session-kOqNyfj4.js +240 -0
- package/dist/spark-renderer-Bt6TPse5.js +25 -0
- package/dist/{session-BnNntPUE.js → spark.module-kM8pwA1o.js} +1602 -1493
- package/dist/types.d.ts +36 -0
- package/dist/{urdf-session-HKelZnMM.js → urdf-session-Bts8dAcU.js} +4 -4
- package/dist/usd-session-CHCniTR3.js +11595 -0
- package/dist/version.d.ts +1 -1
- package/dist/{xacro-Cl7vUCSC.js → xacro-BJGu3wdR.js} +1 -1
- package/openusd/openusd-runtime-manifest.json +6 -6
- package/openusd/openusd_probe.js +1 -1
- package/openusd/openusd_probe.wasm +0 -0
- package/package.json +1 -1
- package/dist/session-sBOJEWpK.js +0 -559
- package/dist/usd-session-Cn6whyh4.js +0 -10875
package/dist/types.d.ts
CHANGED
|
@@ -110,6 +110,11 @@ export interface ViewerOptions {
|
|
|
110
110
|
transmissionMode?: 'three' | 'eevee-sphere-probe';
|
|
111
111
|
/** Pointer mapping for model/simulation previews. Defaults to `left-rotate`. */
|
|
112
112
|
previewDragPreset?: ViewerPreviewDragPreset;
|
|
113
|
+
/**
|
|
114
|
+
* OrbitControls damping factor for preview navigation. Range: (0, 1].
|
|
115
|
+
* Omit or set to null to use the selected preset's default.
|
|
116
|
+
*/
|
|
117
|
+
previewCameraDampingFactor?: number | null;
|
|
113
118
|
autoSelectOnPick?: boolean;
|
|
114
119
|
pointerPick?: boolean;
|
|
115
120
|
/** CAD click policy. Defaults to managed. */
|
|
@@ -138,6 +143,18 @@ export interface ViewerOptions {
|
|
|
138
143
|
export interface ViewerFitViewOptions {
|
|
139
144
|
padding?: number;
|
|
140
145
|
viewMode?: ViewerViewMode;
|
|
146
|
+
/**
|
|
147
|
+
* Keep the scene-owned maximum distance and far plane. The minimum distance
|
|
148
|
+
* and near plane may shrink so a focused object remains reachable and
|
|
149
|
+
* visible for detail inspection.
|
|
150
|
+
*/
|
|
151
|
+
preservePreviewCameraRange?: boolean;
|
|
152
|
+
/** Rebuild the preview camera profile without moving the camera. */
|
|
153
|
+
preserveCameraPose?: boolean;
|
|
154
|
+
/** Maximum preview orbit distance as a multiple of the fitted radius. */
|
|
155
|
+
previewMaxDistanceFactor?: number;
|
|
156
|
+
/** Lower bound for the preview maximum orbit distance, in world units. */
|
|
157
|
+
minimumMaxDistance?: number;
|
|
141
158
|
}
|
|
142
159
|
export interface ViewerPickOptions {
|
|
143
160
|
/** Stop at the nearest intersection when accelerated picking is available. */
|
|
@@ -244,6 +261,10 @@ export interface Viewer {
|
|
|
244
261
|
dispose?: boolean;
|
|
245
262
|
}): Object3D | null;
|
|
246
263
|
};
|
|
264
|
+
readonly renderEffects: {
|
|
265
|
+
add(effect: ViewerRenderEffect): () => void;
|
|
266
|
+
remove(effect: ViewerRenderEffect): boolean;
|
|
267
|
+
};
|
|
247
268
|
readonly camera: {
|
|
248
269
|
getState(): ViewerCameraSnapshot | null;
|
|
249
270
|
/** Applies a validated snapshot immediately. Animated transitions are not part of the current contract. */
|
|
@@ -289,6 +310,11 @@ export interface Viewer {
|
|
|
289
310
|
setTransparentHdrBackdropBlurriness(value: number): boolean;
|
|
290
311
|
/** Switches the model/simulation preview pointer mapping at runtime. */
|
|
291
312
|
setPreviewDragPreset(preset: ViewerPreviewDragPreset): void;
|
|
313
|
+
/**
|
|
314
|
+
* Current damping override. Set a number for an immediate effect, or null to
|
|
315
|
+
* return to the selected preview preset's default.
|
|
316
|
+
*/
|
|
317
|
+
previewCameraDampingFactor: number | null;
|
|
292
318
|
/**
|
|
293
319
|
* Opens a multi-asset scene under the existing single Renderer/Scene/RAF.
|
|
294
320
|
*
|
|
@@ -306,6 +332,16 @@ export interface Viewer {
|
|
|
306
332
|
replace?: boolean;
|
|
307
333
|
}): void;
|
|
308
334
|
}
|
|
335
|
+
export interface ViewerRenderEffectContext {
|
|
336
|
+
readonly purpose: 'viewport' | 'capture';
|
|
337
|
+
readonly target: import('three').WebGLRenderTarget | null;
|
|
338
|
+
readonly navigationTarget?: import('three').Vector3;
|
|
339
|
+
}
|
|
340
|
+
export interface ViewerRenderEffect {
|
|
341
|
+
isActive?(): boolean;
|
|
342
|
+
afterScene(renderer: import('three').WebGLRenderer, scene: import('three').Scene, camera: import('three').Camera, context: ViewerRenderEffectContext): void;
|
|
343
|
+
dispose?(): void;
|
|
344
|
+
}
|
|
309
345
|
/**
|
|
310
346
|
* Offscreen frame capture. The capture renders through the same Renderer,
|
|
311
347
|
* Scene and loop hooks, against a cloned camera, so it neither opens a second
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var We = Object.defineProperty;
|
|
2
2
|
var Ce = (i, e, s) => e in i ? We(i, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[e] = s;
|
|
3
3
|
var R = (i, e, s) => Ce(i, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
-
import { c as Ge, b as Te, d as Ve, w as ye, e as ge, p as Je } from "./asset-ir-
|
|
5
|
-
import { d as I, N as Pe, O as be, t as Be, u as Qe, v as we, M as Xe, P as Ke, i as Ze, B as Ye, Q as ve, S as Me } from "./index-
|
|
4
|
+
import { c as Ge, b as Te, d as Ve, w as ye, e as ge, p as Je } from "./asset-ir-DrGD8GAH.js";
|
|
5
|
+
import { d as I, N as Pe, O as be, t as Be, u as Qe, v as we, M as Xe, P as Ke, i as Ze, B as Ye, Q as ve, S as Me } from "./index-D4V1Rbos.js";
|
|
6
6
|
import { Quaternion as P, Euler as X, LoadingManager as _e, Group as L, Mesh as z, MeshLambertMaterial as He, MeshPhongMaterial as Re, MeshStandardMaterial as oe, TextureLoader as et, SRGBColorSpace as tt, RepeatWrapping as it, BoxGeometry as re, SphereGeometry as ae, CylinderGeometry as De, CapsuleGeometry as qe, Matrix4 as W, Vector3 as O, MathUtils as st, Matrix3 as Ae, Box3 as $e, AxesHelper as nt, ArrowHelper as Ee, Line as ot, BufferGeometry as rt, LineBasicMaterial as je, Float32BufferAttribute as at, MeshBasicMaterial as Se, LineSegments as lt, EdgesGeometry as ct } from "three";
|
|
7
7
|
import { GLTFLoader as ut } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
8
8
|
import { ColladaLoader as dt } from "three/examples/jsm/loaders/ColladaLoader.js";
|
|
@@ -1090,7 +1090,7 @@ async function Vt(i, e, s) {
|
|
|
1090
1090
|
const a = e.format === "xacro";
|
|
1091
1091
|
if (a) {
|
|
1092
1092
|
(q = e.reportProgress) == null || q.call(e, "xacro", "正在展开 Xacro 宏与依赖文件...");
|
|
1093
|
-
const { expandXacro: v } = await import("./xacro-
|
|
1093
|
+
const { expandXacro: v } = await import("./xacro-BJGu3wdR.js");
|
|
1094
1094
|
n = await v(n, t, s, e.options.xacro, e.signal);
|
|
1095
1095
|
}
|
|
1096
1096
|
if (e.signal.aborted) throw Q();
|
|
@@ -1140,7 +1140,7 @@ async function Vt(i, e, s) {
|
|
|
1140
1140
|
try {
|
|
1141
1141
|
const G = await vt(o);
|
|
1142
1142
|
if (e.signal.aborted || S) throw Q();
|
|
1143
|
-
const Z = await import("./mujoco-runtime-
|
|
1143
|
+
const Z = await import("./mujoco-runtime-D2vfQAaN.js");
|
|
1144
1144
|
if (v = new Z.MujocoRuntime(), await v.initialize(G, {
|
|
1145
1145
|
baseUrl: e.options.mujocoBaseUrl,
|
|
1146
1146
|
wasmModule: e.options.mujocoWasmModule
|