|
@@ -386,9 +386,20 @@ THREE.Vector2.prototype = {
|
|
|
|
|
|
},
|
|
|
|
|
|
- toArray: function () {
|
|
|
+ toArray: function ( array, offset ) {
|
|
|
|
|
|
- return [ this.x, this.y ];
|
|
|
+ if ( array ) {
|
|
|
+
|
|
|
+ if ( offset === undefined ) offset = 0;
|
|
|
+
|
|
|
+ array[ offset ] = this.x;
|
|
|
+ array[ offset + 1 ] = this.y;
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ return [ this.x, this.y ];
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
|