espresso3d.engine.viewport.frustum
Class E3DViewFrustum2D

java.lang.Object
  extended byespresso3d.engine.base.E3DEngineItem
      extended byespresso3d.engine.viewport.frustum.E3DViewFrustum2D

public class E3DViewFrustum2D
extends E3DEngineItem

Author:
Curt This is a viewing frustum that will perform 2D frustum checks (Unproject 3D coordinates to 2D and check within bounds of that) This normally is not used by the user (its used by the engine), but provided in case it is found to be useful.

Constructor Summary
E3DViewFrustum2D(E3DEngine engine, E3DViewport viewport, E3DVector3F minMin, E3DVector3F minMax, E3DVector3F maxMax, E3DVector3F maxMin)
           
 
Method Summary
 E3DVector3F get2DLineIntersectionPt(E3DVector3F ptA, E3DVector3F ptB, E3DVector3F ptC, E3DVector3F ptD)
          Get the intersection pt of two 2d lines made of A->B and C->D.
 E3DVector3F getA()
          Get corner A projected into 2D space of the frustum
 E3DVector3F getB()
          Get corner B projected into 2D space of the frustum
 E3DVector3F getC()
          Get corner C projected into 2D space of the frustum
 E3DVector3F getD()
          Get corner C projected into 2D space of the frustum
 E3DViewport getViewport()
           
 boolean isPortalInFrustum(E3DPortal portal)
          Check if a Portal is in view of the frustum.
 boolean projectedPointInFrustum(E3DVector3F point)
          See if a projected point lies within the frustum
 void setA(E3DVector3F a)
          Set corner A of the frustum .
 void setB(E3DVector3F b)
          Set corner B of the frustum .
 void setC(E3DVector3F c)
          Set corner C of the frustum .
 void setD(E3DVector3F d)
          Set corner D of the frustum .
 
Methods inherited from class espresso3d.engine.base.E3DEngineItem
getEngine, setEngine
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

E3DViewFrustum2D

public E3DViewFrustum2D(E3DEngine engine,
                        E3DViewport viewport,
                        E3DVector3F minMin,
                        E3DVector3F minMax,
                        E3DVector3F maxMax,
                        E3DVector3F maxMin)
Method Detail

isPortalInFrustum

public boolean isPortalInFrustum(E3DPortal portal)
Check if a Portal is in view of the frustum.

Returns:
Returns true if the portal is visible by this frustum

get2DLineIntersectionPt

public E3DVector3F get2DLineIntersectionPt(E3DVector3F ptA,
                                           E3DVector3F ptB,
                                           E3DVector3F ptC,
                                           E3DVector3F ptD)
Get the intersection pt of two 2d lines made of A->B and C->D. TODO: This is a misplaced method, but its only used currently by this frustum.

Parameters:
ptA - First point of segment1
ptB - Second point of segment1
ptC - First point of segment2
ptD - Second point of segment2
Returns:

projectedPointInFrustum

public boolean projectedPointInFrustum(E3DVector3F point)
See if a projected point lies within the frustum

Parameters:
point -
Returns:

getA

public E3DVector3F getA()
Get corner A projected into 2D space of the frustum

Returns:

setA

public void setA(E3DVector3F a)
Set corner A of the frustum . This must be projected before setting!

Parameters:
a -

getB

public E3DVector3F getB()
Get corner B projected into 2D space of the frustum

Returns:

setB

public void setB(E3DVector3F b)
Set corner B of the frustum . This must be projected before setting!


getC

public E3DVector3F getC()
Get corner C projected into 2D space of the frustum

Returns:

setC

public void setC(E3DVector3F c)
Set corner C of the frustum . This must be projected before setting!


getD

public E3DVector3F getD()
Get corner C projected into 2D space of the frustum

Returns:

setD

public void setD(E3DVector3F d)
Set corner D of the frustum . This must be projected before setting!


getViewport

public E3DViewport getViewport()