NASA World Wind

gov.nasa.worldwind.geom
Class ViewFrustum

java.lang.Object
  extended by gov.nasa.worldwind.geom.ViewFrustum

public class ViewFrustum
extends Object


Constructor Summary
ViewFrustum(Angle fieldOfView, 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.
ViewFrustum(double near, double far, double left, double right, double bottom, double top)
          Creates a Frustum from three sets of parallel clipping planes (a parallel projection).
ViewFrustum(Matrix4 projectionMatrix)
           
 
Method Summary
 Frustum getFrustum()
           
 Matrix4 getProjectionMatrix()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewFrustum

public ViewFrustum(Angle fieldOfView,
                   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. The near plane must be closer than the far plane, and both planes must be a positive distance away.

Parameters:
fieldOfView - horizontal field-of-view angle in the range (0, 180)
viewportWidth - the width of the viewport in screen pixels
viewportHeight - the height of the viewport in screen pixels
near - distance to the near depth clipping plane
far - distance to far depth clipping plane
Throws:
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 far

ViewFrustum

public ViewFrustum(double near,
                   double far,
                   double left,
                   double right,
                   double bottom,
                   double top)
Creates a Frustum from three sets of parallel clipping planes (a parallel projection). In this case, the near and far depth clipping planes may be a negative distance away.

Parameters:
left - distance to the left vertical clipping plane
right - distance to the right vertical clipping plane
bottom - distance to the bottom horizontal clipping plane
top - distance to the top horizontal clipping plane
near - distance to the near depth clipping plane
far - distance to far depth clipping plane
Throws:
IllegalArgumentException - if the difference of any plane set (lright - left, top - bottom, far - near) is less than or equal to zero.

ViewFrustum

public ViewFrustum(Matrix4 projectionMatrix)
Method Detail

getFrustum

public final Frustum getFrustum()

getProjectionMatrix

public final Matrix4 getProjectionMatrix()

NASA World Wind