refactor rendering

This commit is contained in:
2025-07-16 13:38:02 +02:00
parent 1bee6aed9c
commit 9667454811
14 changed files with 130 additions and 105 deletions

View File

@@ -8,7 +8,7 @@ namespace render {
void Camera::UpdatePerspective(float a_AspectRatio) {
m_ProjectionMatrix = maths::Perspective(80.0f / 180.0f * PI, a_AspectRatio, 0.1f, 160.0f);
m_InvProjectionMatrix = maths::Inverse(m_ProjectionMatrix);
NotifyListeners(&ICameraListener::OnPerspectiveChange);
OnPerspectiveChange();
}
void Camera::SetCamPos(const Vec3f& a_NewPos) {
@@ -21,7 +21,7 @@ void Camera::SetCamPos(const Vec3f& a_NewPos) {
m_CamPos = a_NewPos;
m_ViewMatrix = maths::Look(m_CamPos, front, { 0, 1, 0 });
m_InvViewMatrix = maths::Transpose(maths::Inverse(m_ViewMatrix)); // why transpose ? I don't know
NotifyListeners(&ICameraListener::OnViewChange);
OnViewChange();
}
} // namespace render