Appearance
KBE3D / KBCore / Cesium / AxisAlignedBoundingBox
类: AxisAlignedBoundingBox
Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.
参数
The minimum point along the x, y, and z axes.
参数
The maximum point along the x, y, and z axes.
参数
The center of the box; automatically computed if not supplied.
属性
minimum
minimum:
Cartesian3
The minimum point defining the bounding box.
maximum
maximum:
Cartesian3
The maximum point defining the bounding box.
center
center:
Cartesian3
The center point of the bounding box.
方法
fromCorners()
staticfromCorners(minimum:Cartesian3,maximum:Cartesian3,result?:AxisAlignedBoundingBox):AxisAlignedBoundingBox
Creates an instance of an AxisAlignedBoundingBox from its corners.
参数
minimum
The minimum point along the x, y, and z axes.
maximum
The maximum point along the x, y, and z axes.
result?
AxisAlignedBoundingBox
The object onto which to store the result.
返回
AxisAlignedBoundingBox
The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
示例
ts
// 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));fromPoints()
staticfromPoints(positions:Cartesian3[],result?:AxisAlignedBoundingBox):AxisAlignedBoundingBox
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.
参数
positions
List of points that the bounding box will enclose. Each point must have a <code>x</code>, <code>y</code>, and <code>z</code> properties.
result?
AxisAlignedBoundingBox
The object onto which to store the result.
返回
AxisAlignedBoundingBox
The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
示例
ts
// 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)]);clone()
staticclone(box:AxisAlignedBoundingBox,result?:AxisAlignedBoundingBox):AxisAlignedBoundingBox
Duplicates a AxisAlignedBoundingBox instance.
参数
box
AxisAlignedBoundingBox
The bounding box to duplicate.
result?
AxisAlignedBoundingBox
The object onto which to store the result.
返回
AxisAlignedBoundingBox
The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
equals()
staticequals(left?:AxisAlignedBoundingBox,right?:AxisAlignedBoundingBox):boolean
Compares the provided AxisAlignedBoundingBox componentwise and returns <code>true</code> if they are equal, <code>false</code> otherwise.
参数
left?
AxisAlignedBoundingBox
The first AxisAlignedBoundingBox.
right?
AxisAlignedBoundingBox
The second AxisAlignedBoundingBox.
返回
boolean
true if left and right are equal, false otherwise.
intersectPlane()
staticintersectPlane(box:AxisAlignedBoundingBox,plane:Plane):Intersect
Determines which side of a plane a box is located.
参数
box
AxisAlignedBoundingBox
The bounding box to test.
plane
The plane to test against.
返回
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.
intersectAxisAlignedBoundingBox()
staticintersectAxisAlignedBoundingBox(box:AxisAlignedBoundingBox,other:AxisAlignedBoundingBox):boolean
Determines whether two axis aligned bounding boxes intersect.
参数
box
AxisAlignedBoundingBox
first box
other
AxisAlignedBoundingBox
second box
返回
boolean
true if the boxes intersect; otherwise, false.
clone()
clone(
result?:AxisAlignedBoundingBox):AxisAlignedBoundingBox
Duplicates this AxisAlignedBoundingBox instance.
参数
result?
AxisAlignedBoundingBox
The object onto which to store the result.
返回
AxisAlignedBoundingBox
The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
intersectPlane()
Determines which side of a plane this box is located.
参数
plane
The plane to test against.
返回
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.
intersectAxisAlignedBoundingBox()
intersectAxisAlignedBoundingBox(
other:AxisAlignedBoundingBox):boolean
Determines whether some other axis aligned bounding box intersects this box.
参数
other
AxisAlignedBoundingBox
The other axis aligned bounding box.
返回
boolean
true if the boxes intersect; otherwise, false.
equals()
equals(
right?:AxisAlignedBoundingBox):boolean
Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns <code>true</code> if they are equal, <code>false</code> otherwise.
参数
right?
AxisAlignedBoundingBox
The right hand side AxisAlignedBoundingBox.
返回
boolean
true if they are equal, false otherwise.
构造函数
构造函数
new AxisAlignedBoundingBox(
minimum?:Cartesian3,maximum?:Cartesian3,center?:Cartesian3):AxisAlignedBoundingBox
参数
minimum?
maximum?
center?
返回
AxisAlignedBoundingBox
