@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/dist/index.d.ts CHANGED
@@ -22,7 +22,7 @@ export { USD_RESOURCE_AUTH, USD_RESOURCE_EXTERNAL_DENIED, USD_RESOURCE_FETCH, US
22
22
  export type { Disposable, ToolbarItem, ViewerState, ViewerInteractionHooks, ViewerContributionPoint, ViewerPlugin, ViewerPluginContext, ViewerPluginRegistry, } from './plugins';
23
23
  export { configureViewerText } from './cad/text';
24
24
  export type { ViewerTextBuilderOptions } from './cad/text';
25
- export type { CadBlockModel, CadDocumentHandle, CadDocumentUnits, CadFontResolver, CadFontRequest, CadResolvedFont, CadResolvedTextFont, CadTextWarmupOptions, CadHudModel, CadHudSnapshot, CadInspectorModel, CadInspectorSnapshot, CadLayerModel, CadLayerRow, CadBlockUsageRow, CadSessionPhase, CadWorldBounds, CadScaleRulerState, CadInsertDetails, CadInsertSelection, CadInsertSelectionId, CadTextDetails, CadTextSelection, CadTextSelectionId, CadSelection, CadHit, CadViewerSnapshot, CadLoadProgress, CadViewerErrorCode, CadViewerErrorEvent, CadLoadSource, CadOpenOptions, CadSessionLoadTiming, RenderDebugBreakdownEntry, SplitBlockLayerDetail, CadViewerCapability, ResolveTextFont, CadViewerEventMap, CameraStateStore, Viewer, ViewerEventMap, ViewerEnvironment, ViewerEnvironmentState, ViewerEnvironmentTexture, ViewerFitViewOptions, ViewerHighlightOptions, ViewerOptions, ViewerPickOptions, ViewerPickResult, ViewerPointerEvent, ViewerObjectOptions, ViewerPreviewDragPreset, ViewerCameraSnapshot, ViewerOrthographicSnapshot, ViewerOrbitSnapshot, ViewerRenderStats, ViewerDocumentRect, ViewerCadUiKeyboardOptions, ViewerUiOptions, ViewerCadUiParts, ViewerCadUiOptions, ViewerUiPreset, ViewerCadUiStateStore, ViewerUiTheme, ViewerViewMode, CadInteractionMode, CameraChangeReason, ViewerUiTokens, } from './types';
25
+ export type { CadBlockModel, CadDocumentHandle, CadDocumentUnits, CadFontResolver, CadFontRequest, CadResolvedFont, CadResolvedTextFont, CadTextWarmupOptions, CadHudModel, CadHudSnapshot, CadInspectorModel, CadInspectorSnapshot, CadLayerModel, CadLayerRow, CadBlockUsageRow, CadSessionPhase, CadWorldBounds, CadScaleRulerState, CadInsertDetails, CadInsertSelection, CadInsertSelectionId, CadTextDetails, CadTextSelection, CadTextSelectionId, CadSelection, CadHit, CadViewerSnapshot, CadLoadProgress, CadViewerErrorCode, CadViewerErrorEvent, CadLoadSource, CadOpenOptions, CadSessionLoadTiming, RenderDebugBreakdownEntry, SplitBlockLayerDetail, CadViewerCapability, ResolveTextFont, CadViewerEventMap, CameraStateStore, Viewer, ViewerEventMap, ViewerEnvironment, ViewerEnvironmentState, ViewerEnvironmentTexture, ViewerFitViewOptions, ViewerHighlightOptions, ViewerOptions, ViewerPickOptions, ViewerPickResult, ViewerPointerEvent, ViewerObjectOptions, ViewerPreviewDragPreset, ViewerCameraSnapshot, ViewerOrthographicSnapshot, ViewerOrbitSnapshot, ViewerRenderStats, ViewerRenderEffect, ViewerRenderEffectContext, ViewerDocumentRect, ViewerCadUiKeyboardOptions, ViewerUiOptions, ViewerCadUiParts, ViewerCadUiOptions, ViewerUiPreset, ViewerCadUiStateStore, ViewerUiTheme, ViewerViewMode, CadInteractionMode, CameraChangeReason, ViewerUiTokens, } from './types';
26
26
  export type { JointInspection, JointInspectionJoint, JointInspectionSnapshot, AssetInspection, UrdfEntityKind, UrdfInspection, UrdfInspectionEntity, UrdfInspectionIssue, UrdfInspectionJoint, UrdfInspectionLink, UrdfInspectionMode, UrdfInspectionNode, UrdfInspectionOverlays, UrdfInspectionRobot, UrdfInspectionSnapshot, UrdfSourceRange } from './inspection/types';
27
27
  /**
28
28
  * Multi-asset scene authoring. A scene owns one stage and several placed
@@ -34,7 +34,7 @@ export { createSceneSession, findInstanceId } from './scene/session';
34
34
  export type { SceneSessionDeps } from './scene/session';
35
35
  export { clampJointValue, createSceneInstanceJoints, isSceneScalarJoint, jointBlockReason, toSceneJointDescriptor, } from './scene/joints';
36
36
  export type { JointInspectionSource, SceneInstanceJoints, SceneJointBlockReason, SceneJointDescriptor, SceneJointPose, SceneJointSnapshot, SceneJointState, } from './scene/joints';
37
- export type { SceneControl, SceneDeterministicCheckOptions, SceneDeterministicCheckResult, SceneEntry, SceneInspectionOverlay, SceneInstanceBounds, SceneInstancePhysics, SceneInstanceRuntime, SceneInstanceSnapshot, SceneInstancePhase, SceneOptions, ScenePhysicsConfiguration, ScenePhysicsState, ScenePlacement, SceneSnapshot, Vec3Like, } from './scene/types';
37
+ export type { SceneControl, SceneDeterministicCheckOptions, SceneDeterministicCheckResult, SceneEntry, SceneInspectionOverlay, SceneInstanceBounds, SceneInstancePhysics, SceneInstanceRuntime, SceneInstanceSnapshot, SceneInstancePhase, SceneOptions, ScenePhysicsConfiguration, ScenePhysicsState, ScenePlacement, ScenePlacementCommitOptions, SceneSnapshot, Vec3Like, } from './scene/types';
38
38
  export type { PhysicsBodyMotionType, PhysicsRuntimeBodyState, PhysicsRuntimeCaptureOptions, PhysicsRuntimeContactState, PhysicsRuntimeGrabState, PhysicsRuntimeJointState, PhysicsRuntimeSnapshot, } from './simulation/physics-runtime-state';
39
39
  export type { UsdInspectionJoint, UsdInspectionMaterial, UsdInspectionMesh, UsdInspectionPrim, UsdInspectionSnapshot, UsdInspectionStage, UsdInspectionVariantSet, } from './simulation/usd-inspection';
40
40
  export type { ViewerCaptureOptions, ViewerCaptureResult } from './types';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as s, I as o, V as r, J as n, U as t, H as i, W as c, X as U, Y as d, Z as S, _ as E, $ as _, a0 as D, a1 as l, a2 as R, L as m, a3 as p, a4 as u, m as C, a5 as O, a6 as I, a7 as V, a8 as G, a9 as T, aa as f, ab as N } from "./index-DoxM1Msk.js";
1
+ import { D as s, I as o, V as r, J as n, U as t, H as i, W as c, X as U, Y as d, Z as S, _ as E, $ as _, a0 as D, a1 as l, a2 as R, L as m, a3 as p, a4 as u, m as C, a5 as O, a6 as I, a7 as V, a8 as G, a9 as T, aa as f, ab as N } from "./index-D4V1Rbos.js";
2
2
  import { configureCadTextBuilder as x } from "@nebula-spatial/cad-loader";
3
3
  export {
4
4
  s as DEFAULT_GROUND_GRID_SCALE,
@@ -1,4 +1,4 @@
1
- import { O as v, T as E, d as z } from "./index-DoxM1Msk.js";
1
+ import { O as v, T as E, d as z } from "./index-D4V1Rbos.js";
2
2
  import { Group as q, Euler as G, BoxGeometry as N, SphereGeometry as P, CylinderGeometry as $, CapsuleGeometry as I, PlaneGeometry as X, Mesh as j } from "three";
3
3
  function D(f) {
4
4
  const y = f.extension.documents, l = new q();
@@ -3,7 +3,7 @@ var B = (p, t, e) => t in p ? P(p, t, { enumerable: !0, configurable: !0, writab
3
3
  var j = (p, t, e) => B(p, typeof t != "symbol" ? t + "" : t, e);
4
4
  import L from "@mujoco/mujoco";
5
5
  import { Quaternion as D, Vector3 as w } from "three";
6
- import { e as C, y as R } from "./index-DoxM1Msk.js";
6
+ import { e as C, y as R } from "./index-D4V1Rbos.js";
7
7
  let V = 0;
8
8
  function z(p, t) {
9
9
  const e = `/viewer-simulation-${++V}`;
@@ -14,6 +14,7 @@ import type { AssetPhysicsState, AssetPreviewCapabilities, AssetWarningSnapshot
14
14
  import type { CadLoadSource } from '../cad/types';
15
15
  import type { PhysicsBodyMotionType, PhysicsRuntimeSnapshot } from '../simulation/physics-runtime-state';
16
16
  import type { SceneInstanceJoints } from './joints';
17
+ import type { ViewerRenderEffectContext } from '../types';
17
18
  /** Plain readonly tuple, kept local so this module imports no document types. */
18
19
  export type Vec3Like = readonly [number, number, number];
19
20
  /** Placement of one asset inside the scene, relative to the scene root. */
@@ -28,6 +29,14 @@ export interface ScenePlacement {
28
29
  readonly pivot?: Vec3Like;
29
30
  readonly visible?: boolean;
30
31
  }
32
+ export interface ScenePlacementCommitOptions {
33
+ /**
34
+ * Updates the rendered pose immediately and rebuilds physics in the
35
+ * background. Authoring gestures use this so pointer release is not blocked
36
+ * by MuJoCo compilation.
37
+ */
38
+ readonly deferPhysics?: boolean;
39
+ }
31
40
  /** One asset instance placed in the scene. */
32
41
  export interface SceneEntry {
33
42
  /** Stable caller-chosen id echoed back by instance-level commands. */
@@ -52,6 +61,18 @@ export interface SceneEntry {
52
61
  export interface SceneOptions {
53
62
  readonly signal?: AbortSignal;
54
63
  readonly simulationTheme?: 'dark' | 'light';
64
+ /**
65
+ * Ground-grid sizing. `scene` follows mounted scene bounds (default).
66
+ * `editor` fixes the grid to world z=0 and adapts its density to the camera.
67
+ */
68
+ readonly groundGridMode?: 'scene' | 'editor';
69
+ /**
70
+ * Render the ground's planar mirror pass. Defaults to `true`.
71
+ *
72
+ * Disabling it keeps the grid and editor axes while skipping the extra scene
73
+ * render used to populate the reflection texture.
74
+ */
75
+ readonly groundReflection?: boolean;
55
76
  readonly dracoDecoderPath?: string;
56
77
  readonly ktx2TranscoderPath?: string;
57
78
  readonly mujocoBaseUrl?: string;
@@ -176,10 +197,10 @@ export interface SceneControl {
176
197
  getSnapshot(): SceneSnapshot;
177
198
  subscribe(listener: (snapshot: SceneSnapshot) => void): () => void;
178
199
  /**
179
- * Replaces one loaded instance placement and resolves after the shared scene
180
- * physics world has been rebuilt for the committed pose.
200
+ * Replaces one loaded instance placement. By default it resolves after the
201
+ * shared scene physics world has been rebuilt for the committed pose.
181
202
  */
182
- setInstancePlacement(id: string, placement: ScenePlacement): Promise<boolean>;
203
+ setInstancePlacement(id: string, placement: ScenePlacement, options?: ScenePlacementCommitOptions): Promise<boolean>;
183
204
  /** Update the unified collision overlay for an uncommitted instance pose. */
184
205
  previewInstancePlacement(id: string, placement: ScenePlacement): boolean;
185
206
  /** Adds an instance at runtime; resolves once it is loaded or failed. */
@@ -216,7 +237,7 @@ export interface SceneControl {
216
237
  /** Advances all playing scene sessions and returns whether any pose changed. */
217
238
  update(deltaSeconds: number): boolean;
218
239
  /** Installs the one shared scene stage transaction for reflection and fog. */
219
- beforeRender(renderer: import('three').WebGLRenderer, scene: import('three').Scene, camera: import('three').Camera): (() => void) | void;
240
+ beforeRender(renderer: import('three').WebGLRenderer, scene: import('three').Scene, camera: import('three').Camera, context?: ViewerRenderEffectContext): (() => void) | void;
220
241
  /** Routes the Viewer's elastic-force grab to the hit scene instance. */
221
242
  beginGrab(event: PointerEvent, camera: import('three').Camera, canvas: HTMLElement): boolean;
222
243
  moveGrab(event: PointerEvent, camera: import('three').Camera, canvas: HTMLElement): void;
@@ -247,6 +268,8 @@ export interface SceneControl {
247
268
  setInstanceCollisionVisible(id: string, visible: boolean | null): boolean;
248
269
  setCollisionVisible(visible: boolean): void;
249
270
  setGroundVisible(visible: boolean): void;
271
+ /** Enables or disables the ground reflection pass without recreating the scene. */
272
+ setGroundReflectionEnabled(enabled: boolean): void;
250
273
  setTheme(theme: 'dark' | 'light'): void;
251
274
  close(): Promise<void>;
252
275
  }