未验证 提交 3447ee8d 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #15057 from WestLangley/dev-arrow_helper_clone

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