arcRotateCameraGamepadInput.d.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import type { Nullable } from "../../types";
  2. import type { ArcRotateCamera } from "../../Cameras/arcRotateCamera";
  3. import type { ICameraInput } from "../../Cameras/cameraInputsManager";
  4. import { Gamepad } from "../../Gamepads/gamepad";
  5. /**
  6. * Manage the gamepad inputs to control an arc rotate camera.
  7. * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
  8. */
  9. export declare class ArcRotateCameraGamepadInput implements ICameraInput<ArcRotateCamera> {
  10. /**
  11. * Defines the camera the input is attached to.
  12. */
  13. camera: ArcRotateCamera;
  14. /**
  15. * Defines the gamepad the input is gathering event from.
  16. */
  17. gamepad: Nullable<Gamepad>;
  18. /**
  19. * Defines the gamepad rotation sensibility.
  20. * This is the threshold from when rotation starts to be accounted for to prevent jittering.
  21. */
  22. gamepadRotationSensibility: number;
  23. /**
  24. * Defines the gamepad move sensibility.
  25. * This is the threshold from when moving starts to be accounted for for to prevent jittering.
  26. */
  27. gamepadMoveSensibility: number;
  28. private _yAxisScale;
  29. /**
  30. * Gets or sets a boolean indicating that Yaxis (for right stick) should be inverted
  31. */
  32. get invertYAxis(): boolean;
  33. set invertYAxis(value: boolean);
  34. private _onGamepadConnectedObserver;
  35. private _onGamepadDisconnectedObserver;
  36. /**
  37. * Attach the input controls to a specific dom element to get the input from.
  38. */
  39. attachControl(): void;
  40. /**
  41. * Detach the current controls from the specified dom element.
  42. */
  43. detachControl(): void;
  44. /**
  45. * Update the current camera state depending on the inputs that have been used this frame.
  46. * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
  47. */
  48. checkInputs(): void;
  49. /**
  50. * Gets the class name of the current intput.
  51. * @returns the class name
  52. */
  53. getClassName(): string;
  54. /**
  55. * Get the friendly name associated with the input class.
  56. * @returns the input friendly name
  57. */
  58. getSimpleName(): string;
  59. }