English中文

AxisAlignedBoundingBox

new Cesium.AxisAlignedBoundingBox(minimum, maximum, center)

从沿 x、y 和 z 轴的最小点和最大点创建 AxisAlignedBoundingBox 的实例。 Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.
名称 Name 类型 Type 默认值 Default 说明 Description
minimum Cartesian3 Cartesian3.ZERO 可选 optional 沿 x、y 和 z 轴的最小点。 The minimum point along the x, y, and z axes.
maximum Cartesian3 Cartesian3.ZERO 可选 optional 沿 x、y 和 z 轴的最大点。 The maximum point along the x, y, and z axes.
center Cartesian3 可选 optional 盒子的中心;如果未提供,则自动计算。 The center of the box; automatically computed if not supplied.
另见: See:

成员 Members

边界框的中心点。 The center point of the bounding box.
定义边界框的最大点。 The maximum point defining the bounding box.
默认值: Default Value: Cartesian3.ZERO
定义边界框的最小点。 The minimum point defining the bounding box.
默认值: Default Value: Cartesian3.ZERO

方法 Methods

static Cesium.AxisAlignedBoundingBox.clone(box, result)AxisAlignedBoundingBox

Duplicates a AxisAlignedBoundingBox instance.
名称 Name 类型 Type 说明 Description
box AxisAlignedBoundingBox 要复制的边界框。 The bounding box to duplicate.
result AxisAlignedBoundingBox 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 AxisAlignedBoundingBox 实例(如果未提供)。 (如果框未定义,则返回未定义) The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)

static Cesium.AxisAlignedBoundingBox.equals(left, right)boolean

比较提供的 AxisAlignedBoundingBox 组件并返回 Compares the provided AxisAlignedBoundingBox componentwise and returns true 如果它们相等, if they are equal, false otherwise.
名称 Name 类型 Type 说明 Description
left AxisAlignedBoundingBox 可选 optional 第一个 AxisAlignedBoundingBox。 The first AxisAlignedBoundingBox.
right AxisAlignedBoundingBox 可选 optional 第二个 AxisAlignedBoundingBox。 The second AxisAlignedBoundingBox.
返回: Returns:
true 如果左和右相等, if left and right are equal, false otherwise.

static Cesium.AxisAlignedBoundingBox.fromCorners(minimum, maximum, result)AxisAlignedBoundingBox

从其角创建 AxisAlignedBoundingBox 的实例。 Creates an instance of an AxisAlignedBoundingBox from its corners.
名称 Name 类型 Type 说明 Description
minimum Cartesian3 沿 x、y 和 z 轴的最小点。 The minimum point along the x, y, and z axes.
maximum Cartesian3 沿 x、y 和 z 轴的最大点。 The maximum point along the x, y, and z axes.
result AxisAlignedBoundingBox 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 AxisAlignedBoundingBox 实例(如果未提供)。 The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
示例: Example:
// Compute an axis aligned bounding box from the two corners.
const box = Cesium.AxisAlignedBoundingBox.fromCorners(new Cesium.Cartesian3(-1, -1, -1), new Cesium.Cartesian3(1, 1, 1));

static Cesium.AxisAlignedBoundingBox.fromPoints(positions, result)AxisAlignedBoundingBox

计算 AxisAlignedBoundingBox 的实例。通过查找 x、y 和 z 轴上间隔最远的点来确定该框。 Computes an instance of an AxisAlignedBoundingBox. The box is determined by finding the points spaced the farthest apart on the x, y, and z axes.
名称 Name 类型 Type 说明 Description
positions Array.<Cartesian3> 边界框将包围的点的列表。每个点必须有一个 List of points that the bounding box will enclose. Each point must have a x, y, 和 , and z properties.
result AxisAlignedBoundingBox 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 AxisAlignedBoundingBox 实例(如果未提供)。 The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
示例: Example:
// Compute an axis aligned bounding box enclosing two points.
const box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);

static Cesium.AxisAlignedBoundingBox.intersectAxisAlignedBoundingBox(box, other)boolean

确定两个轴对齐的边界框是否相交。 Determines whether two axis aligned bounding boxes intersect.
名称 Name 类型 Type 说明 Description
box AxisAlignedBoundingBox 第一个盒子 first box
other AxisAlignedBoundingBox 第二个盒子 second box
返回: Returns:
true 如果盒子相交;否则, if the boxes intersect; otherwise, false.

static Cesium.AxisAlignedBoundingBox.intersectPlane(box, plane)Intersect

确定盒子位于平面的哪一侧。 Determines which side of a plane a box is located.
名称 Name 类型 Type 说明 Description
box AxisAlignedBoundingBox 要测试的边界框。 The bounding box to test.
plane Plane 要测试的飞机。 The plane to test against.
返回: Returns:
Intersect.INSIDE 如果整个盒子位于法线指向的平面一侧, if the entire box is on the side of the plane the normal is pointing, Intersect.OUTSIDE 如果整个盒子都在对面,并且 if the entire box is on the opposite side, and Intersect.INTERSECTING 如果盒子与平面相交。 if the box intersects the plane.
复制此 AxisAlignedBoundingBox 实例。 Duplicates this AxisAlignedBoundingBox instance.
名称 Name 类型 Type 说明 Description
result AxisAlignedBoundingBox 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 AxisAlignedBoundingBox 实例(如果未提供)。 The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
将此 AxisAlignedBoundingBox 与提供的 AxisAlignedBoundingBox 组件进行比较并返回 Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns true 如果它们相等, if they are equal, false otherwise.
名称 Name 类型 Type 说明 Description
right AxisAlignedBoundingBox 可选 optional 右侧 AxisAlignedBoundingBox。 The right hand side AxisAlignedBoundingBox.
返回: Returns:
true 如果它们相等, if they are equal, false otherwise.

intersectAxisAlignedBoundingBox(other)boolean

确定其他轴对齐的边界框是否与此框相交。 Determines whether some other axis aligned bounding box intersects this box.
名称 Name 类型 Type 说明 Description
other AxisAlignedBoundingBox 另一个轴对齐边界框。 The other axis aligned bounding box.
返回: Returns:
true 如果盒子相交;否则, if the boxes intersect; otherwise, false.
确定此框位于平面的哪一侧。 Determines which side of a plane this box is located.
名称 Name 类型 Type 说明 Description
plane Plane 要测试的飞机。 The plane to test against.
返回: Returns:
Intersect.INSIDE 如果整个盒子位于法线指向的平面一侧, if the entire box is on the side of the plane the normal is pointing, Intersect.OUTSIDE 如果整个盒子都在对面,并且 if the entire box is on the opposite side, and Intersect.INTERSECTING 如果盒子与平面相交。 if the box intersects the plane.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.