BufferGeometry
Object3D
Raycaster
Camera
CubeCamera
PerspectiveCamera
OrthographicCamera
StereoCamera
Clock
Curve
CurvePath
Path
Shape
ShapePath
ArrowHelper
AxesHelper
BoxHelper
Box3Helper
CameraHelper
DirectionalLightHelper
GridHelper
PolarGridHelper
HemisphereLightHelper
PlaneHelper
PointLightHelper
SkeletonHelper
SpotLightHelper
Light
PointLight
RectAreaLight
SpotLight
DirectionalLight
HemisphereLight
LightShadow
PointLightShadow
AnimationLoader
AudioLoader
BufferGeometryLoader
CompressedTextureLoader
CubeTextureLoader
DataTextureLoader
FileLoader
ImageBitmapLoader
ImageLoader
Loader
LoaderUtils
MaterialLoader
ObjectLoader
TextureLoader
LoadingManager
Material
Box2
Box3
Color
Cylindrical
Euler
Frustum
Interpolant
Line3
MathUtils
Matrix3
Matrix4
Plane
Quaternion
AnimationAction
AnimationClip
AnimationMixer
AnimationObjectGroup
AnimationUtils
keyframeTrack
PropertyBinding
PropertyMixer
BooleanKeyframeTrack
QuaternionKeyframeTrack
StringKeyframeTrack
Audio
AudioAnalyser
AudioContext
AudioListener
PositionalAudio

HemisphereLight.copy()

HemisphereLight.copy()是three.js库中的函数,它可以将一个半球光源(HemisphereLight)的所有属性从一个光源实例复制给另一个光源实例。这个函数返回的是拷贝过的光源实例。

HemisphereLight.copy(source: HemisphereLight): HemisphereLight

参数

  • source : HemisphereLight - 源光源实例,从这个实例里面复制属性。

使用方法

下面是使用HemisphereLight.copy()方法的示例:

// 创建两个半球光源
const light1 = new THREE.HemisphereLight( 0xffffff, 0x0000ff, 1 );
const light2 = new THREE.HemisphereLight( 0xffffff, 0xff0000, 1 );

// 将光源2复制光源1的属性
light2.copy( light1 );

在上述代码示例中,创建了两个半球光源light1light2,然后通过调用HemisphereLight.copy()函数将light2光源复制了light1光源的属性。

返回

  • HemisphereLight - 克隆之后的光源实例。

示例

const light1 = new THREE.HemisphereLight( 0xffffff, 0x0000ff, 1 );
const light2 = new THREE.HemisphereLight( 0xffffff, 0xff0000, 1 );

light2.copy( light1 );

console.log(light2.intensity); // 1
console.log(light2.color); // THREE.Color(0xffffff)
console.log(light2.groundColor); // THREE.Color(0x0000ff)

在上述代码示例中,光源2(light2)通过HemisphereLight.copy()克隆光源1(light1)的属性,展示了克隆之后的光源实例的属性值。