Closed GoogleCodeExporter closed 8 years ago
mat4.scale = function(mat, vec, dest) {
var x = vec[0], y = vec[1], z = vec[2];
if(!dest || mat == dest) {
mat[0] *= x;
mat[4] *= x;
mat[8] *= x;
mat[12] *= x;
mat[1] *= y;
mat[5] *= y;
mat[9] *= y;
mat[13] *= y;
mat[2] *= z;
mat[6] *= z;
mat[10] *= z;
mat[14] *= z;
return mat;
}
dest[0] = mat[0]*x;
dest[4] = mat[4]*x;
dest[8] = mat[8]*x;
dest[12] = mat[12]*x;
dest[1] = mat[1]*y;
dest[5] = mat[5]*y;
dest[9] = mat[9]*y;
dest[13] = mat[13]*y;
dest[2] = mat[2]*z;
dest[6] = mat[6]*z;
dest[10] = mat[10]*z;
dest[14] = mat[14]*z;
dest[3] = mat[3];
dest[7] = mat[7];
dest[11] = mat[11];
dest[15] = mat[15];
return dest;
};
this should fix it
return dest;
};
Original comment by jeroom832@gmail.com
on 1 Aug 2010 at 5:01
Thanks for spotting that, and thank you jeroom for the fix. I'll get on this
soon.
Original comment by Tojiro@gmail.com
on 1 Aug 2010 at 5:43
Fix implemented. Need to add unit test for it
Original comment by Tojiro@gmail.com
on 12 Aug 2010 at 6:53
Original comment by Tojiro@gmail.com
on 27 Feb 2011 at 6:18
Original issue reported on code.google.com by
diagne.c...@gmail.com
on 31 Jul 2010 at 4:44