ISceneNodeAnimatorCameraFPS.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 in degrees
  26. /** The degrees are equivalent to a half screen movement of the mouse,
  27. i.e. if the mouse cursor had been moved to the border of the screen since
  28. the last animation. */
  29. virtual f32 getRotateSpeed() const = 0;
  30. //! Set the rotation speed in degrees
  31. virtual void setRotateSpeed(f32 rotateSpeed) = 0;
  32. //! Sets the keyboard mapping for this animator (old style)
  33. /** \param map Array of keyboard mappings, see irr::SKeyMap
  34. \param count Size of the keyboard map array. */
  35. virtual void setKeyMap(SKeyMap *map, u32 count) = 0;
  36. //! Sets the keyboard mapping for this animator
  37. //! \param keymap The new keymap array
  38. virtual void setKeyMap(const core::array<SKeyMap>& keymap) = 0;
  39. //! Gets the keyboard mapping for this animator
  40. virtual const core::array<SKeyMap>& getKeyMap() const = 0;
  41. //! Sets whether vertical movement should be allowed.
  42. /** If vertical movement is enabled then the camera may fight with
  43. gravity causing camera shake. Disable this if the camera has
  44. a collision animator with gravity enabled. */
  45. virtual void setVerticalMovement(bool allow) = 0;
  46. //! Sets whether the Y axis of the mouse should be inverted.
  47. /** If enabled then moving the mouse down will cause
  48. the camera to look up. It is disabled by default. */
  49. virtual void setInvertMouse(bool invert) = 0;
  50. };
  51. } // end namespace scene
  52. } // end namespace irr
  53. #endif