arcRotateCameraPointersInput.d.ts 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. import type { Nullable } from "../../types";
  2. import type { ArcRotateCamera } from "../../Cameras/arcRotateCamera";
  3. import { BaseCameraPointersInput } from "../../Cameras/Inputs/BaseCameraPointersInput";
  4. import type { PointerTouch } from "../../Events/pointerEvents";
  5. import type { IPointerEvent } from "../../Events/deviceInputEvents";
  6. /**
  7. * Manage the pointers inputs to control an arc rotate camera.
  8. * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
  9. */
  10. export declare class ArcRotateCameraPointersInput extends BaseCameraPointersInput {
  11. /**
  12. * Defines the camera the input is attached to.
  13. */
  14. camera: ArcRotateCamera;
  15. /**
  16. * The minimum radius used for pinch, to avoid radius lock at 0
  17. */
  18. static MinimumRadiusForPinch: number;
  19. /**
  20. * Gets the class name of the current input.
  21. * @returns the class name
  22. */
  23. getClassName(): string;
  24. /**
  25. * Defines the buttons associated with the input to handle camera move.
  26. */
  27. buttons: number[];
  28. /**
  29. * Defines the pointer angular sensibility along the X axis or how fast is
  30. * the camera rotating.
  31. */
  32. angularSensibilityX: number;
  33. /**
  34. * Defines the pointer angular sensibility along the Y axis or how fast is
  35. * the camera rotating.
  36. */
  37. angularSensibilityY: number;
  38. /**
  39. * Defines the pointer pinch precision or how fast is the camera zooming.
  40. */
  41. pinchPrecision: number;
  42. /**
  43. * pinchDeltaPercentage will be used instead of pinchPrecision if different
  44. * from 0.
  45. * It defines the percentage of current camera.radius to use as delta when
  46. * pinch zoom is used.
  47. */
  48. pinchDeltaPercentage: number;
  49. /**
  50. * When useNaturalPinchZoom is true, multi touch zoom will zoom in such
  51. * that any object in the plane at the camera's target point will scale
  52. * perfectly with finger motion.
  53. * Overrides pinchDeltaPercentage and pinchPrecision.
  54. */
  55. useNaturalPinchZoom: boolean;
  56. /**
  57. * Defines whether zoom (2 fingers pinch) is enabled through multitouch
  58. */
  59. pinchZoom: boolean;
  60. /**
  61. * Defines the pointer panning sensibility or how fast is the camera moving.
  62. */
  63. panningSensibility: number;
  64. /**
  65. * Defines whether panning (2 fingers swipe) is enabled through multitouch.
  66. */
  67. multiTouchPanning: boolean;
  68. /**
  69. * Defines whether panning is enabled for both pan (2 fingers swipe) and
  70. * zoom (pinch) through multitouch.
  71. */
  72. multiTouchPanAndZoom: boolean;
  73. /**
  74. * Revers pinch action direction.
  75. */
  76. pinchInwards: boolean;
  77. private _isPanClick;
  78. private _twoFingerActivityCount;
  79. private _isPinching;
  80. /**
  81. * Move camera from multi touch panning positions.
  82. * @param previousMultiTouchPanPosition
  83. * @param multiTouchPanPosition
  84. */
  85. private _computeMultiTouchPanning;
  86. /**
  87. * Move camera from pinch zoom distances.
  88. * @param previousPinchSquaredDistance
  89. * @param pinchSquaredDistance
  90. */
  91. private _computePinchZoom;
  92. /**
  93. * Called on pointer POINTERMOVE event if only a single touch is active.
  94. * @param point current touch point
  95. * @param offsetX offset on X
  96. * @param offsetY offset on Y
  97. */
  98. onTouch(point: Nullable<PointerTouch>, offsetX: number, offsetY: number): void;
  99. /**
  100. * Called on pointer POINTERDOUBLETAP event.
  101. */
  102. onDoubleTap(): void;
  103. /**
  104. * Called on pointer POINTERMOVE event if multiple touches are active.
  105. * @param pointA point A
  106. * @param pointB point B
  107. * @param previousPinchSquaredDistance distance between points in previous pinch
  108. * @param pinchSquaredDistance distance between points in current pinch
  109. * @param previousMultiTouchPanPosition multi-touch position in previous step
  110. * @param multiTouchPanPosition multi-touch position in current step
  111. */
  112. onMultiTouch(pointA: Nullable<PointerTouch>, pointB: Nullable<PointerTouch>, previousPinchSquaredDistance: number, pinchSquaredDistance: number, previousMultiTouchPanPosition: Nullable<PointerTouch>, multiTouchPanPosition: Nullable<PointerTouch>): void;
  113. /**
  114. * Called each time a new POINTERDOWN event occurs. Ie, for each button
  115. * press.
  116. * @param evt Defines the event to track
  117. */
  118. onButtonDown(evt: IPointerEvent): void;
  119. /**
  120. * Called each time a new POINTERUP event occurs. Ie, for each button
  121. * release.
  122. * @param _evt Defines the event to track
  123. */
  124. onButtonUp(_evt: IPointerEvent): void;
  125. /**
  126. * Called when window becomes inactive.
  127. */
  128. onLostFocus(): void;
  129. }