Added warning when clip matrix is not invertible
Former-commit-id: 4707faab0259062ad619a5e5c72fcbbfaf853e3c
This commit is contained in:
parent
5d0ed4f27c
commit
74d396a376
|
|
@ -263,7 +263,8 @@ NzFrustum<T>& NzFrustum<T>::Extract(const NzMatrix4<T>& clipMatrix)
|
|||
// Je me base sur cette page: http://www.gamedev.net/topic/393309-calculating-the-view-frustums-vertices/
|
||||
|
||||
NzMatrix4f invClipMatrix;
|
||||
clipMatrix.GetInverse(&invClipMatrix);
|
||||
if (clipMatrix.GetInverse(&invClipMatrix))
|
||||
{
|
||||
NzVector4f corner;
|
||||
|
||||
// FarLeftBottom
|
||||
|
|
@ -321,6 +322,9 @@ NzFrustum<T>& NzFrustum<T>::Extract(const NzMatrix4<T>& clipMatrix)
|
|||
corner.Normalize();
|
||||
|
||||
m_corners[nzCorner_NearRightTop] = NzVector3<T>(corner.x, corner.y, corner.z);
|
||||
}
|
||||
else
|
||||
NazaraWarning("Clip matrix is not invertible, failed to compute frustum corners");
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue