pythagoras.f

## Class Frustum

• ```public class Frustum
extends Object```
A pyramidal frustum.
• ### Nested Class Summary

Nested Classes
Modifier and Type Class and Description
`static class ` `Frustum.IntersectionType`
Intersection types indicating that the frustum does not intersect, intersects, or fully contains, respectively, the parameter.
• ### Constructor Summary

Constructors
Constructor and Description
`Frustum()`
Creates an empty (invalid) frustum.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`Box` `bounds()`
Returns a reference to the bounds of this frustum.
`Box` ```boundsUnderRotation(Matrix3 matrix, Box result)```
Computes the bounds of the frustum under the supplied rotation and places the results in the box provided.
`float` `distance(Vector3 point)`
Determines the maximum signed distance of the point from the planes of the frustum.
`Frustum.IntersectionType` `intersectionType(Box box)`
Checks whether the frustum intersects the specified box.
`Frustum` ```setToFrustum(float left, float right, float bottom, float top, float near, float far)```
Sets this frustum to one pointing in the Z- direction with the specified parameters determining its size and shape (see the OpenGL documentation for `glFrustum`).
`Frustum` ```setToOrtho(float left, float right, float bottom, float top, float near, float far)```
Sets this frustum to an orthographic one pointing in the Z- direction with the specified parameters determining its size (see the OpenGL documentation for `glOrtho`).
`Frustum` ```setToPerspective(float fovy, float aspect, float znear, float zfar)```
Sets this frustum to one pointing in the Z- direction with the specified parameters determining its size and shape (see the OpenGL documentation for `gluPerspective`).
`Frustum` ```setToProjection(float left, float right, float bottom, float top, float near, float far, IVector3 nearFarNormal, boolean ortho, boolean mirrored)```
Sets this frustum to a perspective or orthographic projection with the specified parameters determining its size and shape.
`IVector3[]` `vertices()`
Returns a reference to the frustum's array of vertices.
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### Frustum

`public Frustum()`
Creates an empty (invalid) frustum.
• ### Method Detail

• #### vertices

`public IVector3[] vertices()`
Returns a reference to the frustum's array of vertices.
• #### bounds

`public Box bounds()`
Returns a reference to the bounds of this frustum.
• #### setToPerspective

```public Frustum setToPerspective(float fovy,
float aspect,
float znear,
float zfar)```
Sets this frustum to one pointing in the Z- direction with the specified parameters determining its size and shape (see the OpenGL documentation for `gluPerspective`).
Parameters:
`fovy` - the vertical field of view, in radians.
`aspect` - the aspect ratio (width over height).
`znear` - the distance to the near clip plane.
`zfar` - the distance to the far clip plane.
Returns:
a reference to this frustum, for chaining.
• #### setToFrustum

```public Frustum setToFrustum(float left,
float right,
float bottom,
float top,
float near,
float far)```
Sets this frustum to one pointing in the Z- direction with the specified parameters determining its size and shape (see the OpenGL documentation for `glFrustum`).
Returns:
a reference to this frustum, for chaining.
• #### setToOrtho

```public Frustum setToOrtho(float left,
float right,
float bottom,
float top,
float near,
float far)```
Sets this frustum to an orthographic one pointing in the Z- direction with the specified parameters determining its size (see the OpenGL documentation for `glOrtho`).
Returns:
a reference to this frustum, for chaining.
• #### setToProjection

```public Frustum setToProjection(float left,
float right,
float bottom,
float top,
float near,
float far,
IVector3 nearFarNormal,
boolean ortho,
boolean mirrored)```
Sets this frustum to a perspective or orthographic projection with the specified parameters determining its size and shape.
Returns:
a reference to this frustum, for chaining.
• #### distance

`public float distance(Vector3 point)`
Determines the maximum signed distance of the point from the planes of the frustum. If the distance is less than or equal to zero, the point lies inside the frustum.
• #### intersectionType

`public Frustum.IntersectionType intersectionType(Box box)`
Checks whether the frustum intersects the specified box.
• #### boundsUnderRotation

```public Box boundsUnderRotation(Matrix3 matrix,
Box result)```
Computes the bounds of the frustum under the supplied rotation and places the results in the box provided.
Returns:
a reference to the result box, for chaining.