Use matrix4 directly after the removal of sse

This commit is contained in:
Benau 2022-06-30 16:49:51 +08:00
parent 8fb0005020
commit 34ae56d33a
2 changed files with 15 additions and 17 deletions

View File

@ -26,23 +26,21 @@ GEVulkanCameraSceneNode::~GEVulkanCameraSceneNode()
void GEVulkanCameraSceneNode::render()
{
irr::scene::CCameraSceneNode::render();
memcpy(m_ubo_data.m_view_matrix.data(),
ViewArea.getTransform(irr::video::ETS_VIEW).pointer(),
16 * sizeof(float));
memcpy(m_ubo_data.m_projection_matrix.data(),
ViewArea.getTransform(irr::video::ETS_PROJECTION).pointer(),
16 * sizeof(float));
m_ubo_data.m_view_matrix = ViewArea.getTransform(irr::video::ETS_VIEW);
m_ubo_data.m_projection_matrix = ViewArea.getTransform(irr::video::ETS_PROJECTION);
irr::core::matrix4 mat;
ViewArea.getTransform(irr::video::ETS_VIEW).getInverse(mat);
memcpy(m_ubo_data.m_inverse_view_matrix.data(), mat.pointer(),
16 * sizeof(float));
m_ubo_data.m_inverse_view_matrix = mat;
ViewArea.getTransform(irr::video::ETS_PROJECTION).getInverse(mat);
memcpy(m_ubo_data.m_inverse_projection_matrix.data(), mat.pointer(),
16 * sizeof(float));
m_ubo_data.m_inverse_projection_matrix = mat;
mat = ViewArea.getTransform(irr::video::ETS_PROJECTION) *
ViewArea.getTransform(irr::video::ETS_VIEW);
memcpy(m_ubo_data.m_projection_view_matrix.data(), mat.pointer(),
16 * sizeof(float));
m_ubo_data.m_projection_view_matrix = mat;
} // render
}

View File

@ -9,11 +9,11 @@ namespace GE
{
struct GEVulkanCameraUBO
{
std::array<float, 16> m_view_matrix;
std::array<float, 16> m_projection_matrix;
std::array<float, 16> m_inverse_view_matrix;
std::array<float, 16> m_inverse_projection_matrix;
std::array<float, 16> m_projection_view_matrix;
irr::core::matrix4 m_view_matrix;
irr::core::matrix4 m_projection_matrix;
irr::core::matrix4 m_inverse_view_matrix;
irr::core::matrix4 m_inverse_projection_matrix;
irr::core::matrix4 m_projection_view_matrix;
};
class GEVulkanDynamicBuffer;