瀏覽代碼

lengthManhattan() -> manhattanLength()

WestLangley 7 年之前
父節點
當前提交
0304a5520d

+ 1 - 1
docs/api/math/Vector2.html

@@ -209,7 +209,7 @@
 		<div>Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
 		(straight-line length) from (0, 0) to (x, y).</div>
 
-		<h3>[method:Float lengthManhattan]()</h3>
+		<h3>[method:Float manhattanLength]()</h3>
 		<div>
 		Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector.
 		</div>

+ 1 - 1
docs/api/math/Vector3.html

@@ -241,7 +241,7 @@ var d = a.distanceTo( b );
 		<div>Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
 		(straight-line length) from (0, 0, 0) to (x, y, z).</div>
 
-		<h3>[method:Float lengthManhattan]()</h3>
+		<h3>[method:Float manhattanLength]()</h3>
 		<div>
 		Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector.
 		</div>

+ 1 - 1
docs/api/math/Vector4.html

@@ -188,7 +188,7 @@ var d = a.dot( b );
 		<div>Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
 		(straight-line length) from (0, 0, 0, 0) to (x, y, z, w).</div>
 
-		<h3>[method:Float lengthManhattan]()</h3>
+		<h3>[method:Float manhattanLength]()</h3>
 		<div>
 		Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector.
 		</div>

+ 18 - 0
src/Three.Legacy.js

@@ -666,6 +666,12 @@ Object.assign( Vector2.prototype, {
 		console.warn( 'THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );
 		return this.manhattanDistanceTo( v );
 
+	},
+	lengthManhattan: function () {
+
+		console.warn( 'THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().' );
+		return this.manhattanLength();
+
 	}
 
 } );
@@ -717,6 +723,12 @@ Object.assign( Vector3.prototype, {
 		console.warn( 'THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );
 		return this.manhattanDistanceTo( v );
 
+	},
+	lengthManhattan: function () {
+
+		console.warn( 'THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().' );
+		return this.manhattanLength();
+
 	}
 
 } );
@@ -728,6 +740,12 @@ Object.assign( Vector4.prototype, {
 		console.warn( 'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().' );
 		return this.fromBufferAttribute( attribute, index, offset );
 
+	},
+	lengthManhattan: function () {
+
+		console.warn( 'THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().' );
+		return this.manhattanLength();
+
 	}
 
 } );

+ 1 - 1
src/math/Vector2.js

@@ -365,7 +365,7 @@ Object.assign( Vector2.prototype, {
 
 	},
 
-	lengthManhattan: function () {
+	manhattanLength: function () {
 
 		return Math.abs( this.x ) + Math.abs( this.y );
 

+ 1 - 1
src/math/Vector3.js

@@ -496,7 +496,7 @@ Object.assign( Vector3.prototype, {
 
 	},
 
-	lengthManhattan: function () {
+	manhattanLength: function () {
 
 		return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z );
 

+ 1 - 1
src/math/Vector4.js

@@ -538,7 +538,7 @@ Object.assign( Vector4.prototype, {
 
 	},
 
-	lengthManhattan: function () {
+	manhattanLength: function () {
 
 		return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );
 

+ 2 - 2
src/objects/SkinnedMesh.js

@@ -130,7 +130,7 @@ SkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
 
 				var sw = this.geometry.skinWeights[ i ];
 
-				scale = 1.0 / sw.lengthManhattan();
+				scale = 1.0 / sw.manhattanLength();
 
 				if ( scale !== Infinity ) {
 
@@ -157,7 +157,7 @@ SkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
 				vec.z = skinWeight.getZ( i );
 				vec.w = skinWeight.getW( i );
 
-				scale = 1.0 / vec.lengthManhattan();
+				scale = 1.0 / vec.manhattanLength();
 
 				if ( scale !== Infinity ) {