gamepadCamera.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { UniversalCamera } from "./universalCamera";
  2. import { Scene } from "../scene";
  3. import { Vector3 } from "../Maths/math";
  4. import { Node } from "../node";
  5. Node.AddNodeConstructor("GamepadCamera", (name, scene) => {
  6. return () => new GamepadCamera(name, Vector3.Zero(), scene);
  7. });
  8. /**
  9. * This represents a FPS type of camera. This is only here for back compat purpose.
  10. * Please use the UniversalCamera instead as both are identical.
  11. * @see http://doc.babylonjs.com/features/cameras#universal-camera
  12. */
  13. export class GamepadCamera extends UniversalCamera {
  14. /**
  15. * Instantiates a new Gamepad Camera
  16. * This represents a FPS type of camera. This is only here for back compat purpose.
  17. * Please use the UniversalCamera instead as both are identical.
  18. * @see http://doc.babylonjs.com/features/cameras#universal-camera
  19. * @param name Define the name of the camera in the scene
  20. * @param position Define the start position of the camera in the scene
  21. * @param scene Define the scene the camera belongs to
  22. */
  23. constructor(name: string, position: Vector3, scene: Scene) {
  24. super(name, position, scene);
  25. }
  26. /**
  27. * Gets the current object class name.
  28. * @return the class name
  29. */
  30. public getClassName(): string {
  31. return "GamepadCamera";
  32. }
  33. }