瀏覽代碼

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

legacy
Sam Hocevar sam 15 年之前
父節點
當前提交
dcc0087455
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. +3
    -3
      src/matrix.cpp

+ 3
- 3
src/matrix.cpp 查看文件

@@ -65,9 +65,9 @@ template<> float4x4 float4x4::invert() const
template<> float4x4 float4x4::frustum(float left, float right, float bottom,
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);
ret[0][0] = 2.0f * near * invrl;


Loading…
取消
儲存