|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.worldwind.geom.Frustum
public class Frustum
Instances of Frustum
are immutable.
Constructor Summary | |
---|---|
Frustum()
Create a default frustum with six Plane s. |
|
Frustum(Plane left,
Plane right,
Plane bottom,
Plane top,
Plane near,
Plane far)
Create a frustum from six Plane s, which define its boundaries. |
Method Summary | |
---|---|
boolean |
contains(Vec4 point)
|
boolean |
equals(java.lang.Object obj)
|
static Frustum |
fromPerspective(Angle horizontalFieldOfView,
int viewportWidth,
int viewportHeight,
double near,
double far)
Creates a Frustum from a horizontal field-of-view, viewport aspect ratio and distance to near and
far depth clipping planes. |
static Frustum |
fromPerspective(double width,
double height,
double near,
double far)
Creates a Frustum from three sets of parallel clipping planes (a parallel projectionMatrix). |
static Frustum |
fromProjectionMatrix(Matrix projectionMatrix)
|
Plane[] |
getAllPlanes()
|
Plane |
getBottom()
|
Plane |
getFar()
|
Plane |
getLeft()
|
Plane |
getNear()
|
Plane |
getRight()
|
Plane |
getTop()
|
int |
hashCode()
|
boolean |
intersects(Extent extent)
|
java.lang.String |
toString()
|
Frustum |
transformBy(Matrix matrix)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Frustum()
Plane
s. This defines a box of dimension (2, 2, 2) centered at the
origin.
public Frustum(Plane left, Plane right, Plane bottom, Plane top, Plane near, Plane far)
Plane
s, which define its boundaries. Does not except null arguments.
near
- the near planefar
- the far planeleft
- the left side of the view frustumright
- the right side of the view frustmtop
- the top of the view frustumbottom
- the bottom of the view frustum
java.lang.IllegalArgumentException
- if any argument is nullMethod Detail |
---|
public final boolean contains(Vec4 point)
point
-
java.lang.IllegalArgumentException
- if point
is nullpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static Frustum fromPerspective(Angle horizontalFieldOfView, int viewportWidth, int viewportHeight, double near, double far)
Frustum
from a horizontal field-of-view, viewport aspect ratio and distance to near and
far depth clipping planes. The near plane must be closer than the far plane, and both planes must be a positive
distance away.
horizontalFieldOfView
- horizontal field-of-view angle in the range (0, 180)viewportWidth
- the width of the viewport in screen pixelsviewportHeight
- the height of the viewport in screen pixelsnear
- distance to the near depth clipping planefar
- distance to far depth clipping plane
java.lang.IllegalArgumentException
- if fov is not in the range (0, 180), if either near or far are negative, or near
is greater than or equal to farpublic static Frustum fromPerspective(double width, double height, double near, double far)
Frustum
from three sets of parallel clipping planes (a parallel projectionMatrix). In this
case, the near and far depth clipping planes may be a negative distance away.
near
- distance to the near depth clipping planefar
- distance to far depth clipping planewidth
- horizontal dimension of the near clipping planeheight
- vertical dimension of the near clipping plane
java.lang.IllegalArgumentException
- if the difference of any plane set (lright - left, top - bottom, far - near) is
less than or equal to zero.public static Frustum fromProjectionMatrix(Matrix projectionMatrix)
public Plane[] getAllPlanes()
public final Plane getBottom()
public final Plane getFar()
public final Plane getLeft()
public final Plane getNear()
public final Plane getRight()
public final Plane getTop()
public int hashCode()
hashCode
in class java.lang.Object
public final boolean intersects(Extent extent)
extent
-
java.lang.IllegalArgumentException
- if extent
is nullpublic java.lang.String toString()
toString
in class java.lang.Object
public Frustum transformBy(Matrix matrix)
matrix
-
java.lang.IllegalArgumentException
- if matrix
is null
|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |