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

SpotLight.copy()

SpotLight.copy(source: SpotLight): SpotLight

此方法从给定 light 对象中复制所有属性并返回一个新对象。其中,source 是源 light 对象,而返回的对象是新的 SpotLight 实例。

参数

  • source:要复制的 SpotLight 对象。

返回值

返回一个新的 SpotLight 实例,包含从源 light 对象复制的所有属性。

使用示例

const sourceLight = new THREE.SpotLight( 0xffffff, 1 );
sourceLight.position.set( 10, 10, 10 );

const newLight = new THREE.SpotLight().copy( sourceLight );

在上面的示例中,我们创建了一个新的 SpotLight 对象 sourceLight,并设置其颜色和强度属性。然后,我们通过 SpotLight.copy() 方法创建了另一个 SpotLight 对象 newLight,并将其设置为与 sourceLight 相同的属性。现在,newLight 将包含源 light 对象的所有属性,包括位置。