Changed rotation from three to two vertices.
This commit is contained in:
parent
8bdfda2e00
commit
13beac44e0
10
camera.cc
10
camera.cc
@ -1,12 +1,12 @@
|
||||
#include "camera.hh"
|
||||
|
||||
Camera::Camera(glm::vec3 rotation, float distance) {
|
||||
Camera::Camera(glm::vec2 rotation, float distance) {
|
||||
this->rotation = rotation;
|
||||
this->distance = distance;
|
||||
}
|
||||
|
||||
Camera::Camera() {
|
||||
rotation = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
rotation = glm::vec2(0.0f, 0.0f);
|
||||
distance = 1.0f;
|
||||
}
|
||||
|
||||
@ -21,14 +21,14 @@ void Camera::setDistance(float distance) {
|
||||
this->distance = distance;
|
||||
}
|
||||
|
||||
glm::vec3 Camera::getRotation() {
|
||||
glm::vec2 Camera::getRotation() {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
void Camera::setRotation(glm::vec3 rotation) {
|
||||
void Camera::setRotation(glm::vec2 rotation) {
|
||||
this->rotation = rotation;
|
||||
}
|
||||
|
||||
void Camera::updateRotation(glm::vec3 rotation) {
|
||||
void Camera::updateRotation(glm::vec2 rotation) {
|
||||
this->rotation += rotation;;
|
||||
}
|
||||
|
10
camera.hh
10
camera.hh
@ -5,17 +5,17 @@
|
||||
|
||||
class Camera {
|
||||
public:
|
||||
Camera(glm::vec3 rotation, float distance);
|
||||
Camera(glm::vec2 rotation, float distance);
|
||||
Camera();
|
||||
~Camera();
|
||||
float getDistance();
|
||||
void setDistance(float distance);
|
||||
glm::vec3 getRotation();
|
||||
void setRotation(glm::vec3 rotation);
|
||||
void updateRotation(glm::vec3 rotation); //adds to current rotation
|
||||
glm::vec2 getRotation();
|
||||
void setRotation(glm::vec2 rotation);
|
||||
void updateRotation(glm::vec2 rotation); //adds to current rotation
|
||||
private:
|
||||
float distance;
|
||||
glm::vec3 rotation;
|
||||
glm::vec2 rotation;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user