This commit is contained in:
Isuru Samarathunga
2025-10-14 02:58:39 +05:30
parent 58f2190199
commit 0f557eb010
3 changed files with 8 additions and 1 deletions

View File

@ -18,6 +18,7 @@
#include <IAEngine/Nodes/Node2D.hpp>
#include <Renderer/Renderer.hpp>
#include <IAEngine/Engine.hpp>
namespace ia::iae
{
@ -38,7 +39,7 @@ namespace ia::iae
CONST Mat4 *CameraComponent::GetViewMatrix()
{
const auto pos = m_node->GetPosition() + m_positionOffset;
const auto pos = (m_node->GetPosition() + m_positionOffset) * Engine::GetRendererScalingFactor();
m_viewMatrix = glm::lookAtLH(glm::vec3{pos, -2.0f}, {pos, 0.0f}, {0.0f, 1.0f, 0.0f});
return &m_viewMatrix;
}