Browse Source

Matrix4: Added equals().

Mr.doob 10 years ago
parent
commit
ccc2b58605
1 changed files with 15 additions and 0 deletions
  1. 15 0
      src/math/Matrix4.js

+ 15 - 0
src/math/Matrix4.js

@@ -991,6 +991,21 @@ THREE.Matrix4.prototype = {
 
 	},
 
+	equals: function ( matrix ) {
+
+		var te = this.elements;
+		var me = matrix.elements;
+
+		for ( var i = 0; i < 16; i ++ ) {
+
+			if ( te[ i ] !== me[ i ] ) return false;
+
+		}
+
+		return true;
+
+	},
+
 	fromArray: function ( array ) {
 
 		this.elements.set( array );