freeCameraKeyboardMoveInput.d.ts 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import type { ICameraInput } from "../../Cameras/cameraInputsManager";
  2. import type { FreeCamera } from "../../Cameras/freeCamera";
  3. /**
  4. * Manage the keyboard inputs to control the movement of a free camera.
  5. * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
  6. */
  7. export declare class FreeCameraKeyboardMoveInput implements ICameraInput<FreeCamera> {
  8. /**
  9. * Defines the camera the input is attached to.
  10. */
  11. camera: FreeCamera;
  12. /**
  13. * Gets or Set the list of keyboard keys used to control the forward move of the camera.
  14. */
  15. keysUp: number[];
  16. /**
  17. * Gets or Set the list of keyboard keys used to control the upward move of the camera.
  18. */
  19. keysUpward: number[];
  20. /**
  21. * Gets or Set the list of keyboard keys used to control the backward move of the camera.
  22. */
  23. keysDown: number[];
  24. /**
  25. * Gets or Set the list of keyboard keys used to control the downward move of the camera.
  26. */
  27. keysDownward: number[];
  28. /**
  29. * Gets or Set the list of keyboard keys used to control the left strafe move of the camera.
  30. */
  31. keysLeft: number[];
  32. /**
  33. * Gets or Set the list of keyboard keys used to control the right strafe move of the camera.
  34. */
  35. keysRight: number[];
  36. /**
  37. * Defines the pointer angular sensibility along the X and Y axis or how fast is the camera rotating.
  38. */
  39. rotationSpeed: number;
  40. /**
  41. * Gets or Set the list of keyboard keys used to control the left rotation move of the camera.
  42. */
  43. keysRotateLeft: number[];
  44. /**
  45. * Gets or Set the list of keyboard keys used to control the right rotation move of the camera.
  46. */
  47. keysRotateRight: number[];
  48. /**
  49. * Gets or Set the list of keyboard keys used to control the up rotation move of the camera.
  50. */
  51. keysRotateUp: number[];
  52. /**
  53. * Gets or Set the list of keyboard keys used to control the down rotation move of the camera.
  54. */
  55. keysRotateDown: number[];
  56. private _keys;
  57. private _onCanvasBlurObserver;
  58. private _onKeyboardObserver;
  59. private _engine;
  60. private _scene;
  61. /**
  62. * Attach the input controls to a specific dom element to get the input from.
  63. * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
  64. */
  65. attachControl(noPreventDefault?: boolean): void;
  66. /**
  67. * Detach the current controls from the specified dom element.
  68. */
  69. detachControl(): void;
  70. /**
  71. * Update the current camera state depending on the inputs that have been used this frame.
  72. * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
  73. */
  74. checkInputs(): void;
  75. /**
  76. * Gets the class name of the current input.
  77. * @returns the class name
  78. */
  79. getClassName(): string;
  80. /** @internal */
  81. _onLostFocus(): void;
  82. /**
  83. * Get the friendly name associated with the input class.
  84. * @returns the input friendly name
  85. */
  86. getSimpleName(): string;
  87. private _getLocalRotation;
  88. }