Using morphable and freecam controllers in example app, blending matrices using vectors, improvements regarding updating projection matrices, removed FreeCam components from MorphableController, renamed variable to m_targetMorphStatePerspective, setting target morph state using setter
This commit is contained in:
@@ -15,7 +15,7 @@ namespace OpenVulkano::Scene
|
||||
Math::Matrix4f result;
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
for (int j = 0; j < 4; ++j) { result[i][j] = glm::mix(mat1[i][j], mat2[i][j], t); }
|
||||
result[i] = Math::Utils::mix(mat1[i], mat2[i], t);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -25,8 +25,17 @@ namespace OpenVulkano::Scene
|
||||
PerspectiveCamera::UpdateProjectionMatrix();
|
||||
float aspectH = m_aspect;
|
||||
float aspectV = 1;
|
||||
m_orthoMatrix = Math::Utils::orthoRH_ZO(-aspectH, aspectH, -aspectV, aspectV, m_nearPlane, m_farPlane);
|
||||
m_projection = BlendMatrices(m_projection, m_orthoMatrix, m_morphState);
|
||||
UpdateViewProjectionMatrix();
|
||||
if (m_morphState == 0) { UpdateViewProjectionMatrix(); }
|
||||
else if (m_morphState == 1)
|
||||
{
|
||||
m_projection = Math::Utils::orthoRH_ZO(-aspectH, aspectH, -aspectV, aspectV, m_nearPlane, m_farPlane);
|
||||
UpdateViewProjectionMatrix();
|
||||
}
|
||||
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