fix Matrix.Chained (wrong order of composition)

This commit is contained in:
faiface 2017-09-04 00:40:12 +02:00
parent 7c5e5588e2
commit ce09bb1114
1 changed files with 6 additions and 6 deletions

View File

@ -348,12 +348,12 @@ func (m Matrix) Rotated(around Vec, angle float64) Matrix {
// after the transformations of this Matrix.
func (m Matrix) Chained(next Matrix) Matrix {
return Matrix{
m[0]*next[0] + m[2]*next[1],
m[1]*next[0] + m[3]*next[1],
m[0]*next[2] + m[2]*next[3],
m[1]*next[2] + m[3]*next[3],
m[0]*next[4] + m[2]*next[5] + m[4],
m[1]*next[4] + m[3]*next[5] + m[5],
next[0]*m[0] + next[2]*m[1],
next[1]*m[0] + next[3]*m[1],
next[0]*m[2] + next[2]*m[3],
next[1]*m[2] + next[3]*m[3],
next[0]*m[4] + next[2]*m[5] + next[4],
next[1]*m[4] + next[3]*m[5] + next[5],
}
}