75357b330c
Now using GLM instead of the custom math libraries. Sadly, this did not 100% fix the problem at hand but it does give some closure that the math is not the problem. Also it will be nice to have a general math library to not have to deal with creating every math function every time.
26 lines
588 B
C++
26 lines
588 B
C++
#pragma once
|
|
|
|
#include <glm/glm.hpp>
|
|
|
|
#include "Poseable.h"
|
|
|
|
using namespace glm;
|
|
|
|
class Camera : public Poseable
|
|
{
|
|
public:
|
|
Camera(
|
|
const vec3& position,
|
|
const vec3& forward = vec3(0.0f, 0.0f, 1.0f),
|
|
const vec3& up = vec3(0.0f, 1.0f, 0.0f),
|
|
const vec3& right = vec3(1.0f, 0.0f, 0.0f)
|
|
) : Poseable(position, forward, up, right), m_projection_matrix(1.0f)
|
|
{}
|
|
|
|
mat4x4 get_view_projection_matrix() const { return m_orientation_matrix * m_projection_matrix; }
|
|
|
|
const mat4x4& get_projection_matrix() const { return m_projection_matrix; }
|
|
|
|
protected:
|
|
mat4x4 m_projection_matrix;
|
|
}; |