Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ebadc9c

Browse files
gchoqueuxjailln
authored andcommitted
feature(Coordinates): add toArray method.
1 parent db3e455 commit ebadc9c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Core/Geographic/Coordinates.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,20 @@ class Coordinates {
216216
return target.copy(this);
217217
}
218218

219+
/**
220+
* Copy values coordinates to array
221+
*
222+
* @param {number[]} array - array to store this vector to. If this is not
223+
* provided a new array will be created.
224+
* @param {number} [offset=0] - optional offset into the array.
225+
*
226+
* @return {number[]} Returns an array [x, y, z], or copies x, y and z into
227+
* the provided array.
228+
*/
229+
toArray(array = [], offset = 0) {
230+
return THREE.Vector3.prototype.toArray.call(this, array, offset);
231+
}
232+
219233
/**
220234
* Calculate planar distance between this coordinates and `coord`.
221235
* Planar distance is the straight-line euclidean distance calculated in a 2D cartesian coordinate system.

0 commit comments

Comments
 (0)