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

Frustum.clone()

Frustum.clone() 方法用于创建一个当前 Frustum 对象的浅拷贝。

语法

frustum.clone()

参数

返回值

返回一个新的 Frustum 对象,该对象是当前 Frustum 对象的浅拷贝。

示例

var frustum = new THREE.Frustum();
var camera = new THREE.PerspectiveCamera();
camera.updateProjectionMatrix();
frustum.setFromProjectionMatrix(camera.projectionMatrix);
var clonedFrustum = frustum.clone();

注意事项

Frustum.clone() 方法创建一个对象的浅拷贝。如果原始对象的某个属性是引用类型,则新的对象和原始对象将引用相同的对象。这意味着,如果对新的 Frustum 对象进行更改,则原始 Frustum 对象的属性也将更改。因此,对于复杂的对象,可以考虑使用 Object.assign() 方法或者其他深拷贝方法来创建副本。