Class GeospatialCameraMovement
Hierarchy (View Summary)
- CameraMovement
- GeospatialCameraMovement
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
new GeospatialCameraMovement(
scene: Scene,
limits: GeospatialLimits,
cameraPosition: Vector3,
_cameraCenter: Vector3,
_cameraLookAt: Vector3,
pickPredicate?: MeshPredicate,
behavior?: InterpolatingBehavior<GeospatialCamera>,
): GeospatialCameraMovementParameters
- scene: Scene
- limits: GeospatialLimits
Geospatial bounds (min/max latitude, longitude, altitude, etc.) used to clamp camera motion.
- cameraPosition: Vector3
- _cameraCenter: Vector3
- _cameraLookAt: Vector3
OptionalpickPredicate: MeshPredicateOptionalbehavior: InterpolatingBehavior<GeospatialCamera>
Returns GeospatialCameraMovement
Properties
active Input
Should be set by input classes to indicate whether there is active input this frame. This helps differentiate between 0 pixel delta due to no input vs user actively holding still.
Optionalcomputed Per Frame Zoom Pick Point
World-space picked point under the cursor, computed each frame that zoom input is active.
Used to determine the zoom direction when zoomToCursor is true.
Undefined when there is no active zoom or the pick misses the globe.
Readonlyinput
Input system that maps physical inputs to interactions and dispatches to handlers.
limits
Geospatial bounds (min/max latitude, longitude, altitude, etc.) used to clamp camera motion.
pan Accumulated Pixels
Accumulated pixel delta (by input classes) for panning this frame Read by computeCurrentFrameDeltas() function and converted into panDeltaCurrentFrame (taking speed into account) Reset to zero after each frame
pan Delta Current Frame
Pan delta to apply to camera this frame, computed by computeCurrentFrameDeltas() from panPixelDelta (taking speed into account)
pan Inertia
Inertia applied to the panning velocity when there is no user input. Higher inertia === slower decay, velocity retains more of its value each frame.
Note: ArcRotateCamera overrides this from camera.panningInertia (which defaults to camera.inertia).
pan Speed
Desired coordinate unit movement per input pixel when panning
Optionalpick Predicate
Predicate function to determine which meshes to pick against (e.g., globe mesh)
reference Frame Rate
Framerate (Hz) at which inertia values are calibrated. Default 60 matches legacy camera feel at any actual refresh rate. Override to 120, 144, etc. only if your app was tuned on that specific refresh rate under the legacy (framerate-dependent) camera math and you want to preserve that exact decay characteristic. Most applications should leave this at 60.
rotation Accumulated Pixels
Accumulated pixel delta (by input classes) for rotation this frame Read by computeCurrentFrameDeltas() function and converted into rotationDeltaCurrentFrame (taking speed into account) Reset to zero after each frame
rotation Delta Current Frame
Rotation delta to apply to camera this frame, computed by computeCurrentFrameDeltas() from rotationPixelDelta (taking speed into account)
rotation Inertia
Inertia applied to the rotation velocity when there is no user input. Higher inertia === slower decay, velocity retains more of its value each frame.
Note: ArcRotateCamera syncs this from camera.inertia via an accessor on the camera class.
To tune independently, override inside scene.onBeforeRenderObservable after camera.inertia is read.
rotation X Speed
Desired radians movement per input pixel when rotating along x axis
rotation Y Speed
Desired radians movement per input pixel when rotating along y axis
speed
Global speed multiplier applied to all movement (pan, rotation, zoom). Acts as a master scale factor on top of the individual speed properties.
zoom Accumulated Pixels
Accumulated pixel delta (by input classes) for zoom this frame Read by computeCurrentFrameDeltas() function and converted into zoomDeltaCurrentFrame (taking speed into account) Reset to zero after each frame
zoom Delta Current Frame
Zoom delta to apply to camera this frame, computed by computeCurrentFrameDeltas() from zoomPixelDelta (taking speed into account)
zoom Inertia
Inertia applied to the zoom velocity when there is no user input. Higher inertia === slower decay, velocity retains more of its value each frame.
Note: ArcRotateCamera syncs this from camera.inertia via an accessor on the camera class.
To tune independently, override inside scene.onBeforeRenderObservable after camera.inertia is read.
zoom Speed
Desired coordinate unit movement per input pixel when zooming
zoom To Cursor
When true, zooming moves toward the point under the cursor. When false, zooming moves along the camera's look vector.
Accessors
is Dragging
-
get isDragging(): boolean
Returns true when a drag gesture is active (between startDrag and stopDrag).
Returns boolean
is Interpolating
-
get isInterpolating(): boolean
Returns true when the camera is playing an interpolating (fly-to) animation. Useful for suppressing user-input movement while a programmatic animation is active.
Returns boolean
Methods
calculate Up Vector From Point To Ref
-
Function to calculate the up vector from a given point. Can be overridden to support non-spherical planets or custom up vector logic. Defaults to using the geocentric normal.
Parameters
Returns Vector3
The calculated up vector
compute Current Frame Deltas
-
Consumes the per-frame accumulated pan/rotate/zoom deltas and applies them to the camera state, with geospatial-specific dampening (e.g. slower panning near the poles, parallax-based pan compensation). Called once per frame by the scene's render loop via
_checkInputs.Returns void
get Frame Independent Decay
-
Returns the per-frame decay factor for a given inertia, adjusted to this frame's
dt. At the reference frame rate, returnsinertiaunchanged (matches legacy per-frame*= inertia). Use this when implementing custom decaying accumulators (e.g. zoom-to-cursor coupled pan) that need framerate-independent glide duration.Parameters
- inertia: number
The inertia value (0-1) whose per-frame decay factor is needed.
Returns number
The decay factor to multiply a value by this frame.
- inertia: number
get Frame Independent Input Scale
-
Returns the input-scale factor to apply to an impulse injected into a decaying accumulator so that the integrated total is framerate-independent and matches legacy at 60fps. At the reference frame rate, returns 1 (no-op). At high fps, scales the impulse down so the sum over the decay tail stays equal to
impulse / (1 - inertia)— the legacy total.Parameters
- inertia: number
The inertia value (0-1) used by the accumulator.
Returns number
The scaling factor to multiply an impulse by before adding it to the accumulator.
- inertia: number
handle Drag
-
Updates the drag gesture by recalculating the intersection with the drag plane and accumulating the resulting pan delta.
Parameters
- pointerX: number
Current screen X coordinate
- pointerY: number
Current screen Y coordinate
Returns void
- pointerX: number
handle Zoom
-
Accumulates a zoom delta and determines the zoom target point via raycasting.
Parameters
- zoomDelta: number
Signed zoom amount (positive = zoom in, negative = zoom out)
- toCursor: boolean
When true, zoom toward the point under the cursor; when false, zoom along the look vector
Returns void
- zoomDelta: number
pick Along Vector
-
Casts a ray from the camera position along the given direction and returns the pick result.
Parameters
- vector: Vector3
World-space direction to cast along
Returns Nullable<PickingInfo>
The pick result, or null if no hit
- vector: Vector3
reset Pan Velocity
-
Resets the pan velocity and accumulated pixels, stopping any in-progress pan inertia.
Returns void
reset Rotation Velocity
-
Resets the rotation velocity and accumulated pixels, stopping any in-progress rotation inertia. Called when inertialAlphaOffset or inertialBetaOffset are explicitly zeroed (backward compat).
Returns void
reset Zoom Velocity
-
Resets the zoom velocity and accumulated pixels, stopping any in-progress zoom inertia. Called when inertialRadiusOffset is explicitly zeroed out (backward compat).
Returns void
start Drag
-
Begins a drag (pan) gesture by picking the globe at the given screen position and establishing a drag plane for subsequent updates.
Parameters
- pointerX: number
Screen X coordinate of the pointer
- pointerY: number
Screen Y coordinate of the pointer
Returns void
- pointerX: number
stop Drag
-
Ends the current drag gesture, releasing the drag plane.
Returns void
Geospatial-specific camera movement system that extends the base movement with raycasting and altitude-aware zoom constraints.
This class encapsulates geospatial camera movement logic: