diff --git a/src/engine/systems/DrawPair.cpp b/src/engine/systems/DrawPair.cpp index 07d5c99..e80c7dd 100644 --- a/src/engine/systems/DrawPair.cpp +++ b/src/engine/systems/DrawPair.cpp @@ -8,6 +8,7 @@ #include +#include "engine/debug/drawers.hpp" #include "engine/gameobjects/components/ModelComponent.hpp" #include "engine/model/Model.hpp" #include "engine/tree/octtree/OctTreeNode.hpp" @@ -51,11 +52,14 @@ namespace fgl::engine { if ( !primitive.ready() ) continue; + const Matrix< MatrixType::ModelToWorld > matrix { obj.getTransform().mat() + * model_transform.mat() }; + // Does this primitive pass the bounds check - if ( !frustum.intersects( model_transform.mat() * primitive.getBoundingBox() ) ) continue; + if ( !frustum.intersects( matrix * primitive.getBoundingBox() ) ) continue; //assert( primitive.m_texture ); - const ModelMatrixInfo matrix_info { .model_matrix = obj.getTransform().mat4(), + const ModelMatrixInfo matrix_info { .model_matrix = matrix, .albedo_id = primitive.getAlbedoTextureID(), .normal_id = primitive.getNormalTextureID() };