Sdk/CameraComponent: Add Size property for Orthogonal rendering

Former-commit-id: 0cdebac880e7e97685c7a0a2980dba973ec651a3
This commit is contained in:
Lynix
2016-01-13 18:43:42 +01:00
parent 4562243c5f
commit f49f77b75d
3 changed files with 31 additions and 2 deletions

View File

@@ -119,9 +119,14 @@ namespace Ndk
switch (m_projectionType)
{
case Nz::ProjectionType_Orthogonal:
EnsureViewportUpdate();
if (m_size.x <= 0.f || m_size.y <= 0.f)
{
EnsureViewportUpdate();
m_projectionMatrix.MakeOrtho(0.f, static_cast<float>(m_viewport.width), 0.f, static_cast<float>(m_viewport.height), m_zNear, m_zFar);
m_projectionMatrix.MakeOrtho(0.f, static_cast<float>(m_viewport.width), 0.f, static_cast<float>(m_viewport.height), m_zNear, m_zFar);
}
else
m_projectionMatrix.MakeOrtho(0.f, m_size.x, 0.f, m_size.y, m_zNear, m_zFar);
break;
case Nz::ProjectionType_Perspective: