Extend ortho camera
This commit is contained in:
@@ -25,15 +25,15 @@ namespace OpenVulkano::Scene
|
||||
PerspectiveCamera::UpdateProjectionMatrix();
|
||||
if (m_morphState != 0)
|
||||
{
|
||||
float aspectH = m_aspect;
|
||||
float aspectV = 1;
|
||||
const float scale = 0.5f * m_contentScaleFactor * m_zoom;
|
||||
const float widthHalf = m_width * scale, heightHalf = m_height * scale;
|
||||
m_orthoMatrix = Math::Utils::orthoRH_ZO(-widthHalf, widthHalf, -heightHalf, heightHalf, m_nearPlane, m_farPlane);
|
||||
if (m_morphState == 1)
|
||||
{
|
||||
m_projection = Math::Utils::orthoRH_ZO(-aspectH, aspectH, -aspectV, aspectV, m_nearPlane, m_farPlane);
|
||||
m_projection = m_orthoMatrix;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_orthoMatrix = Math::Utils::orthoRH_ZO(-aspectH, aspectH, -aspectV, aspectV, m_nearPlane, m_farPlane);
|
||||
m_projection = BlendMatrices(m_projection, m_orthoMatrix, m_morphState);
|
||||
}
|
||||
UpdateViewProjectionMatrix();
|
||||
|
||||
Reference in New Issue
Block a user