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

Plane.copy()

该方法用于将传入的平面的参数复制到当前平面中。

语法

plane.copy( planeToCopy );

参数

  • planeToCopyPlane ):需要进行复制的平面。

示例

const plane1 = new THREE.Plane( new THREE.Vector3( 1, 0, 0 ), 0 );
const plane2 = new THREE.Plane();
plane2.copy( plane1 );

在示例中,我们先创建了一个平面plane1,并将其初始化为法向量为(1,0,0),截距为0的平面。然后我们创建了一个新的平面plane2,并使用plane1.copy( plane2 )方法将plane1的参数复制到plane2中。现在,我们可以认为plane1和plane2是相同的平面了。

源码

THREE.Plane.prototype.copy = function ( plane ) {
    this.normal.copy( plane.normal );
    this.constant = plane.constant;
};

在源码中,我们可以看到Plane.copy方法是由THREE.Plane.prototype.copy定义的。该方法使用传入的平面的参数来更新当前平面的法向量和截距。