Browse Source

Fix a nasty bug in the float4x4::frustum() computation.

legacy
Sam Hocevar sam 14 years ago
parent
commit
dcc0087455
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/matrix.cpp

+ 3
- 3
src/matrix.cpp View File

@@ -65,9 +65,9 @@ template<> float4x4 float4x4::invert() const
template<> float4x4 float4x4::frustum(float left, float right, float bottom, template<> float4x4 float4x4::frustum(float left, float right, float bottom,
float top, float near, float far) float top, float near, float far)
{ {
float invrl = (right != left) ? 1.0f / right - left : 0.0f;
float invtb = (top != bottom) ? 1.0f / top - bottom : 0.0f;
float invfn = (far != near) ? 1.0f / far - near : 0.0f;
float invrl = (right != left) ? 1.0f / (right - left) : 0.0f;
float invtb = (top != bottom) ? 1.0f / (top - bottom) : 0.0f;
float invfn = (far != near) ? 1.0f / (far - near) : 0.0f;


float4x4 ret(0.0f); float4x4 ret(0.0f);
ret[0][0] = 2.0f * near * invrl; ret[0][0] = 2.0f * near * invrl;


Loading…
Cancel
Save