Browse Source

add lengthManhatten

Sergey Romanov 10 năm trước cách đây
mục cha
commit
354a5c095e
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      src/math/Vector2.js

+ 5 - 0
src/math/Vector2.js

@@ -337,6 +337,11 @@ THREE.Vector2.prototype = {
 
 	},
 
+	lengthManhatten: function() {
+
+		return Math.abs( this.x ) + Math.abs( this.y );
+	},
+
 	normalize: function () {
 
 		return this.divideScalar( this.length() );