Explorar o código

Rectangle: Added equals()

Mr.doob %!s(int64=10) %!d(string=hai) anos
pai
achega
e7d7a1fa58
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      src/math/Rectangle.js

+ 6 - 0
src/math/Rectangle.js

@@ -32,6 +32,12 @@ THREE.Rectangle.prototype = {
 
 		return this;
 
+	},
+
+	equals: function ( rectangle ) {
+
+		return this.x === rectangle.x && this.y === rectangle.y && this.width === rectangle.width && this.height === rectangle.height;
+
 	}
 
 };

粤ICP备19079148号