Update scale factor on matrix calculation

This commit is contained in:
Georg Hagen
2024-11-23 23:40:09 +01:00
parent 5f641e31d9
commit c1a51a063c

View File

@@ -221,8 +221,6 @@ namespace OpenVulkano::Scene
void SetFovRad(const float fov)
{
m_fov = fov;
m_scaleFactor = 2 * std::tan(m_fov * 0.5f);
m_perPixelScaleFactor = m_height / m_scaleFactor;
}
[[nodiscard]] float GetFov() const { return Math::Utils::degrees(m_fov); }
@@ -241,6 +239,8 @@ namespace OpenVulkano::Scene
void UpdateProjectionMatrix() override
{
m_scaleFactor = 2 * std::tan(m_fov * 0.5f);
m_perPixelScaleFactor = m_height / m_scaleFactor;
SetProjectionMatrix(Math::Utils::perspectiveRH_ZO(m_fov, m_aspect, m_nearPlane, m_farPlane));
}