RectAreaLight.copy()
方法用于创建一个 RectAreaLight
对象的副本。这个方法返回一个新的 RectAreaLight
对象。
newRectAreaLight = rectAreaLight.copy( source );
source
:需要复制的 RectAreaLight
对象。返回一个新的复制对象。
// 创建一个矩形区域光源
const rectLight = new THREE.RectAreaLight( 0xffffff, 1, 10, 10 );
rectLight.position.set( 0, 5, 0 );
// 复制矩形区域光源
const rectLight2 = rectLight.copy( rectLight );
function copy( source ) {
Light.prototype.copy.call( this, source );
this.width = source.width;
this.height = source.height;
return this;
}
copy
方法只会复制源对象的属性,而不包括其子对象和事件列表等内容。