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

Box3.isEmpty()

Box3.isEmpty() 方法用于检测一个三维盒子是否为空。

语法

isEmpty(): Boolean

返回值

一个布尔值。如果盒子为空,则返回 true,否则返回 false

描述

Box3 是一个三维盒子对象,用于存储 min 和 max 两个点确定的空间范围。当盒子的 min 和 max 值相等时,即为空。

你可以使用 Box3 对象的 isEmpty() 方法来判断盒子是否为空。当盒子为空时,其宽度、高度和深度都为 0。

示例

var box = new THREE.Box3(new THREE.Vector3(-5, -5, -5), new THREE.Vector3(5, 5, 5));
console.log(box.isEmpty()); // false

var emptyBox = new THREE.Box3();
console.log(emptyBox.isEmpty()); // true

异常

参考

Box3