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

LightShadow.clone()

该方法用于克隆光源阴影。

语法

lightShadow.clone()

返回值

返回克隆后的光源阴影。

描述

光源阴影是 three.js 中的一种光源类型,用于产生阴影效果。通过 clone 方法可以创建光源阴影的副本,这对于创建多个相似的阴影效果非常有用。

示例

// 创建一个点光源
const light = new THREE.PointLight( 0xffffff, 1, 100 );
light.position.set( 0, 10, 0 );
scene.add( light );

// 创建光源阴影
light.shadow.mapSize.width = 1024;
light.shadow.mapSize.height = 1024;
const shadow = new THREE.LightShadow( new THREE.PerspectiveCamera( 70, 1, 0.1, 1000 ) );
light.shadow = shadow;

// 克隆光源阴影
const newShadow = shadow.clone();
light.shadow = newShadow;

注意事项

克隆光源阴影将复制所有参数和设置,包括阴影图大小、阴影相机等信息。但是不会复制渲染器相关的信息,如渲染目标、自动更新等。如果需要自定义渲染器相关的信息,则需要手动设置。