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

Merge pull request #12386 from WestLangley/dev-manhattan

distanceToManhattan() -> manhattanDistanceTo()
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<h3>[method:Float distanceTo]( [page:Vector2 v] )</h3> <h3>[method:Float distanceTo]( [page:Vector2 v] )</h3>
<div>Computes the distance from this vector to [page:Vector2 v].</div> <div>Computes the distance from this vector to [page:Vector2 v].</div>
<h3>[method:Float distanceToManhattan]( [page:Vector2 v] )</h3> <h3>[method:Float manhattanDistanceTo]( [page:Vector2 v] )</h3>
<div> <div>
Computes the [link:https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance] from this vector to [page:Vector2 v]. Computes the [link:https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance] from this vector to [page:Vector2 v].
</div> </div>
......
...@@ -178,7 +178,7 @@ var d = a.distanceTo( b ); ...@@ -178,7 +178,7 @@ var d = a.distanceTo( b );
<h3>[method:Float distanceTo]( [page:Vector3 v] )</h3> <h3>[method:Float distanceTo]( [page:Vector3 v] )</h3>
<div>Computes the distance from this vector to [page:Vector3 v].</div> <div>Computes the distance from this vector to [page:Vector3 v].</div>
<h3>[method:Float distanceToManhattan]( [page:Vector3 v] )</h3> <h3>[method:Float manhattanDistanceTo]( [page:Vector3 v] )</h3>
<div> <div>
Computes the [link:https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance] from this vector to [page:Vector3 v]. Computes the [link:https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance] from this vector to [page:Vector3 v].
</div> </div>
......
...@@ -657,9 +657,15 @@ Object.assign( Vector2.prototype, { ...@@ -657,9 +657,15 @@ Object.assign( Vector2.prototype, {
fromAttribute: function ( attribute, index, offset ) { fromAttribute: function ( attribute, index, offset ) {
console.error( 'THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().' ); console.warn( 'THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().' );
return this.fromBufferAttribute( attribute, index, offset ); return this.fromBufferAttribute( attribute, index, offset );
},
distanceToManhattan: function ( v ) {
console.warn( 'THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );
return this.manhattanDistanceTo( v );
} }
} ); } );
...@@ -702,9 +708,15 @@ Object.assign( Vector3.prototype, { ...@@ -702,9 +708,15 @@ Object.assign( Vector3.prototype, {
}, },
fromAttribute: function ( attribute, index, offset ) { fromAttribute: function ( attribute, index, offset ) {
console.error( 'THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().' ); console.warn( 'THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().' );
return this.fromBufferAttribute( attribute, index, offset ); return this.fromBufferAttribute( attribute, index, offset );
},
distanceToManhattan: function ( v ) {
console.warn( 'THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' );
return this.manhattanDistanceTo( v );
} }
} ); } );
...@@ -713,7 +725,7 @@ Object.assign( Vector4.prototype, { ...@@ -713,7 +725,7 @@ Object.assign( Vector4.prototype, {
fromAttribute: function ( attribute, index, offset ) { fromAttribute: function ( attribute, index, offset ) {
console.error( '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 );
} }
......
...@@ -402,7 +402,7 @@ Object.assign( Vector2.prototype, { ...@@ -402,7 +402,7 @@ Object.assign( Vector2.prototype, {
}, },
distanceToManhattan: function ( v ) { manhattanDistanceTo: function ( v ) {
return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ); return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y );
......
...@@ -623,7 +623,7 @@ Object.assign( Vector3.prototype, { ...@@ -623,7 +623,7 @@ Object.assign( Vector3.prototype, {
}, },
distanceToManhattan: function ( v ) { manhattanDistanceTo: function ( v ) {
return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z ); return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册