public class Frustum
extends java.lang.Object
Camera.frustum
.Modifier and Type | Field and Description |
---|---|
protected static Vector3[] |
clipSpacePlanePoints |
protected static float[] |
clipSpacePlanePointsArray |
Vector3[] |
planePoints
eight points making up the near and far clipping "rectangles".
|
protected float[] |
planePointsArray |
Plane[] |
planes
the six clipping planes, near, far, left, right, top, bottm
|
Constructor and Description |
---|
Frustum() |
Modifier and Type | Method and Description |
---|---|
boolean |
boundsInFrustum(BoundingBox bounds)
Returns whether the given
BoundingBox is in the frustum. |
boolean |
pointInFrustum(Vector3 point)
Returns whether the point is in the frustum.
|
boolean |
sphereInFrustum(Vector3 center,
float radius)
Returns whether the given sphere is in the frustum.
|
boolean |
sphereInFrustumWithoutNearFar(Vector3 center,
float radius)
Returns whether the given sphere is in the frustum not checking whether it is behind the near and far clipping plane.
|
void |
update(Matrix4 inverseProjectionView)
Updates the clipping plane's based on the given inverse combined projection and view matrix, e.g.
|
protected static final Vector3[] clipSpacePlanePoints
protected static final float[] clipSpacePlanePointsArray
public final Plane[] planes
public final Vector3[] planePoints
protected final float[] planePointsArray
public void update(Matrix4 inverseProjectionView)
OrthographicCamera
or PerspectiveCamera
.inverseProjectionView
- the combined projection and view matrices.public boolean pointInFrustum(Vector3 point)
point
- The pointpublic boolean sphereInFrustum(Vector3 center, float radius)
center
- The center of the sphereradius
- The radius of the spherepublic boolean sphereInFrustumWithoutNearFar(Vector3 center, float radius)
center
- The center of the sphereradius
- The radius of the spherepublic boolean boundsInFrustum(BoundingBox bounds)
BoundingBox
is in the frustum.bounds
- The bounding box