Permalink
Browse files

Solved bug #2, inverse used overrun in buffer.

  • Loading branch information...
1 parent 62b9225 commit 1686718adb5155c613cafb89f9c4f5dca57ef78e @idmillington committed May 17, 2011
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/core.cpp
View
@@ -61,15 +61,15 @@ void Matrix4::setInverse(const Matrix4 &m)
data[0] = (-m.data[9]*m.data[6]+m.data[5]*m.data[10])*det;
data[4] = (m.data[8]*m.data[6]-m.data[4]*m.data[10])*det;
- data[8] = (-m.data[8]*m.data[5]+m.data[4]*m.data[9]* m.data[15])*det;
+ data[8] = (-m.data[8]*m.data[5]+m.data[4]*m.data[9])*det;
data[1] = (m.data[9]*m.data[2]-m.data[1]*m.data[10])*det;
data[5] = (-m.data[8]*m.data[2]+m.data[0]*m.data[10])*det;
- data[9] = (m.data[8]*m.data[1]-m.data[0]*m.data[9]* m.data[15])*det;
+ data[9] = (m.data[8]*m.data[1]-m.data[0]*m.data[9])*det;
- data[2] = (-m.data[5]*m.data[2]+m.data[1]*m.data[6]* m.data[15])*det;
- data[6] = (+m.data[4]*m.data[2]-m.data[0]*m.data[6]* m.data[15])*det;
- data[10] = (-m.data[4]*m.data[1]+m.data[0]*m.data[5]* m.data[15])*det;
+ data[2] = (-m.data[5]*m.data[2]+m.data[1]*m.data[6])*det;
+ data[6] = (+m.data[4]*m.data[2]-m.data[0]*m.data[6])*det;
+ data[10] = (-m.data[4]*m.data[1]+m.data[0]*m.data[5])*det;
data[3] = (m.data[9]*m.data[6]*m.data[3]
-m.data[5]*m.data[10]*m.data[3]
@@ -98,4 +98,4 @@ Matrix3 Matrix3::linearInterpolate(const Matrix3& a, const Matrix3& b, real prop
result.data[i] = a.data[i] * (1-prop) + b.data[i] * prop;
}
return result;
-}
+}

0 comments on commit 1686718

Please sign in to comment.