new AxisAlignedBoundingBox(minimumopt, maximumopt, centeropt)
Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
minimum |
Cartesian3 |
<optional> |
Cartesian3.ZERO | The minimum point along the x, y, and z axes. |
maximum |
Cartesian3 |
<optional> |
Cartesian3.ZERO | The maximum point along the x, y, and z axes. |
center |
Cartesian3 |
<optional> |
The center of the box; automatically computed if not supplied. |
- Source:
- See:
Members
center :Cartesian3
The center point of the bounding box.
Type:
- Source:
maximum :Cartesian3
The maximum point defining the bounding box.
Type:
- Default Value:
- Source:
minimum :Cartesian3
The minimum point defining the bounding box.
Type:
- Default Value:
- Source:
Methods
(static) clone(box, resultopt) → {AxisAlignedBoundingBox}
Duplicates a AxisAlignedBoundingBox instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
box |
AxisAlignedBoundingBox | The bounding box to duplicate. | |
result |
AxisAlignedBoundingBox |
<optional> |
The object onto which to store the result. |
- Source:
Returns:
The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
(static) equals(leftopt, rightopt) → {Boolean}
Compares the provided AxisAlignedBoundingBox componentwise and returns
true
if they are equal, false
otherwise.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
left |
AxisAlignedBoundingBox |
<optional> |
The first AxisAlignedBoundingBox. |
right |
AxisAlignedBoundingBox |
<optional> |
The second AxisAlignedBoundingBox. |
- Source:
Returns:
true
if left and right are equal, false
otherwise.
- Type
- Boolean
(static) fromPoints(positions, resultopt) → {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.
Parameters:
Name | Type | Attributes | 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. |
- Source:
Returns:
The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
Example
// Compute an axis aligned bounding box enclosing two points.
var box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
(static) intersectPlane(box, plane) → {Intersect}
Determines which side of a plane a box is located.
Parameters:
Name | Type | Description |
---|---|---|
box |
AxisAlignedBoundingBox | The bounding box to test. |
plane |
Plane | The plane to test against. |
- Source:
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.
- Type
- Intersect
clone(resultopt) → {AxisAlignedBoundingBox}
Duplicates this AxisAlignedBoundingBox instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
result |
AxisAlignedBoundingBox |
<optional> |
The object onto which to store the result. |
- Source:
Returns:
The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
equals(rightopt) → {Boolean}
Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns
true
if they are equal, false
otherwise.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
right |
AxisAlignedBoundingBox |
<optional> |
The right hand side AxisAlignedBoundingBox. |
- Source:
Returns:
true
if they are equal, false
otherwise.
- Type
- Boolean
intersectPlane(plane) → {Intersect}
Determines which side of a plane this box is located.
Parameters:
Name | Type | Description |
---|---|---|
plane |
Plane | The plane to test against. |
- Source:
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.
- Type
- Intersect