|
@@ -796,9 +796,21 @@ THREE.Vector3.prototype = {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- toArray: function () {
|
|
|
|
|
|
+ toArray: function ( array, offset ) {
|
|
|
|
|
|
- return [ this.x, this.y, this.z ];
|
|
|
|
|
|
+ if ( array ) {
|
|
|
|
+
|
|
|
|
+ if ( offset === undefined ) offset = 0;
|
|
|
|
+
|
|
|
|
+ array[ offset ] = this.x;
|
|
|
|
+ array[ offset + 1 ] = this.y;
|
|
|
|
+ array[ offset + 2 ] = this.z;
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ return [ this.x, this.y, this.z ];
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|