提交 a7c32a0d 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #12387 from WestLangley/dev-manhattan2

lengthManhattan() -> manhattanLength()
...@@ -209,7 +209,7 @@ ...@@ -209,7 +209,7 @@
<div>Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length] <div>Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
(straight-line length) from (0, 0) to (x, y).</div> (straight-line length) from (0, 0) to (x, y).</div>
<h3>[method:Float lengthManhattan]()</h3> <h3>[method:Float manhattanLength]()</h3>
<div> <div>
Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector. Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector.
</div> </div>
......
...@@ -241,7 +241,7 @@ var d = a.distanceTo( b ); ...@@ -241,7 +241,7 @@ var d = a.distanceTo( b );
<div>Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length] <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> (straight-line length) from (0, 0, 0) to (x, y, z).</div>
<h3>[method:Float lengthManhattan]()</h3> <h3>[method:Float manhattanLength]()</h3>
<div> <div>
Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector. Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector.
</div> </div>
......
...@@ -188,7 +188,7 @@ var d = a.dot( b ); ...@@ -188,7 +188,7 @@ var d = a.dot( b );
<div>Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length] <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> (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> <div>
Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector. Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector.
</div> </div>
......
...@@ -666,6 +666,12 @@ Object.assign( Vector2.prototype, { ...@@ -666,6 +666,12 @@ Object.assign( Vector2.prototype, {
console.warn( 'THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' ); console.warn( 'THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );
return this.manhattanDistanceTo( v ); 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, { ...@@ -717,6 +723,12 @@ Object.assign( Vector3.prototype, {
console.warn( 'THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' ); console.warn( 'THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );
return this.manhattanDistanceTo( v ); 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, { ...@@ -728,6 +740,12 @@ Object.assign( Vector4.prototype, {
console.warn( 'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().' ); console.warn( 'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().' );
return this.fromBufferAttribute( attribute, index, offset ); return this.fromBufferAttribute( attribute, index, offset );
},
lengthManhattan: function () {
console.warn( 'THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().' );
return this.manhattanLength();
} }
} ); } );
......
...@@ -365,7 +365,7 @@ Object.assign( Vector2.prototype, { ...@@ -365,7 +365,7 @@ Object.assign( Vector2.prototype, {
}, },
lengthManhattan: function () { manhattanLength: function () {
return Math.abs( this.x ) + Math.abs( this.y ); return Math.abs( this.x ) + Math.abs( this.y );
......
...@@ -496,7 +496,7 @@ Object.assign( Vector3.prototype, { ...@@ -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 ); return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z );
......
...@@ -538,7 +538,7 @@ Object.assign( Vector4.prototype, { ...@@ -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 ); return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );
......
...@@ -130,7 +130,7 @@ SkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), { ...@@ -130,7 +130,7 @@ SkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
var sw = this.geometry.skinWeights[ i ]; var sw = this.geometry.skinWeights[ i ];
scale = 1.0 / sw.lengthManhattan(); scale = 1.0 / sw.manhattanLength();
if ( scale !== Infinity ) { if ( scale !== Infinity ) {
...@@ -157,7 +157,7 @@ SkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), { ...@@ -157,7 +157,7 @@ SkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
vec.z = skinWeight.getZ( i ); vec.z = skinWeight.getZ( i );
vec.w = skinWeight.getW( i ); vec.w = skinWeight.getW( i );
scale = 1.0 / vec.lengthManhattan(); scale = 1.0 / vec.manhattanLength();
if ( scale !== Infinity ) { if ( scale !== Infinity ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册