diff --git a/src/helpers/ArrowHelper.js b/src/helpers/ArrowHelper.js index 11d3f4ef93326515c14a6e2766ef0821eba55584..36c3160483cebec26f6ceeef28e45265865bd520 100644 --- a/src/helpers/ArrowHelper.js +++ b/src/helpers/ArrowHelper.js @@ -32,8 +32,10 @@ function ArrowHelper( dir, origin, length, color, headLength, headWidth ) { Object3D.call( this ); - if ( color === undefined ) color = 0xffff00; + if ( dir === undefined ) dir = new THREE.Vector3( 0, 0, 1 ); + if ( origin === undefined ) origin = new THREE.Vector3( 0, 0, 0 ); if ( length === undefined ) length = 1; + if ( color === undefined ) color = 0xffff00; if ( headLength === undefined ) headLength = 0.2 * length; if ( headWidth === undefined ) headWidth = 0.2 * headLength; @@ -117,5 +119,21 @@ ArrowHelper.prototype.setColor = function ( color ) { }; +ArrowHelper.prototype.copy = function ( source ) { + + Object3D.prototype.copy.call( this, source, false ); + + this.line.copy( source.line ); + this.cone.copy( source.cone ); + + return this; + +}; + +ArrowHelper.prototype.clone = function () { + + return new this.constructor().copy( this ); + +}; export { ArrowHelper };