diff options
author | Eric Guzman | 2012-06-20 19:42:03 -0700 |
---|---|---|
committer | Eric Guzman | 2012-06-20 19:42:03 -0700 |
commit | 3270aac4980c908f305fb53abadda5121ff6b9cb (patch) | |
tree | 6255aaab239fde71b1f4862dd70de7be62f48b85 /js/lib/math/matrix.js | |
parent | a5d93daf6fdccbfee160d6a8ba08f6b6d4b9d7cc (diff) | |
parent | 87377c81da06abf6d656017859830a3ab2902f0e (diff) | |
download | ninja-3270aac4980c908f305fb53abadda5121ff6b9cb.tar.gz |
Merge branch 'binding' of github.com:dhg637/ninja-internal into binding
Diffstat (limited to 'js/lib/math/matrix.js')
-rwxr-xr-x | js/lib/math/matrix.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/js/lib/math/matrix.js b/js/lib/math/matrix.js index 77a0966d..3a5a8215 100755 --- a/js/lib/math/matrix.js +++ b/js/lib/math/matrix.js | |||
@@ -67,6 +67,15 @@ Matrix.Rotation = function(angle, axis) { | |||
67 | return mat; | 67 | return mat; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | Matrix.Scale = function( scaleVec ) { | ||
71 | var mat = Matrix.I(4); | ||
72 | mat[ 0] = scaleVec[0]; | ||
73 | mat[ 5] = scaleVec[1]; | ||
74 | mat[10] = scaleVec[2]; | ||
75 | |||
76 | return mat; | ||
77 | }; | ||
78 | |||
70 | Matrix.flatten = function (mat) { | 79 | Matrix.flatten = function (mat) { |
71 | var result = []; | 80 | var result = []; |
72 | if (this.elements.length == 0) { | 81 | if (this.elements.length == 0) { |