提交 e46327be 编写于 作者: A Alexander Rose

Vector3: Added array and offset to toArray()

上级 cd350e4a
......@@ -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 ];
}
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册