Added simple camera class.
This commit is contained in:
parent
2ddf01ede2
commit
497a0b060c
30
camera.cc
Normal file
30
camera.cc
Normal 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
20
camera.hh
Normal 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
|
Loading…
Reference in New Issue
Block a user