CCameraController.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <ionCore.h>
5 #include <ionWindow.h>
6 #include <ionScene.h>
7 
8 
9 namespace ion
10 {
11 
13  {
14 
15  public:
16 
18 
19  virtual void OnEvent(IEvent & Event);
20  virtual void Update(double const TickTime);
21 
22  virtual vec3f const & GetPosition() const;
23  virtual float GetPhi() const;
24  virtual float GetTheta() const;
25  virtual float GetVelocity() const;
26  virtual Scene::ICamera const * GetCamera() const;
27  virtual Scene::ICamera * GetCamera();
28 
29  virtual void CalculateInitialAngles();
30 
31  virtual vec3f GetCurrentSpeed() const;
32 
33  virtual void SetVelocity(float const Velocity);
34  virtual void SetPhi(float const Phi);
35  virtual void SetTheta(float const Theta);
36 
37  virtual void SetActive(bool const Active);
38 
39  virtual bool GetUseWASD() const;
40  virtual bool GetUseArrowKeys() const;
41  virtual bool GetUseScrollWheel() const;
42 
43  virtual void SetUseWASD(bool const UseWASD);
44  virtual void SetUseArrowKeys(bool const UseArrowKeys);
45  virtual void SetUseScrollWheel(bool const UseScrollWheel);
46 
47  protected:
48 
49  bool UseWASD = true;
50  bool UseArrowKeys = true;
51  bool UseScrollWheel = true;
52 
53  struct ECommand
54  {
55  enum
56  {
57  Forward = 0,
58  Back = 1,
59  Left = 2,
60  Right = 3,
61  Count = 4
62  };
63  };
64 
67 
69  bool Tracking;
70  float Phi, Theta;
71 
73 
75  bool Active = true;
76 
77  };
78 
80  {
81 
82  public:
83 
85  virtual void Update(double const TickTime);
86 
87  protected:
88 
90 
91  float FocalLengthAccumulator = 0;
92 
93  };
94 
95 }
virtual bool GetUseWASD() const
Definition: CCameraController.cpp:305
virtual void SetUseWASD(bool const UseWASD)
Definition: CCameraController.cpp:321
float Phi
Definition: CCameraController.h:70
SingletonPointer< CGamePad > GamePad
Definition: CCameraController.h:89
Definition: CCameraController.h:61
bool UseWASD
Definition: CCameraController.h:49
virtual float GetTheta() const
Definition: CCameraController.cpp:289
bool Active
Definition: CCameraController.h:75
virtual void CalculateInitialAngles()
Definition: CCameraController.cpp:256
virtual bool GetUseArrowKeys() const
Definition: CCameraController.cpp:310
bool UseArrowKeys
Definition: CCameraController.h:50
virtual bool GetUseScrollWheel() const
Definition: CCameraController.cpp:315
bool WASDCommands[(int) ECommand::Count]
Definition: CCameraController.h:65
Wraps a pointer to a singleton object.
Definition: SingletonPointer.h:13
Definition: CCameraController.h:60
bool Tracking
Definition: CCameraController.h:69
bool UseScrollWheel
Definition: CCameraController.h:51
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
virtual void SetUseScrollWheel(bool const UseScrollWheel)
Definition: CCameraController.cpp:331
Definition: IEvent.h:5
vec3f CurrentSpeed
Definition: CCameraController.h:72
virtual float GetVelocity() const
Definition: CCameraController.cpp:269
virtual vec3f const & GetPosition() const
Definition: CCameraController.cpp:241
Definition: IEventListener.h:8
bool ArrowCommands[(int) ECommand::Count]
Definition: CCameraController.h:66
CCameraController(Scene::ICamera *Camera)
Definition: CCameraController.cpp:11
Definition: CCameraController.h:58
Definition: CCameraController.h:57
virtual vec3f GetCurrentSpeed() const
Definition: CCameraController.cpp:264
float LookSpeed
Definition: CCameraController.h:68
Scene::ICamera * Camera
Definition: CCameraController.h:74
float FocalLengthDelta
Definition: CCameraController.h:68
virtual void SetActive(bool const Active)
Definition: CCameraController.cpp:299
virtual void SetVelocity(float const Velocity)
Definition: CCameraController.cpp:274
virtual void SetTheta(float const Theta)
Definition: CCameraController.cpp:294
virtual void SetPhi(float const Phi)
Definition: CCameraController.cpp:284
virtual void Update(double const TickTime)
Definition: CCameraController.cpp:162
virtual float GetPhi() const
Definition: CCameraController.cpp:279
Definition: CCameraController.h:79
Definition: CCameraController.h:53
Definition: CCameraController.h:12
float MoveSpeed
Definition: CCameraController.h:68
float MaxAngleEpsilon
Definition: CCameraController.h:68
Definition: CCameraController.h:59
float Theta
Definition: CCameraController.h:70
Definition: ICamera.h:12
virtual void OnEvent(IEvent &Event)
Definition: CCameraController.cpp:28
virtual Scene::ICamera const * GetCamera() const
Definition: CCameraController.cpp:246
virtual void SetUseArrowKeys(bool const UseArrowKeys)
Definition: CCameraController.cpp:326