Add pixel scale factor values for ortho cam
This commit is contained in:
@@ -254,6 +254,8 @@ namespace OpenVulkano::Scene
|
|||||||
{
|
{
|
||||||
const float scale = 0.5f * m_contentScaleFactor * m_zoom;
|
const float scale = 0.5f * m_contentScaleFactor * m_zoom;
|
||||||
const float widthHalf = m_width * scale, heightHalf = m_height * scale;
|
const float widthHalf = m_width * scale, heightHalf = m_height * scale;
|
||||||
|
m_perPixelScaleFactor = m_height / heightHalf;
|
||||||
|
m_scaleFactor = scale;
|
||||||
SetProjectionMatrix(Math::Utils::orthoRH_ZO(-widthHalf, widthHalf, -heightHalf, heightHalf, m_nearPlane, m_farPlane));
|
SetProjectionMatrix(Math::Utils::orthoRH_ZO(-widthHalf, widthHalf, -heightHalf, heightHalf, m_nearPlane, m_farPlane));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ namespace OpenVulkano::Scene
|
|||||||
Math::Matrix4f orthoMatrix = Math::Utils::orthoRH_ZO(-widthHalf, widthHalf, -heightHalf, heightHalf, m_nearPlane, m_farPlane);
|
Math::Matrix4f orthoMatrix = Math::Utils::orthoRH_ZO(-widthHalf, widthHalf, -heightHalf, heightHalf, m_nearPlane, m_farPlane);
|
||||||
if (m_morphState == 1)
|
if (m_morphState == 1)
|
||||||
{
|
{
|
||||||
|
m_perPixelScaleFactor = m_height / heightHalf;
|
||||||
|
m_scaleFactor = scale;
|
||||||
SetProjectionMatrix(orthoMatrix);
|
SetProjectionMatrix(orthoMatrix);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user