gamepadSceneComponent.d.ts 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import type { Nullable } from "../types";
  2. import { Scene } from "../scene";
  3. import type { ISceneComponent } from "../sceneComponent";
  4. import { GamepadManager } from "./gamepadManager";
  5. declare module "../scene" {
  6. interface Scene {
  7. /** @internal */
  8. _gamepadManager: Nullable<GamepadManager>;
  9. /**
  10. * Gets the gamepad manager associated with the scene
  11. * @see https://doc.babylonjs.com/features/featuresDeepDive/input/gamepads
  12. */
  13. gamepadManager: GamepadManager;
  14. }
  15. }
  16. declare module "../Cameras/freeCameraInputsManager" {
  17. /**
  18. * Interface representing a free camera inputs manager
  19. */
  20. interface FreeCameraInputsManager {
  21. /**
  22. * Adds gamepad input support to the FreeCameraInputsManager.
  23. * @returns the FreeCameraInputsManager
  24. */
  25. addGamepad(): FreeCameraInputsManager;
  26. }
  27. }
  28. declare module "../Cameras/arcRotateCameraInputsManager" {
  29. /**
  30. * Interface representing an arc rotate camera inputs manager
  31. */
  32. interface ArcRotateCameraInputsManager {
  33. /**
  34. * Adds gamepad input support to the ArcRotateCamera InputManager.
  35. * @returns the camera inputs manager
  36. */
  37. addGamepad(): ArcRotateCameraInputsManager;
  38. }
  39. }
  40. /**
  41. * Defines the gamepad scene component responsible to manage gamepads in a given scene
  42. */
  43. export declare class GamepadSystemSceneComponent implements ISceneComponent {
  44. /**
  45. * The component name helpfull to identify the component in the list of scene components.
  46. */
  47. readonly name = "Gamepad";
  48. /**
  49. * The scene the component belongs to.
  50. */
  51. scene: Scene;
  52. /**
  53. * Creates a new instance of the component for the given scene
  54. * @param scene Defines the scene to register the component in
  55. */
  56. constructor(scene: Scene);
  57. /**
  58. * Registers the component in a given scene
  59. */
  60. register(): void;
  61. /**
  62. * Rebuilds the elements related to this component in case of
  63. * context lost for instance.
  64. */
  65. rebuild(): void;
  66. /**
  67. * Disposes the component and the associated resources
  68. */
  69. dispose(): void;
  70. private _beforeCameraUpdate;
  71. }