mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-17 08:55:59 +10:00
Added transpose method to Matrix4
This commit is contained in:
committed by
Mr.doob
parent
a319fe3c7b
commit
20be01f159
+18
-1
@@ -185,7 +185,24 @@ THREE.Matrix4.prototype = {
|
||||
this.n11 * this.n22 * this.n33 * this.n44 );
|
||||
|
||||
},
|
||||
|
||||
|
||||
transpose: function () {
|
||||
function swap(obj, p1, p2) {
|
||||
var aux = obj[p1];
|
||||
obj[p1] = obj[p2];
|
||||
obj[p2] = aux;
|
||||
}
|
||||
|
||||
swap(this, 'n21', 'n12');
|
||||
swap(this, 'n31', 'n13');
|
||||
swap(this, 'n32', 'n23');
|
||||
swap(this, 'n41', 'n14');
|
||||
swap(this, 'n42', 'n24');
|
||||
swap(this, 'n43', 'n34');
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
clone: function () {
|
||||
|
||||
var m = new THREE.Matrix4();
|
||||
|
||||
Reference in New Issue
Block a user