arcRotateCameraInputsManager.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { ArcRotateCamera, ArcRotateCameraPointersInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, CameraInputsManager, ArcRotateCameraVRDeviceOrientationInput } from "Cameras";
  2. /**
  3. * Default Inputs manager for the ArcRotateCamera.
  4. * It groups all the default supported inputs for ease of use.
  5. * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
  6. */
  7. export class ArcRotateCameraInputsManager extends CameraInputsManager<ArcRotateCamera> {
  8. /**
  9. * Instantiates a new ArcRotateCameraInputsManager.
  10. * @param camera Defines the camera the inputs belong to
  11. */
  12. constructor(camera: ArcRotateCamera) {
  13. super(camera);
  14. }
  15. /**
  16. * Add mouse wheel input support to the input manager.
  17. * @returns the current input manager
  18. */
  19. public addMouseWheel(): ArcRotateCameraInputsManager {
  20. this.add(new ArcRotateCameraMouseWheelInput());
  21. return this;
  22. }
  23. /**
  24. * Add pointers input support to the input manager.
  25. * @returns the current input manager
  26. */
  27. public addPointers(): ArcRotateCameraInputsManager {
  28. this.add(new ArcRotateCameraPointersInput());
  29. return this;
  30. }
  31. /**
  32. * Add keyboard input support to the input manager.
  33. * @returns the current input manager
  34. */
  35. public addKeyboard(): ArcRotateCameraInputsManager {
  36. this.add(new ArcRotateCameraKeyboardMoveInput());
  37. return this;
  38. }
  39. /**
  40. * Add orientation input support to the input manager.
  41. * @returns the current input manager
  42. */
  43. public addVRDeviceOrientation(): ArcRotateCameraInputsManager {
  44. this.add(new ArcRotateCameraVRDeviceOrientationInput());
  45. return this;
  46. }
  47. }