Update scale factor on matrix calculation
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user