Class GeospatialCameraPointersInput
Hierarchy
- OrbitCameraPointersInput
- GeospatialCameraPointersInput
Constructors
constructor
-
Returns GeospatialCameraPointersInput
Properties
buttons
Defines the buttons associated with the input to handle camera move.
camera
Defines the camera the input is attached to.
double Tap Animation Duration Ms
Duration (in milliseconds) of the fly-to animation triggered by a double tap.
double Tap Easing Function
Optional easing function applied to the double-tap fly-to animation. An EasingFunction instance can be created once and reused across double taps.
multi Touch Pan And Zoom
Defines whether panning is enabled for both pan (2 fingers swipe) and zoom (pinch) through multitouch.
multi Touch Panning
Defines whether panning (2 fingers swipe) is enabled through multitouch.
pinch To Pan Max
Defines the distance used to consider the camera in pan mode vs pinch/zoom. Basically if your fingers moves away from more than this distance you will be considered in pinch mode.
pinch Zoom
Defines whether zoom (2 fingers pinch) is enabled through multitouch
Accessors
pitch Sensitivity
-
get pitchSensitivity(): number
Defines the rotation sensitivity of the pointer when rotating camera around the x axis (pitch). (Multiplied by the true pixel delta of pointer input, before rotation speed factor is applied by movement class)
Returns number
-
set pitchSensitivity(value: number): void
Parameters
- value: number
Returns void
yaw Sensitivity
-
get yawSensitivity(): number
Defines the rotation sensitivity of the pointer when rotating the camera around the Y axis (yaw). (Multiplied by the true pixel delta of pointer input, before rotation speed factor is applied by movement class)
Returns number
-
set yawSensitivity(value: number): void
Parameters
- value: number
Returns void
Methods
attach Control
-
Attach the input controls to a specific dom element to get the input from.
Parameters
OptionalnoPreventDefault: booleanDefines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
Returns void
detach Control
-
Detach the current controls from the specified dom element.
Returns void
get Class Name
-
Gets the class name of the current input.
Returns string
the class name
get Simple Name
-
Get the friendly name associated with the input class.
Returns string
the input friendly name
on Button Down
-
Handles the pointer-down event. Captures the active button + modifier state, resolves which inputMap entry should drive the gesture, and starts pan tracking if the resolved interaction is "pan".
Parameters
- evt: IPointerEvent
The pointer-down event.
Returns void
- evt: IPointerEvent
on Button Up
-
Called each time a new POINTERUP event occurs. Ie, for each button release.
Parameters
- _evt: IPointerEvent
Defines the event to track
Returns void
- _evt: IPointerEvent
on Context Menu
-
Called on JS contextmenu event. Override this method to provide functionality.
Parameters
- evt: PointerEvent
the event to be handled
Returns void
- evt: PointerEvent
on Double Tap
-
Called on pointer POINTERDOUBLETAP event. Override this method to provide functionality on POINTERDOUBLETAP event.
Parameters
- type: string
type of event
Optionalevt: IPointerEventthe pointer event that triggered the double tap (carries button / buttons state)
Returns void
- type: string
on Lost Focus
-
Called when window becomes inactive.
Returns void
on Multi Touch
-
onMultiTouch(
pointA: Nullable<PointerTouch>,
pointB: Nullable<PointerTouch>,
previousPinchSquaredDistance: number,
pinchSquaredDistance: number,
previousMultiTouchPanPosition: Nullable<PointerTouch>,
multiTouchPanPosition: Nullable<PointerTouch>,
): voidHandles a multi-touch (pinch / two-finger pan) gesture. Detects whether the gesture should be interpreted as a pinch zoom or a two-finger pan based on cumulative finger distance change, and forwards the gesture to the parent class once a mode is decided.
Parameters
- pointA: Nullable<PointerTouch>
First active touch point, or null if it just ended.
- pointB: Nullable<PointerTouch>
Second active touch point, or null if it just ended.
- previousPinchSquaredDistance: number
Squared distance between the two touches on the previous frame.
- pinchSquaredDistance: number
Squared distance between the two touches on the current frame.
- previousMultiTouchPanPosition: Nullable<PointerTouch>
Centroid of the two touches on the previous frame, or null if unavailable.
- multiTouchPanPosition: Nullable<PointerTouch>
Centroid of the two touches on the current frame, or null if the gesture ended.
Returns void
- pointA: Nullable<PointerTouch>
on Touch
-
Called on pointer POINTERMOVE event if only a single touch is active. Override this method to provide functionality.
Parameters
- point: Nullable<PointerTouch>
The current position of the pointer
- offsetX: number
The offsetX of the pointer when the event occurred
- offsetY: number
The offsetY of the pointer when the event occurred
Returns void
- point: Nullable<PointerTouch>
Geospatial camera inputs can simulate dragging the globe around or tilting the camera around some point on the globe This class will update the GeospatialCameraMovement class's movementDeltaCurrentFrame, and the camera is responsible for using these updates to calculate viewMatrix appropriately
Uses the inputMap on the movement class to determine which button maps to which interaction. Default: Left mouse button = pan (drag globe), Middle/Right mouse button = rotate (tilt)