Ocular Engine
FreeFlyController.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_CORE_ROUTINE_FREE_FLY_CONTROLLER__H__
19 #define __H__OCULAR_CORE_ROUTINE_FREE_FLY_CONTROLLER__H__
20 
21 #include "Scene/ARoutine.hpp"
22 #include "Math/Vector3.hpp"
23 #include "Math/Quaternion.hpp"
24 
25 //------------------------------------------------------------------------------------------
26 
31 namespace Ocular
32 {
37  namespace Core
38  {
62  class FreeFlyController : public ARoutine
63  {
64  public:
65 
67  virtual ~FreeFlyController();
68 
69  //------------------------------------------------------------
70  // Inherited Methods
71  //------------------------------------------------------------
72 
73  virtual void onUpdate(float const delta) override;
74  virtual bool onEvent(std::shared_ptr<AEvent> event) override;
75 
76  //------------------------------------------------------------
77  // Controller Specific Methods
78  //------------------------------------------------------------
79 
84  void setLookSensitivity(float sensitivity);
85 
89  float getLookSensitivity() const;
90 
95  void setMovementSpeed(float speed);
96 
100  float getMovementSpeed() const;
101 
106  void setBurstSpeedModifier(float modifier);
107 
111  float getBurstSpeedModifier() const;
112 
117  void setPreventRoll(bool prevent);
118 
122  bool getPreventRoll() const;
123 
124  protected:
125 
126  void handleMovement(float delta);
127  void handleMouseRotation();
128 
129  private:
130 
131  Math::Vector3f m_Euler;
132  Math::Vector3f m_MovementVector;
133  Math::Vector2i m_LastMousePos;
134 
135  float m_LookSensitivity;
136  float m_MovementSpeed;
137  float m_BurstModifier;
138 
139  bool m_PreventRoll;
140  bool m_IsInBurst;
141  };
142  }
146 }
151 //------------------------------------------------------------------------------------------
152 
153 #endif
void setBurstSpeedModifier(float modifier)
Definition: FreeFlyController.cpp:244
void setLookSensitivity(float sensitivity)
Definition: FreeFlyController.cpp:224
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
Definition: ARoutine.hpp:59
float getBurstSpeedModifier() const
Definition: FreeFlyController.cpp:249
Definition: FreeFlyController.hpp:62
void setPreventRoll(bool prevent)
Definition: FreeFlyController.cpp:254
Definition: Vector2.hpp:44
float getLookSensitivity() const
Definition: FreeFlyController.cpp:229
void setMovementSpeed(float speed)
Definition: FreeFlyController.cpp:234
virtual bool onEvent(std::shared_ptr< AEvent > event) override
Definition: FreeFlyController.cpp:82
float getMovementSpeed() const
Definition: FreeFlyController.cpp:239
bool getPreventRoll() const
Definition: FreeFlyController.cpp:259
virtual void onUpdate(float const delta) override
Definition: FreeFlyController.cpp:71