Level H Engine
CameraControlComponent.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../Maths/Vec3.h"
4 #include "Component.h"
5 
10 {
11 public:
12 
16  virtual ~CameraControlComponent();
17 
21  virtual void onAwake();
22 
26  virtual void onDestroy();
27 
31  void handleInput();
32 
36  void updateCamera(float dt);
37 
41  void setSpeed(float inSpeed);
42 
46  void setRotateSpeed(float inRotateSpeed);
47 
51  void disableMoveXControl() { moveX = false; }
52 
56  void disableMoveYControl() { moveY = false; }
57 
61  void disableMoveZControl() { moveZ = false; }
62 
66  void disableRotateXControl() { rotX = false; }
67 
71  void disableRotateYControl() { rotY = false; }
72 
76  void disableRotateZControl() { rotZ = false; }
77 
78 private:
80  float speed;
82  float rotateSpeed;
88 };
Vec3 rotationVel
Definition: CameraControlComponent.h:85
A class that handles the components.
Definition: Component.h:13
bool rotZ
Definition: CameraControlComponent.h:87
virtual void onAwake()
A virtual function for the componets awake.
Definition: CameraControlComponent.cpp:10
Vec3 movementVel
The velocities for the movment of the camera.
Definition: CameraControlComponent.h:84
void updateCamera(float dt)
A function to update the camera.
Definition: CameraControlComponent.cpp:134
void disableMoveZControl()
A function to disable movement along the z axis.
Definition: CameraControlComponent.h:61
void disableMoveYControl()
A function to disable movement along the y axis.
Definition: CameraControlComponent.h:56
void disableRotateZControl()
A function to disable rotation along the z axis.
Definition: CameraControlComponent.h:76
float rotateSpeed
The rotation speed.
Definition: CameraControlComponent.h:82
bool moveZ
Definition: CameraControlComponent.h:87
virtual ~CameraControlComponent()
A virtual destructor.
Definition: CameraControlComponent.cpp:6
void setRotateSpeed(float inRotateSpeed)
A function to set the rotation speed of the camera.
Definition: CameraControlComponent.cpp:145
bool rotX
Definition: CameraControlComponent.h:87
float speed
The movment speed.
Definition: CameraControlComponent.h:80
void disableMoveXControl()
A function to disable movement along the x axis.
Definition: CameraControlComponent.h:51
Contains the Vec3 structure with functions and overloaded operators.
Definition: Vec3.h:8
void disableRotateYControl()
A function to disable rotation along the y axis.
Definition: CameraControlComponent.h:71
Creates a Camera Control component.
Definition: CameraControlComponent.h:9
virtual void onDestroy()
A virtual function for the componets destroy.
Definition: CameraControlComponent.cpp:20
void setSpeed(float inSpeed)
A function to set the speed of the camera.
Definition: CameraControlComponent.cpp:140
bool moveY
Definition: CameraControlComponent.h:87
void handleInput()
A function to handle the input for the camera.
Definition: CameraControlComponent.cpp:24
bool moveX
control booleans
Definition: CameraControlComponent.h:87
void disableRotateXControl()
A function to disable rotation along the x axis.
Definition: CameraControlComponent.h:66
bool rotY
Definition: CameraControlComponent.h:87