a6b8382b54
Multiplication for the world to view matrix was just backwards.
26 lines
586 B
C++
26 lines
586 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_world_to_view_matrix() const { return m_projection_matrix * m_orientation_matrix; }
|
|
|
|
const mat4x4& get_projection_matrix() const { return m_projection_matrix; }
|
|
|
|
protected:
|
|
mat4x4 m_projection_matrix;
|
|
}; |