Changed rotation from three to two vertices.

This commit is contained in:
Fabian Klemp 2014-11-14 18:31:26 +01:00
parent 8bdfda2e00
commit 13beac44e0
2 changed files with 10 additions and 10 deletions

View File

@ -1,12 +1,12 @@
#include "camera.hh" #include "camera.hh"
Camera::Camera(glm::vec3 rotation, float distance) { Camera::Camera(glm::vec2 rotation, float distance) {
this->rotation = rotation; this->rotation = rotation;
this->distance = distance; this->distance = distance;
} }
Camera::Camera() { Camera::Camera() {
rotation = glm::vec3(0.0f, 0.0f, 0.0f); rotation = glm::vec2(0.0f, 0.0f);
distance = 1.0f; distance = 1.0f;
} }
@ -21,14 +21,14 @@ void Camera::setDistance(float distance) {
this->distance = distance; this->distance = distance;
} }
glm::vec3 Camera::getRotation() { glm::vec2 Camera::getRotation() {
return rotation; return rotation;
} }
void Camera::setRotation(glm::vec3 rotation) { void Camera::setRotation(glm::vec2 rotation) {
this->rotation = rotation; this->rotation = rotation;
} }
void Camera::updateRotation(glm::vec3 rotation) { void Camera::updateRotation(glm::vec2 rotation) {
this->rotation += rotation;; this->rotation += rotation;;
} }

View File

@ -5,17 +5,17 @@
class Camera { class Camera {
public: public:
Camera(glm::vec3 rotation, float distance); Camera(glm::vec2 rotation, float distance);
Camera(); Camera();
~Camera(); ~Camera();
float getDistance(); float getDistance();
void setDistance(float distance); void setDistance(float distance);
glm::vec3 getRotation(); glm::vec2 getRotation();
void setRotation(glm::vec3 rotation); void setRotation(glm::vec2 rotation);
void updateRotation(glm::vec3 rotation); //adds to current rotation void updateRotation(glm::vec2 rotation); //adds to current rotation
private: private:
float distance; float distance;
glm::vec3 rotation; glm::vec2 rotation;
}; };
#endif #endif