ISceneNodeAnimatorCameraFPS.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #ifndef __I_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__
  5. #define __I_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__
  6. #include "ISceneNodeAnimator.h"
  7. #include "IEventReceiver.h"
  8. #include "irrArray.h"
  9. namespace irr
  10. {
  11. struct SKeyMap;
  12. namespace scene
  13. {
  14. //! Special scene node animator for FPS cameras
  15. /** This scene node animator can be attached to a camera to make it act
  16. like a first person shooter
  17. */
  18. class ISceneNodeAnimatorCameraFPS : public ISceneNodeAnimator
  19. {
  20. public:
  21. //! Returns the speed of movement in units per millisecond
  22. virtual f32 getMoveSpeed() const = 0;
  23. //! Sets the speed of movement in units per millisecond
  24. virtual void setMoveSpeed(f32 moveSpeed) = 0;
  25. //! Returns the rotation speed when using keyboard
  26. virtual f32 getRotateSpeedKeyboard() const = 0;
  27. //! Set the rotation speed when using keyboard
  28. virtual void setRotateSpeedKeyboard(f32 rotateSpeed) = 0;
  29. //! Returns the rotation speed in degrees when using mouse
  30. /** The degrees are equivalent to a half screen movement of the mouse,
  31. i.e. if the mouse cursor had been moved to the border of the screen since
  32. the last animation. */
  33. virtual f32 getRotateSpeed() const = 0;
  34. //! Set the rotation speed in degrees when using mouse
  35. virtual void setRotateSpeed(f32 rotateSpeed) = 0;
  36. //! Sets the keyboard mapping for this animator (old style)
  37. /** \param map Array of keyboard mappings, see irr::SKeyMap
  38. \param count Size of the keyboard map array. */
  39. virtual void setKeyMap(SKeyMap *map, u32 count) = 0;
  40. //! Sets the keyboard mapping for this animator
  41. //! \param keymap The new keymap array
  42. virtual void setKeyMap(const core::array<SKeyMap>& keymap) = 0;
  43. //! Gets the keyboard mapping for this animator
  44. virtual const core::array<SKeyMap>& getKeyMap() const = 0;
  45. //! Sets whether vertical movement should be allowed.
  46. /** If vertical movement is enabled then the camera may fight with
  47. gravity causing camera shake. Disable this if the camera has
  48. a collision animator with gravity enabled. */
  49. virtual void setVerticalMovement(bool allow) = 0;
  50. //! Sets whether the Y axis of the mouse should be inverted.
  51. /** If enabled then moving the mouse down will cause
  52. the camera to look up. It is disabled by default. */
  53. virtual void setInvertMouse(bool invert) = 0;
  54. };
  55. } // end namespace scene
  56. } // end namespace irr
  57. #endif