From 1b46a13cdd9d348152f0ae7d346c7d9ff6af824c Mon Sep 17 00:00:00 2001 From: WestLangley Date: Tue, 10 Oct 2017 18:55:56 -0400 Subject: [PATCH] distanceToManhattan() -> manhattanDistanceTo() --- docs/api/math/Vector2.html | 2 +- docs/api/math/Vector3.html | 2 +- src/Three.Legacy.js | 18 +++++++++++++++--- src/math/Vector2.js | 2 +- src/math/Vector3.js | 2 +- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/api/math/Vector2.html b/docs/api/math/Vector2.html index 76d3e05a74..34651dc5fe 100644 --- a/docs/api/math/Vector2.html +++ b/docs/api/math/Vector2.html @@ -148,7 +148,7 @@

[method:Float distanceTo]( [page:Vector2 v] )

Computes the distance from this vector to [page:Vector2 v].
-

[method:Float distanceToManhattan]( [page:Vector2 v] )

+

[method:Float manhattanDistanceTo]( [page:Vector2 v] )

Computes the [link:https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance] from this vector to [page:Vector2 v].
diff --git a/docs/api/math/Vector3.html b/docs/api/math/Vector3.html index 216b7daa6f..add11dff96 100644 --- a/docs/api/math/Vector3.html +++ b/docs/api/math/Vector3.html @@ -178,7 +178,7 @@ var d = a.distanceTo( b );

[method:Float distanceTo]( [page:Vector3 v] )

Computes the distance from this vector to [page:Vector3 v].
-

[method:Float distanceToManhattan]( [page:Vector3 v] )

+

[method:Float manhattanDistanceTo]( [page:Vector3 v] )

Computes the [link:https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance] from this vector to [page:Vector3 v].
diff --git a/src/Three.Legacy.js b/src/Three.Legacy.js index 2740d84655..e9c1898039 100644 --- a/src/Three.Legacy.js +++ b/src/Three.Legacy.js @@ -657,9 +657,15 @@ Object.assign( Vector2.prototype, { 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 ); + }, + 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, { }, 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 ); + }, + 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, { 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 ); } diff --git a/src/math/Vector2.js b/src/math/Vector2.js index 38f217aaba..ae2987784e 100644 --- a/src/math/Vector2.js +++ b/src/math/Vector2.js @@ -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 ); diff --git a/src/math/Vector3.js b/src/math/Vector3.js index 381c240871..552d343818 100644 --- a/src/math/Vector3.js +++ b/src/math/Vector3.js @@ -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 ); -- GitLab