arcRotateCameraKeyboardMoveInput.d.ts 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import type { ArcRotateCamera } from "../../Cameras/arcRotateCamera";
  2. import type { ICameraInput } from "../../Cameras/cameraInputsManager";
  3. /**
  4. * Manage the keyboard inputs to control the movement of an arc rotate camera.
  5. * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
  6. */
  7. export declare class ArcRotateCameraKeyboardMoveInput implements ICameraInput<ArcRotateCamera> {
  8. /**
  9. * Defines the camera the input is attached to.
  10. */
  11. camera: ArcRotateCamera;
  12. /**
  13. * Defines the list of key codes associated with the up action (increase alpha)
  14. */
  15. keysUp: number[];
  16. /**
  17. * Defines the list of key codes associated with the down action (decrease alpha)
  18. */
  19. keysDown: number[];
  20. /**
  21. * Defines the list of key codes associated with the left action (increase beta)
  22. */
  23. keysLeft: number[];
  24. /**
  25. * Defines the list of key codes associated with the right action (decrease beta)
  26. */
  27. keysRight: number[];
  28. /**
  29. * Defines the list of key codes associated with the reset action.
  30. * Those keys reset the camera to its last stored state (with the method camera.storeState())
  31. */
  32. keysReset: number[];
  33. /**
  34. * Defines the panning sensibility of the inputs.
  35. * (How fast is the camera panning)
  36. */
  37. panningSensibility: number;
  38. /**
  39. * Defines the zooming sensibility of the inputs.
  40. * (How fast is the camera zooming)
  41. */
  42. zoomingSensibility: number;
  43. /**
  44. * Defines whether maintaining the alt key down switch the movement mode from
  45. * orientation to zoom.
  46. */
  47. useAltToZoom: boolean;
  48. /**
  49. * Rotation speed of the camera
  50. */
  51. angularSpeed: number;
  52. private _keys;
  53. private _ctrlPressed;
  54. private _altPressed;
  55. private _onCanvasBlurObserver;
  56. private _onKeyboardObserver;
  57. private _engine;
  58. private _scene;
  59. /**
  60. * Attach the input controls to a specific dom element to get the input from.
  61. * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
  62. */
  63. attachControl(noPreventDefault?: boolean): void;
  64. /**
  65. * Detach the current controls from the specified dom element.
  66. */
  67. detachControl(): void;
  68. /**
  69. * Update the current camera state depending on the inputs that have been used this frame.
  70. * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
  71. */
  72. checkInputs(): void;
  73. /**
  74. * Gets the class name of the current input.
  75. * @returns the class name
  76. */
  77. getClassName(): string;
  78. /**
  79. * Get the friendly name associated with the input class.
  80. * @returns the input friendly name
  81. */
  82. getSimpleName(): string;
  83. }