@nebula-spatial/viewer 0.6.0 → 0.6.1

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/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,12 @@ export interface ViewerOptions {
138
143
  export interface ViewerFitViewOptions {
139
144
  padding?: number;
140
145
  viewMode?: ViewerViewMode;
146
+ /** Keep the document/asset-owned preview camera range and clipping profile. */
147
+ preservePreviewCameraRange?: boolean;
148
+ /** Rebuild the preview camera profile without moving the camera. */
149
+ preserveCameraPose?: boolean;
150
+ /** Maximum preview orbit distance as a multiple of the fitted radius. */
151
+ previewMaxDistanceFactor?: number;
141
152
  }
142
153
  export interface ViewerPickOptions {
143
154
  /** Stop at the nearest intersection when accelerated picking is available. */
@@ -244,6 +255,10 @@ export interface Viewer {
244
255
  dispose?: boolean;
245
256
  }): Object3D | null;
246
257
  };
258
+ readonly renderEffects: {
259
+ add(effect: ViewerRenderEffect): () => void;
260
+ remove(effect: ViewerRenderEffect): boolean;
261
+ };
247
262
  readonly camera: {
248
263
  getState(): ViewerCameraSnapshot | null;
249
264
  /** Applies a validated snapshot immediately. Animated transitions are not part of the current contract. */
@@ -289,6 +304,11 @@ export interface Viewer {
289
304
  setTransparentHdrBackdropBlurriness(value: number): boolean;
290
305
  /** Switches the model/simulation preview pointer mapping at runtime. */
291
306
  setPreviewDragPreset(preset: ViewerPreviewDragPreset): void;
307
+ /**
308
+ * Current damping override. Set a number for an immediate effect, or null to
309
+ * return to the selected preview preset's default.
310
+ */
311
+ previewCameraDampingFactor: number | null;
292
312
  /**
293
313
  * Opens a multi-asset scene under the existing single Renderer/Scene/RAF.
294
314
  *
@@ -306,6 +326,15 @@ export interface Viewer {
306
326
  replace?: boolean;
307
327
  }): void;
308
328
  }
329
+ export interface ViewerRenderEffectContext {
330
+ readonly purpose: 'viewport' | 'capture';
331
+ readonly target: import('three').WebGLRenderTarget | null;
332
+ }
333
+ export interface ViewerRenderEffect {
334
+ isActive?(): boolean;
335
+ afterScene(renderer: import('three').WebGLRenderer, scene: import('three').Scene, camera: import('three').Camera, context: ViewerRenderEffectContext): void;
336
+ dispose?(): void;
337
+ }
309
338
  /**
310
339
  * Offscreen frame capture. The capture renders through the same Renderer,
311
340
  * 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-BEDGD9CL.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-DoxM1Msk.js";
4
+ import { c as Ge, b as Te, d as Ve, w as ye, e as ge, p as Je } from "./asset-ir-BXa1EdOy.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-CHf9y9eX.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-Cl7vUCSC.js");
1093
+ const { expandXacro: v } = await import("./xacro-BCLnc3tY.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-BmuEJ_ST.js");
1143
+ const Z = await import("./mujoco-runtime-BA88JuDR.js");
1144
1144
  if (v = new Z.MujocoRuntime(), await v.initialize(G, {
1145
1145
  baseUrl: e.options.mujocoBaseUrl,
1146
1146
  wasmModule: e.options.mujocoWasmModule