Added simple camera class.

This commit is contained in:
Faerbit 2014-11-13 17:17:46 +01:00
parent 2ddf01ede2
commit 497a0b060c
2 changed files with 50 additions and 0 deletions

30
camera.cc Normal file
View File

@ -0,0 +1,30 @@
#include "camera.hh"
Camera::Camera(glm::vec3 rotation, float distance) {
this->rotation = rotation;
this->distance = distance;
}
Camera::Camera() {
rotation = glm::vec3(0.0f, 0.0f, 0.0f);
distance = 1.0f;
}
Camera::~Camera() {
}
float Camera::getDistance() {
return distance;
}
void Camera::setDistance(float distance) {
this->distance = distance;
}
glm::vec3 Camera::getRotation() {
return rotation;
}
void Camera::updateRotation(glm::vec3 rotation) {
this->rotation += rotation;;
}

20
camera.hh Normal file
View File

@ -0,0 +1,20 @@
#ifndef CAMERA_HH_INCLUDED
#define CAMERA_HH_INCLUDED
#include <ACGL/Math/Math.hh>
class Camera {
public:
Camera(glm::vec3 rotation, float distance);
Camera();
~Camera();
float getDistance();
void setDistance(float distance);
glm::vec3 getRotation();
void updateRotation(glm::vec3 rotation); //adds to current rotation
private:
float distance;
glm::vec3 rotation;
};
#endif