GCP Assignment 1
Camera.h
Go to the documentation of this file.
1 //DISCLAMER - This is a modified version of code from one of my other assignments.
2 
3 #pragma once
4 
5 #include <SDL.h>
6 #include <iostream>
7 #include "GL/glew.h"
8 #include "../Maths/Vec3.h"
9 #include "../Maths/Mat4.h"
10 
14 class Camera
15 {
16 public:
20  Camera();
21 
25  ~Camera();
26 
31  void moveCamera(Maths::Vec3 translation);
32 
37  void moveCameraAlongX(float translateX);
38 
43  void moveCameraAlongY(float translateY);
44 
49  void moveCameraAlongZ(float translateZ);
50 
55  void rotateCamera(Maths::Vec3 rotation);
56 
61  void rotateCameraAlongX(float rotationX);
62 
67  void rotateCameraAlongY(float rotationY);
68 
73  void rotateCameraAlongZ(float rotationZ);
74 
80 
86 
92 
97  void setPosition(Maths::Vec3 position);
98 
99 private:
106 };
void moveCameraAlongZ(float translateZ)
Moves the Camera along the Z axis.
Definition: Camera.cpp:41
Maths::Mat4 getView()
Returns the Camera view matrix.
Definition: Camera.cpp:82
void rotateCameraAlongZ(float rotationZ)
Rotate the Camera along the Z axis.
Definition: Camera.cpp:74
void rotateCameraAlongX(float rotationX)
Rotate the Camera along the X axis.
Definition: Camera.cpp:58
void moveCamera(Maths::Vec3 translation)
Moves the Camera using the translation.
Definition: Camera.cpp:20
void moveCameraAlongX(float translateX)
Moves the Camera along the X axis.
Definition: Camera.cpp:27
void moveCameraAlongY(float translateY)
Moves the Camera along the Y axis.
Definition: Camera.cpp:34
Contains the Vec3 structure with functions and overloaded operators.
Definition: Vec3.h:16
Creates a Camera object.
Definition: Camera.h:14
Maths::Mat4 projection
Construct a projection matrix for the Camera (Camera lense)
Definition: Camera.h:103
Camera()
Constructs a Camera object.
Definition: Camera.cpp:5
Contains the Mat4 structure with functions and overloaded operators. This is row major.
Definition: Mat4.h:15
void rotateCamera(Maths::Vec3 rotation)
Rotates the Camera using the rotation.
Definition: Camera.cpp:48
void setPosition(Maths::Vec3 position)
Sets the position of the Camera.
Definition: Camera.cpp:100
Maths::Mat4 view
Create a viewing matrix for the Camera (Camera orientation)
Definition: Camera.h:101
Maths::Vec3 getOrientation()
Returns the Camera orientation.
Definition: Camera.cpp:94
void rotateCameraAlongY(float rotationY)
Rotate the Camera along the Y axis.
Definition: Camera.cpp:66
~Camera()
Destructs an Camera object.
Definition: Camera.cpp:16
Maths::Mat4 getProjection()
Returns the Camera projection matrix.
Definition: Camera.cpp:88
Maths::Vec3 orientation
The Orientation of the Camera.
Definition: Camera.h:105