소스 검색

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() );