This commit is contained in:
Isuru Samarathunga
2025-10-14 01:50:56 +05:30
parent 13e8c538c7
commit 58f2190199
13 changed files with 261 additions and 45 deletions

View File

@ -36,6 +36,13 @@ namespace ia::iae
glm::orthoLH(0.0f, (FLOAT32) width, (FLOAT32) height, 0.0f, Renderer::MIN_DEPTH, Renderer::MAX_DEPTH);
}
CONST Mat4 *CameraComponent::GetViewMatrix()
{
const auto pos = m_node->GetPosition() + m_positionOffset;
m_viewMatrix = glm::lookAtLH(glm::vec3{pos, -2.0f}, {pos, 0.0f}, {0.0f, 1.0f, 0.0f});
return &m_viewMatrix;
}
VOID CameraComponent::Draw()
{
}
@ -46,8 +53,6 @@ namespace ia::iae
VOID CameraComponent::Update()
{
const auto pos = m_node->GetPosition() + m_positionOffset;
m_viewMatrix = glm::lookAtLH(glm::vec3{pos, -2.0f}, {pos, 0.0f}, {0.0f, 1.0f, 0.0f});
}
VOID CameraComponent::FixedUpdate()