public class Frustum
extends java.lang.Object
Constructor and Description |
---|
Frustum()
Constructs a new unit frustum with each of its planes 1 meter from the center and a viewport with width and
height both 1.
|
Frustum(Plane left,
Plane right,
Plane bottom,
Plane top,
Plane near,
Plane far,
Viewport viewport)
Constructs a frustum.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsPoint(Vec3 point) |
boolean |
intersectsSegment(Vec3 pointA,
Vec3 pointB)
Determines whether a line segment intersects this frustum.
|
boolean |
intersectsViewport(Viewport viewport)
Determines whether a screen coordinate viewport intersects this frustum.
|
Frustum |
setToModelviewProjection(Matrix4 projection,
Matrix4 modelview,
Viewport viewport)
Sets this frustum to one appropriate for a modelview-projection matrix.
|
Frustum |
setToModelviewProjection(Matrix4 projection,
Matrix4 modelview,
Viewport viewport,
Viewport subViewport)
Sets this frustum to one appropriate for a subset of a modelview-projection matrix.
|
Frustum |
setToUnitFrustum()
Sets this frustum to a unit frustum with each of its planes 1 meter from the center a viewport with width and
height both 1.
|
public Frustum()
public Frustum(Plane left, Plane right, Plane bottom, Plane top, Plane near, Plane far, Viewport viewport)
left
- the frustum's left planeright
- the frustum's right planebottom
- the frustum's bottom planetop
- the frustum's top planenear
- the frustum's near planefar
- the frustum's far planeviewport
- the frustum's viewportjava.lang.IllegalArgumentException
- If any argument is nullpublic Frustum setToUnitFrustum()
public Frustum setToModelviewProjection(Matrix4 projection, Matrix4 modelview, Viewport viewport)
projection
- the projection matrix to extract the frustum frommodelview
- the modelview matrix defining the frustum's position and orientation in Cartesian coordinatesviewport
- the screen coordinate viewport corresponding to the projection matrixjava.lang.IllegalArgumentException
- If any argument is nullpublic Frustum setToModelviewProjection(Matrix4 projection, Matrix4 modelview, Viewport viewport, Viewport subViewport)
projection
- the projection matrix to extract the frustum frommodelview
- the modelview matrix defining the frustum's position and orientation in Cartesian coordinatesviewport
- the screen coordinate viewport corresponding to the projection matrixsubViewport
- the screen coordinate region the frustum should containjava.lang.IllegalArgumentException
- If any argument is nullpublic boolean containsPoint(Vec3 point)
public boolean intersectsSegment(Vec3 pointA, Vec3 pointB)
pointA
- the first line segment endpointpointB
- the second line segment endpointjava.lang.IllegalArgumentException
- If either point is nullpublic boolean intersectsViewport(Viewport viewport)
viewport
- the viewport to testjava.lang.IllegalArgumentException
- If the viewport is null