@splnlss/3d-story-viewer 0.6.0 → 0.7.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.
package/README.md CHANGED
@@ -177,3 +177,14 @@ VITE_GOOGLE_MAPS_TOKEN=...
177
177
  - `utils/mapLayers.js`: example layer definitions
178
178
  - `utils/elevation/`: elevation utilities
179
179
  - `public/assets/viewer/`: static viewer assets
180
+ # Camera translation speed
181
+
182
+ `viewer.movementSpeed` sets camera-relative translation along the WGS84 ECEF
183
+ basis in metres per second (default `100`). `viewer.boostMultiplier` is the
184
+ dimensionless multiplier while the configured BOOST key is held (default `5`).
185
+ Both are writable number fields. Consumers should supply finite, non-negative
186
+ values. Mouse zoom/orbit and scripted camera transitions are independent.
187
+
188
+ Changing `viewer.keysEnabled` clears held keys and movement flags; resuming
189
+ requires a fresh key press. This lets popovers and text inputs suspend movement
190
+ without leaving the camera moving or resuming from a key typed in the control.
@@ -50,7 +50,11 @@ declare class Viewer extends EventDispatcher {
50
50
  pointerCoords: ViewerCoords;
51
51
  pointerXYZ: any;
52
52
  keysDown: {};
53
- keysEnabled: boolean;
53
+ _keysEnabled: boolean;
54
+ /** Camera-relative translation speed in WGS84 ECEF metres/second. */
55
+ movementSpeed: number;
56
+ /** Dimensionless multiplier while BOOST is held. */
57
+ boostMultiplier: number;
54
58
  movementKeys: {
55
59
  BOOST: string[];
56
60
  FRONT: string[];
@@ -75,6 +79,8 @@ declare class Viewer extends EventDispatcher {
75
79
  sky: Sky;
76
80
  pointerRaycaster: any;
77
81
  _onPointerMove: (event: any) => void;
82
+ set keysEnabled(enabled: boolean);
83
+ get keysEnabled(): boolean;
78
84
  updateMovementState(): void;
79
85
  /**
80
86
  * @param {number} lon
@@ -0,0 +1,4 @@
1
+ /** Apply camera-relative translation to a WGS84 ECEF position (metres).
2
+ * Speed is metres/second; deltaTime is seconds; boost is dimensionless.
3
+ */
4
+ export function applyKeyboardMovement(position: any, forward: any, right: any, up: any, state: any, deltaTime: any, movementSpeed: any, boostMultiplier: any): void;