freeCameraVirtualJoystickInput.d.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { VirtualJoystick } from "../../Misc/virtualJoystick";
  2. import type { ICameraInput } from "../../Cameras/cameraInputsManager";
  3. import type { FreeCamera } from "../../Cameras/freeCamera";
  4. declare module "../../Cameras/freeCameraInputsManager" {
  5. interface FreeCameraInputsManager {
  6. /**
  7. * Add virtual joystick input support to the input manager.
  8. * @returns the current input manager
  9. */
  10. addVirtualJoystick(): FreeCameraInputsManager;
  11. }
  12. }
  13. /**
  14. * Manage the Virtual Joystick inputs to control the movement of a free camera.
  15. * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
  16. */
  17. export declare class FreeCameraVirtualJoystickInput implements ICameraInput<FreeCamera> {
  18. /**
  19. * Defines the camera the input is attached to.
  20. */
  21. camera: FreeCamera;
  22. private _leftjoystick;
  23. private _rightjoystick;
  24. /**
  25. * Gets the left stick of the virtual joystick.
  26. * @returns The virtual Joystick
  27. */
  28. getLeftJoystick(): VirtualJoystick;
  29. /**
  30. * Gets the right stick of the virtual joystick.
  31. * @returns The virtual Joystick
  32. */
  33. getRightJoystick(): VirtualJoystick;
  34. /**
  35. * Update the current camera state depending on the inputs that have been used this frame.
  36. * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
  37. */
  38. checkInputs(): void;
  39. /**
  40. * Attach the input controls to a specific dom element to get the input from.
  41. */
  42. attachControl(): void;
  43. /**
  44. * Detach the current controls from the specified dom element.
  45. */
  46. detachControl(): void;
  47. /**
  48. * Gets the class name of the current input.
  49. * @returns the class name
  50. */
  51. getClassName(): string;
  52. /**
  53. * Get the friendly name associated with the input class.
  54. * @returns the input friendly name
  55. */
  56. getSimpleName(): string;
  57. }