浏览代码

add lengthManhatten

Sergey Romanov 10 年之前
父节点
当前提交
354a5c095e
共有 1 个文件被更改,包括 5 次插入0 次删除
  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() );