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

Light.copy()

描述

Light.copy() 方法用于复制属于该光源的属性值到另一个光源中。这种复制操作包括高光颜色、强度、位置坐标、方向向量以及其他任何相关属性。

注意:该方法只能在three.js中的Light对象上调用。

语法

light.copy(source);

参数

  • source (必填):被复制的Light对象。

示例

使用copy()方法从一个点光源复制属性值到另一个点光源中。

const pointLight1 = new THREE.PointLight(0xffffff, 1, 0);
pointLight1.position.set(1, 2, 3);

const pointLight2 = new THREE.PointLight(0xffffff, 1, 0.5);
pointLight2.position.set(5, 3, 1);

pointLight2.copy(pointLight1);

console.log(pointLight2.color);    // Color {r: 1, g: 1, b: 1}
console.log(pointLight2.intensity);// 1
console.log(pointLight2.position); // Vector3 {x: 1, y: 2, z: 3}

参考