UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

42 lines (41 loc) 2.52 kB
import type { GeospatialCamera } from "../../Cameras/geospatialCamera.js"; import type { IPointerEvent } from "../../Events/deviceInputEvents.js"; import type { PointerTouch } from "../../Events/pointerEvents.js"; import type { Nullable } from "../../types.js"; import { OrbitCameraPointersInput } from "./orbitCameraPointersInput.js"; /** * @experimental * 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 * * As of right now, the camera correction logic (to keep the camera geospatially oriented around the globe) is happening within the camera class when calculating viewmatrix * As this is experimental, it is possible we move that correction step to live within the input class (to enable non-corrected translations in the future), say if we want to allow the camera to move outside of the globe's orbit * * Left mouse button: drag globe * Middle mouse button: tilt globe around cursor location * Right mouse button: tilt globe around center of screen * */ export declare class GeospatialCameraPointersInput extends OrbitCameraPointersInput { camera: GeospatialCamera; getClassName(): string; onButtonDown(evt: IPointerEvent): void; onTouch(point: Nullable<PointerTouch>, offsetX: number, offsetY: number): void; /** * Move camera from multitouch (pinch) zoom distances. * @param previousPinchSquaredDistance * @param pinchSquaredDistance */ protected _computePinchZoom(previousPinchSquaredDistance: number, pinchSquaredDistance: number): void; /** * Move camera from multi touch panning positions. * In geospatialcamera, multi touch panning tilts the globe (whereas single touch will pan/drag it) * @param previousMultiTouchPanPosition * @param multiTouchPanPosition */ protected _computeMultiTouchPanning(previousMultiTouchPanPosition: Nullable<PointerTouch>, multiTouchPanPosition: Nullable<PointerTouch>): void; onDoubleTap(type: string): void; onMultiTouch(pointA: Nullable<PointerTouch>, pointB: Nullable<PointerTouch>, previousPinchSquaredDistance: number, pinchSquaredDistance: number, previousMultiTouchPanPosition: Nullable<PointerTouch>, multiTouchPanPosition: Nullable<PointerTouch>): void; onButtonUp(_evt: IPointerEvent): void; private _handleTilt; }