ISceneNodeAnimatorCameraFPS.h 2.5 KB

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