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.

63 lines (62 loc) 2.38 kB
/** This file must only contain pure code and pure imports */ import { type ArcRotateCamera } from "../../Cameras/arcRotateCamera.pure.js"; import { type ICameraInput } from "../../Cameras/cameraInputsManager.js"; /** * Manage the device orientation inputs (gyroscope) to control an arc rotate camera. * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs */ export declare class ArcRotateCameraVRDeviceOrientationInput implements ICameraInput<ArcRotateCamera> { /** * Defines the camera the input is attached to. */ camera: ArcRotateCamera; /** * Defines a correction factor applied on the alpha value retrieved from the orientation events. */ alphaCorrection: number; /** * Defines a correction factor applied on the gamma value retrieved from the orientation events. */ gammaCorrection: number; private _alpha; private _gamma; private _dirty; private _deviceOrientationHandler; /** * Instantiate a new ArcRotateCameraVRDeviceOrientationInput. */ constructor(); /** * Attach the input controls to a specific dom element to get the input from. * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) */ attachControl(noPreventDefault?: boolean): void; /** * @internal */ _onOrientationEvent(evt: DeviceOrientationEvent): void; /** * Update the current camera state depending on the inputs that have been used this frame. * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop. */ checkInputs(): void; /** * Detach the current controls from the specified dom element. */ detachControl(): void; /** * Gets the class name of the current input. * @returns the class name */ getClassName(): string; /** * Get the friendly name associated with the input class. * @returns the input friendly name */ getSimpleName(): string; } /** * Register side effects for arcRotateCameraVRDeviceOrientationInput. * Safe to call multiple times; only the first call has an effect. */ export declare function RegisterArcRotateCameraVRDeviceOrientationInput(): void;