Files
OpenSpace/include/openspace/util/camera.h
Jonas Strandstedt 89eeae62d0 Restructuring for OpenSpace tests
- Moved all OpenSpace headers to separate include directory
- Added OpenSpaceTests binary with OPENSPACE_HAVE_TESTS define
- Added CMake setting of BASE_DIR
- Added OpenSpace initial tests for SceneGraph and SceneGraphNodes
- Added OpenSpace initial tests for psc and pss
- Restructured OpenSpace so no GL functions are called in constructors
to make the classes testable

- Todo: Make the base dir possible to set through command line argument
and configuration file
2014-03-19 14:57:10 -04:00

58 lines
1.3 KiB
C++

#ifndef CAMERA_H
#define CAMERA_H
// open space includes
#include <openspace/util/psc.h>
// glm includes
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtc/quaternion.hpp>
namespace openspace {
class Camera {
public:
// constructors & destructor
Camera();
~Camera();
void setPosition(psc pos);
const psc& getPosition() const;
void setViewProjectionMatrix(const glm::mat4 &viewProjectionMatrix);
void setCameraDirection(const glm::vec3 &cameraDirection);
const glm::mat4 & getViewProjectionMatrix() const;
const glm::mat4 & getViewRotationMatrix() const;
void compileViewRotationMatrix();
void rotate(glm::quat rotation);
void setRotation(glm::quat rotation);
const glm::quat & getRotation() const;
const glm::vec3 & getViewDirection() const;
const float & getMaxFov() const;
const float & getSinMaxFov() const;
void setMaxFov(const float &fov);
void setScaling(const glm::vec2 &scaling);
const glm::vec2 & getScaling() const;
private:
float maxFov_;
float sinMaxFov_;
psc position_;
glm::mat4 viewProjectionMatrix_;
glm::vec3 viewDirection_;
glm::vec3 cameraDirection_;
glm::vec2 scaling_;
glm::quat viewRotation_;
glm::mat4 viewRotationMatrix_; // compiled from the quaternion
};
} // namespace openspace
#endif