diff --git a/include/engine/camera.hpp b/include/engine/camera.hpp index dfd62fc..4f26927 100644 --- a/include/engine/camera.hpp +++ b/include/engine/camera.hpp @@ -85,7 +85,7 @@ namespace egn{ void set_projection_width(GLfloat w); void set_projection_height(GLfloat h); - + void set_projection_box(GLfloat w, GLfloat h); protected: void recalc_projection_matrix()override; }; diff --git a/src/engine/camera.cpp b/src/engine/camera.cpp index 5f6f444..b62594f 100644 --- a/src/engine/camera.cpp +++ b/src/engine/camera.cpp @@ -17,6 +17,7 @@ */ #include "engine/camera.hpp" +#include "config.hpp" namespace egn{ @@ -63,6 +64,7 @@ namespace egn{ } void camera_iface::recalc_view_matrix(){ + debug_print_verbose("Rebuilding view matrix\n"); m_view_matrix = m_orientation.to_mat4(); m_view_matrix.get(3, 0) = -m_position[0]; m_view_matrix.get(3, 1) = -m_position[1]; @@ -89,8 +91,14 @@ namespace egn{ m_update_flag |= PROJ_UPDATE; m_height = h; } + void ortho_camera::set_projection_box(GLfloat w, GLfloat h){ + m_update_flag |= PROJ_UPDATE; + m_width = w; + m_height = h; + } void ortho_camera::recalc_projection_matrix(){ + debug_print_verbose("Rebuilding orthographic projection matrix\n"); m_projection_matrix = math::ortho_projection(m_width, m_height, m_near, m_far); } diff --git a/src/engine/object.cpp b/src/engine/object.cpp index 10fae4b..7f33e7c 100644 --- a/src/engine/object.cpp +++ b/src/engine/object.cpp @@ -17,6 +17,7 @@ */ #include "engine/object.hpp" +#include "config.hpp" namespace egn{ @@ -65,6 +66,7 @@ namespace egn{ return m_model_matrix; } void object::recalc_model_matrix(){ + debug_print_verbose("Rebuilding model matrix\n"); m_model_matrix = m_orientation.to_mat4(); m_model_matrix.get(3, 0) = m_position[0]; m_model_matrix.get(3, 1) = m_position[1];