Consequences of the plane change + change perspective

The perspective matrix now as in glm (because the near frustum plane was
wrong). So there is a factor "2" on the component w and the skybox must
be changed in consequence.


Former-commit-id: 09dd049c177532b9ace34a5a60b1b96014652297
This commit is contained in:
Gawaboumga
2015-08-21 12:01:52 +02:00
parent f2b80bfe64
commit 282bdf9864
8 changed files with 865 additions and 35 deletions

View File

@@ -180,7 +180,7 @@ NzFrustum<T>& NzFrustum<T>::Extract(const NzMatrix4<T>& clipMatrix)
plane[0] *= invLength;
plane[1] *= invLength;
plane[2] *= invLength;
plane[3] *= invLength;
plane[3] *= -invLength;
m_planes[nzFrustumPlane_Right].Set(plane);
@@ -195,7 +195,7 @@ NzFrustum<T>& NzFrustum<T>::Extract(const NzMatrix4<T>& clipMatrix)
plane[0] *= invLength;
plane[1] *= invLength;
plane[2] *= invLength;
plane[3] *= invLength;
plane[3] *= -invLength;
m_planes[nzFrustumPlane_Left].Set(plane);
@@ -210,7 +210,7 @@ NzFrustum<T>& NzFrustum<T>::Extract(const NzMatrix4<T>& clipMatrix)
plane[0] *= invLength;
plane[1] *= invLength;
plane[2] *= invLength;
plane[3] *= invLength;
plane[3] *= -invLength;
m_planes[nzFrustumPlane_Bottom].Set(plane);
@@ -225,7 +225,7 @@ NzFrustum<T>& NzFrustum<T>::Extract(const NzMatrix4<T>& clipMatrix)
plane[0] *= invLength;
plane[1] *= invLength;
plane[2] *= invLength;
plane[3] *= invLength;
plane[3] *= -invLength;
m_planes[nzFrustumPlane_Top].Set(plane);
@@ -240,7 +240,7 @@ NzFrustum<T>& NzFrustum<T>::Extract(const NzMatrix4<T>& clipMatrix)
plane[0] *= invLength;
plane[1] *= invLength;
plane[2] *= invLength;
plane[3] *= invLength;
plane[3] *= -invLength;
m_planes[nzFrustumPlane_Far].Set(plane);
@@ -255,7 +255,7 @@ NzFrustum<T>& NzFrustum<T>::Extract(const NzMatrix4<T>& clipMatrix)
plane[0] *= invLength;
plane[1] *= invLength;
plane[2] *= invLength;
plane[3] *= invLength;
plane[3] *= -invLength;
m_planes[nzFrustumPlane_Near].Set(plane);
@@ -332,10 +332,7 @@ NzFrustum<T>& NzFrustum<T>::Extract(const NzMatrix4<T>& clipMatrix)
template<typename T>
NzFrustum<T>& NzFrustum<T>::Extract(const NzMatrix4<T>& view, const NzMatrix4<T>& projection)
{
NzMatrix4<T> clipMatrix(view);
clipMatrix *= projection;
return Extract(clipMatrix);
return Extract(NzMatrix4<T>::Concatenate(view, projection));
}
template<typename T>