deviceOrientationCamera.d.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { FreeCamera } from "./freeCamera";
  2. import type { Scene } from "../scene";
  3. import { Vector3 } from "../Maths/math.vector";
  4. import "./Inputs/freeCameraDeviceOrientationInput";
  5. import { Axis } from "../Maths/math.axis";
  6. /**
  7. * This is a camera specifically designed to react to device orientation events such as a modern mobile device
  8. * being tilted forward or back and left or right.
  9. */
  10. export declare class DeviceOrientationCamera extends FreeCamera {
  11. private _initialQuaternion;
  12. private _quaternionCache;
  13. private _tmpDragQuaternion;
  14. private _disablePointerInputWhenUsingDeviceOrientation;
  15. /**
  16. * Creates a new device orientation camera
  17. * @param name The name of the camera
  18. * @param position The start position camera
  19. * @param scene The scene the camera belongs to
  20. */
  21. constructor(name: string, position: Vector3, scene?: Scene);
  22. /**
  23. * Gets or sets a boolean indicating that pointer input must be disabled on first orientation sensor update (Default: true)
  24. */
  25. get disablePointerInputWhenUsingDeviceOrientation(): boolean;
  26. set disablePointerInputWhenUsingDeviceOrientation(value: boolean);
  27. private _dragFactor;
  28. /**
  29. * Enabled turning on the y axis when the orientation sensor is active
  30. * @param dragFactor the factor that controls the turn speed (default: 1/300)
  31. */
  32. enableHorizontalDragging(dragFactor?: number): void;
  33. /**
  34. * Gets the current instance class name ("DeviceOrientationCamera").
  35. * This helps avoiding instanceof at run time.
  36. * @returns the class name
  37. */
  38. getClassName(): string;
  39. /**
  40. * @internal
  41. * Checks and applies the current values of the inputs to the camera. (Internal use only)
  42. */
  43. _checkInputs(): void;
  44. /**
  45. * Reset the camera to its default orientation on the specified axis only.
  46. * @param axis The axis to reset
  47. */
  48. resetToCurrentRotation(axis?: Axis): void;
  49. }