pythagoras.f

## Interface IBox

• All Known Implementing Classes:
Box

`public interface IBox`
Does something extraordinary.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`Box` `add(IBox other)`
Expands this box to include the bounds of another box.
`Box` ```add(IBox other, Box result)```
Expands this box to include the bounds of another box, placing the result in the object provided.
`Box` `add(IVector3 point)`
Expands this box to include the specified point.
`Box` ```add(IVector3 point, Box result)```
Expands this box to include the specified point, placing the result in the object provided.
`Vector3` `center()`
Returns the center of the box as a new vector.
`Vector3` `center(Vector3 result)`
Places the location of the center of the box into the given result vector.
`boolean` ```contains(float x, float y, float z)```
Determines whether this box contains the specified point.
`boolean` `contains(IBox other)`
Determines whether this box completely contains the specified box.
`boolean` `contains(IVector3 point)`
Determines whether this box contains the specified point.
`float` `diagonalLength()`
Returns the length of the box's diagonal (the distance from minimum to maximum extent).
`Box` ```expand(float x, float y, float z)```
Expands the box by the specified amounts.
`Box` ```expand(float x, float y, float z, Box result)```
Expands the box by the specified amounts, placing the result in the object provided.
`float` `extentDistance(IBox other)`
Returns the sum of the Manhattan distances between the extents of this box and the specified other box.
`Box` `intersect(IBox other)`
Finds the intersection between this box and another box.
`Box` ```intersect(IBox other, Box result)```
Finds the intersection between this box and another box and places the result in the provided object.
`boolean` ```intersection(IRay3 ray, Vector3 result)```
Finds the location of the (first) intersection between the specified ray and this box.
`boolean` `intersects(IBox other)`
Determines whether this box intersects the specified other box.
`boolean` `intersects(IRay3 ray)`
Determines whether the specified ray intersects this box.
`boolean` `isEmpty()`
Determines whether the box is empty (whether any of its minima are greater than their corresponding maxima).
`float` `longestEdge()`
Returns the length of the box's longest edge.
`IVector3` `maximumExtent()`
Returns a reference to the box's maximum extent.
`IVector3` `minimumExtent()`
Returns a reference to the box's minimum extent.
`Box` `project(IMatrix4 matrix)`
Projects this box.
`Box` ```project(IMatrix4 matrix, Box result)```
Projects this box, placing the result in the object provided.
`Vector3` ```vertex(int code, Vector3 result)```
Retrieves one of the eight vertices of the box.
• ### Method Detail

• #### minimumExtent

`IVector3 minimumExtent()`
Returns a reference to the box's minimum extent.
• #### maximumExtent

`IVector3 maximumExtent()`
Returns a reference to the box's maximum extent.
• #### center

`Vector3 center()`
Returns the center of the box as a new vector.
• #### center

`Vector3 center(Vector3 result)`
Places the location of the center of the box into the given result vector.
Returns:
a reference to the result vector, for chaining.
• #### diagonalLength

`float diagonalLength()`
Returns the length of the box's diagonal (the distance from minimum to maximum extent).
• #### longestEdge

`float longestEdge()`
Returns the length of the box's longest edge.
• #### isEmpty

`boolean isEmpty()`
Determines whether the box is empty (whether any of its minima are greater than their corresponding maxima).
• #### vertex

```Vector3 vertex(int code,
Vector3 result)```
Retrieves one of the eight vertices of the box. The code parameter identifies the vertex with flags indicating which values should be selected from the minimum extent, and which from the maximum extent. For example, the code 011b selects the vertex with the minimum x, maximum y, and maximum z.
Returns:
a reference to the result, for chaining.
• #### contains

`boolean contains(IVector3 point)`
Determines whether this box contains the specified point.
• #### contains

```boolean contains(float x,
float y,
float z)```
Determines whether this box contains the specified point.
• #### extentDistance

`float extentDistance(IBox other)`
Returns the sum of the Manhattan distances between the extents of this box and the specified other box.
• #### contains

`boolean contains(IBox other)`
Determines whether this box completely contains the specified box.
• #### intersects

`boolean intersects(IBox other)`
Determines whether this box intersects the specified other box.

`Box add(IVector3 point)`
Expands this box to include the specified point.
Returns:
a new box containing the result.

```Box add(IVector3 point,
Box result)```
Expands this box to include the specified point, placing the result in the object provided.
Returns:
a reference to the result box, for chaining.

`Box add(IBox other)`
Expands this box to include the bounds of another box.
Returns:
a new box containing the result.

```Box add(IBox other,
Box result)```
Expands this box to include the bounds of another box, placing the result in the object provided.
Returns:
a reference to the result box, for chaining.
• #### intersect

`Box intersect(IBox other)`
Finds the intersection between this box and another box.
Returns:
a new box containing the result.
• #### intersect

```Box intersect(IBox other,
Box result)```
Finds the intersection between this box and another box and places the result in the provided object.
Returns:
a reference to this box, for chaining.
• #### project

`Box project(IMatrix4 matrix)`
Projects this box.
Returns:
a new box containing the result.
• #### project

```Box project(IMatrix4 matrix,
Box result)```
Projects this box, placing the result in the object provided.
Returns:
a reference to the result, for chaining.
• #### expand

```Box expand(float x,
float y,
float z)```
Expands the box by the specified amounts.
Returns:
a new box containing the result.
• #### expand

```Box expand(float x,
float y,
float z,
Box result)```
Expands the box by the specified amounts, placing the result in the object provided.
Returns:
a reference to the result box, for chaining.
• #### intersects

`boolean intersects(IRay3 ray)`
Determines whether the specified ray intersects this box.
• #### intersection

```boolean intersection(IRay3 ray,
Vector3 result)```
Finds the location of the (first) intersection between the specified ray and this box. This will be the ray origin if the ray starts inside the box.
Parameters:
`result` - a vector to hold the location of the intersection.
Returns:
true if the ray intersects the box (in which case the result vector will be populated with the location of the intersection), false if not.