diff --git a/camera.cc b/camera.cc new file mode 100644 index 0000000..ab74395 --- /dev/null +++ b/camera.cc @@ -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;; +} diff --git a/camera.hh b/camera.hh new file mode 100644 index 0000000..de936dd --- /dev/null +++ b/camera.hh @@ -0,0 +1,20 @@ +#ifndef CAMERA_HH_INCLUDED +#define CAMERA_HH_INCLUDED + +#include + +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