freeCameraMouseWheelInput.d.ts 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. import type { Nullable } from "../../types";
  2. import type { FreeCamera } from "../../Cameras/freeCamera";
  3. import { BaseCameraMouseWheelInput } from "../../Cameras/Inputs/BaseCameraMouseWheelInput";
  4. import { Coordinate } from "../../Maths/math.axis";
  5. /**
  6. * Manage the mouse wheel inputs to control a free camera.
  7. * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
  8. */
  9. export declare class FreeCameraMouseWheelInput extends BaseCameraMouseWheelInput {
  10. /**
  11. * Defines the camera the input is attached to.
  12. */
  13. camera: FreeCamera;
  14. /**
  15. * Gets the class name of the current input.
  16. * @returns the class name
  17. */
  18. getClassName(): string;
  19. /**
  20. * Set which movement axis (relative to camera's orientation) the mouse
  21. * wheel's X axis controls.
  22. * @param axis The axis to be moved. Set null to clear.
  23. */
  24. set wheelXMoveRelative(axis: Nullable<Coordinate>);
  25. /**
  26. * Get the configured movement axis (relative to camera's orientation) the
  27. * mouse wheel's X axis controls.
  28. * @returns The configured axis or null if none.
  29. */
  30. get wheelXMoveRelative(): Nullable<Coordinate>;
  31. /**
  32. * Set which movement axis (relative to camera's orientation) the mouse
  33. * wheel's Y axis controls.
  34. * @param axis The axis to be moved. Set null to clear.
  35. */
  36. set wheelYMoveRelative(axis: Nullable<Coordinate>);
  37. /**
  38. * Get the configured movement axis (relative to camera's orientation) the
  39. * mouse wheel's Y axis controls.
  40. * @returns The configured axis or null if none.
  41. */
  42. get wheelYMoveRelative(): Nullable<Coordinate>;
  43. /**
  44. * Set which movement axis (relative to camera's orientation) the mouse
  45. * wheel's Z axis controls.
  46. * @param axis The axis to be moved. Set null to clear.
  47. */
  48. set wheelZMoveRelative(axis: Nullable<Coordinate>);
  49. /**
  50. * Get the configured movement axis (relative to camera's orientation) the
  51. * mouse wheel's Z axis controls.
  52. * @returns The configured axis or null if none.
  53. */
  54. get wheelZMoveRelative(): Nullable<Coordinate>;
  55. /**
  56. * Set which rotation axis (relative to camera's orientation) the mouse
  57. * wheel's X axis controls.
  58. * @param axis The axis to be moved. Set null to clear.
  59. */
  60. set wheelXRotateRelative(axis: Nullable<Coordinate>);
  61. /**
  62. * Get the configured rotation axis (relative to camera's orientation) the
  63. * mouse wheel's X axis controls.
  64. * @returns The configured axis or null if none.
  65. */
  66. get wheelXRotateRelative(): Nullable<Coordinate>;
  67. /**
  68. * Set which rotation axis (relative to camera's orientation) the mouse
  69. * wheel's Y axis controls.
  70. * @param axis The axis to be moved. Set null to clear.
  71. */
  72. set wheelYRotateRelative(axis: Nullable<Coordinate>);
  73. /**
  74. * Get the configured rotation axis (relative to camera's orientation) the
  75. * mouse wheel's Y axis controls.
  76. * @returns The configured axis or null if none.
  77. */
  78. get wheelYRotateRelative(): Nullable<Coordinate>;
  79. /**
  80. * Set which rotation axis (relative to camera's orientation) the mouse
  81. * wheel's Z axis controls.
  82. * @param axis The axis to be moved. Set null to clear.
  83. */
  84. set wheelZRotateRelative(axis: Nullable<Coordinate>);
  85. /**
  86. * Get the configured rotation axis (relative to camera's orientation) the
  87. * mouse wheel's Z axis controls.
  88. * @returns The configured axis or null if none.
  89. */
  90. get wheelZRotateRelative(): Nullable<Coordinate>;
  91. /**
  92. * Set which movement axis (relative to the scene) the mouse wheel's X axis
  93. * controls.
  94. * @param axis The axis to be moved. Set null to clear.
  95. */
  96. set wheelXMoveScene(axis: Nullable<Coordinate>);
  97. /**
  98. * Get the configured movement axis (relative to the scene) the mouse wheel's
  99. * X axis controls.
  100. * @returns The configured axis or null if none.
  101. */
  102. get wheelXMoveScene(): Nullable<Coordinate>;
  103. /**
  104. * Set which movement axis (relative to the scene) the mouse wheel's Y axis
  105. * controls.
  106. * @param axis The axis to be moved. Set null to clear.
  107. */
  108. set wheelYMoveScene(axis: Nullable<Coordinate>);
  109. /**
  110. * Get the configured movement axis (relative to the scene) the mouse wheel's
  111. * Y axis controls.
  112. * @returns The configured axis or null if none.
  113. */
  114. get wheelYMoveScene(): Nullable<Coordinate>;
  115. /**
  116. * Set which movement axis (relative to the scene) the mouse wheel's Z axis
  117. * controls.
  118. * @param axis The axis to be moved. Set null to clear.
  119. */
  120. set wheelZMoveScene(axis: Nullable<Coordinate>);
  121. /**
  122. * Get the configured movement axis (relative to the scene) the mouse wheel's
  123. * Z axis controls.
  124. * @returns The configured axis or null if none.
  125. */
  126. get wheelZMoveScene(): Nullable<Coordinate>;
  127. /**
  128. * Called for each rendered frame.
  129. */
  130. checkInputs(): void;
  131. private _moveRelative;
  132. private _rotateRelative;
  133. private _moveScene;
  134. /**
  135. * These are set to the desired default behaviour.
  136. */
  137. private _wheelXAction;
  138. private _wheelXActionCoordinate;
  139. private _wheelYAction;
  140. private _wheelYActionCoordinate;
  141. private _wheelZAction;
  142. private _wheelZActionCoordinate;
  143. /**
  144. * Update the camera according to any configured properties for the 3
  145. * mouse-wheel axis.
  146. */
  147. private _updateCamera;
  148. /**
  149. * Update one property of the camera.
  150. * @param value
  151. * @param cameraProperty
  152. * @param coordinate
  153. */
  154. private _updateCameraProperty;
  155. }