Quellcode durchsuchen

add lengthManhatten

Sergey Romanov vor 10 Jahren
Ursprung
Commit
354a5c095e
1 geänderte Dateien mit 5 neuen und 0 gelöschten Zeilen
  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() );