Packagesandy.view
Classpublic class Frustum

Used to create the frustum of the camera.

The frustum is volume used to control if geometrical object, such as a box, a sphere, or a point can be seen by the camera, and thus should be rendered.

Clipping of objects and polygons is performed against the frustum surfaces, as well as the near and far planes.



Public Properties
 PropertyDefined by
  aConstants : Array
Frustum
  aNormals : Array
Frustum
  aPlanes : Array
Frustum
  aPoints : Array
Frustum
Public Methods
 MethodDefined by
  
Creates a frustum for the camera.
Frustum
  
Returns the culling state for the passed bounding box.
Frustum
  
clipFrontPlane(p_aCvert:Array, p_aUVCoords:Array):void
Clip the given vertex and UVCoords arrays against the frustum front plane
Frustum
  
clipFrustum(p_aCvert:Array, p_aUVCoords:Array):void
Clips a polygon against the frustum planes
Frustum
  
clipLineFrontPlane(p_aCvert:Array):void
Clip the given vertex and UVCoords arrays against the frustum front plane
Frustum
  
clipPolygon(p_oPlane:Plane, p_aCvert:Array, p_aUVCoords:Array):void
Clips a polygon against one the frustum planes
Frustum
  
computePlanes(p_nAspect:Number, p_nNear:Number, p_nFar:Number, p_nFov:Number):void
Computes the frustum planes.
Frustum
  
extractPlanes(comboMatrix:Matrix4, normalize:Boolean):void
Extracts the clipping planes.
Frustum
  
Returns the culling state for the passed point.
Frustum
  
Returns the culling state for the passed bounding sphere.
Frustum
Public Constants
 ConstantDefined by
  BOTTOM : uint = 5
[static]
Frustum
  EPSILON : Number = 0.005
[static]
Frustum
  FAR : uint = 1
[static]
Frustum
  INSIDE : CullingState
[static]
Frustum
  INTERSECT : CullingState
[static]
Frustum
  LEFT : uint = 3
[static]
Frustum
  NEAR : uint = 0
[static]
Frustum
  OUTSIDE : CullingState
[static]
Frustum
  RIGHT : uint = 2
[static]
Frustum
  TOP : uint = 4
[static]
Frustum
Property detail
aConstantsproperty
public var aConstants:Array
aNormalsproperty 
public var aNormals:Array
aPlanesproperty 
public var aPlanes:Array
aPointsproperty 
public var aPoints:Array
Constructor detail
Frustum()constructor
public function Frustum()

Creates a frustum for the camera.

This constructor only creates the necessay data structures

Method detail
boxInFrustum()method
public function boxInFrustum(box:BBox):CullingState

Returns the culling state for the passed bounding box.

The method tests if the bounding box is within the frustum volume or not.
The returned culling state is Frustum.INSIDE, Frustum.OUTSIDE or Frustum.INTERSECT

Parameters
box:BBox — The box to test

Returns
CullingState
clipFrontPlane()method 
public function clipFrontPlane(p_aCvert:Array, p_aUVCoords:Array):void

Clip the given vertex and UVCoords arrays against the frustum front plane

Parameters
p_aCvert:Array
 
p_aUVCoords:Array
clipFrustum()method 
public function clipFrustum(p_aCvert:Array, p_aUVCoords:Array):void

Clips a polygon against the frustum planes

Parameters
p_aCvert:Array — Vertices of the polygon
 
p_aUVCoords:Array — UV coordiantes of the polygon
clipLineFrontPlane()method 
public function clipLineFrontPlane(p_aCvert:Array):void

Clip the given vertex and UVCoords arrays against the frustum front plane

Parameters
p_aCvert:Array
clipPolygon()method 
public function clipPolygon(p_oPlane:Plane, p_aCvert:Array, p_aUVCoords:Array):void

Clips a polygon against one the frustum planes

Parameters
p_oPlane:Plane — The plane to clip against
 
p_aCvert:Array — Vertices of the polygon
 
p_aUVCoords:Array — UV coordiantes of the polygon
computePlanes()method 
public function computePlanes(p_nAspect:Number, p_nNear:Number, p_nFar:Number, p_nFov:Number):void

Computes the frustum planes.

Parameters
p_nAspect:Number — Aspect ration of the camera
 
p_nNear:Number — The distance from the camera to the near clipping plane
 
p_nFar:Number — The distance from the camera to the far clipping plane
 
p_nFov:Number — Vertical field of view of the camera
extractPlanes()method 
public function extractPlanes(comboMatrix:Matrix4, normalize:Boolean):void

Extracts the clipping planes.

[ToDo: Expalain this ]

Parameters
comboMatrix:Matrix4
 
normalize:Boolean
pointInFrustum()method 
public function pointInFrustum(p_oPoint:Vector):CullingState

Returns the culling state for the passed point.

The method tests if the passed point is within the frustum volume or not.
The returned culling state is Frustum.INSIDE or Frustum.OUTSIDE

Parameters
p_oPoint:Vector — The point to test

Returns
CullingState
sphereInFrustum()method 
public function sphereInFrustum(p_oS:BSphere):CullingState

Returns the culling state for the passed bounding sphere.

The method tests if the bounding sphere is within the frustum volume or not.
The returned culling state is Frustum.INSIDE, Frustum.OUTSIDE or Frustum.INTERSECT

Parameters
p_oS:BSphere — The sphere to test

Returns
CullingState
Constant detail
BOTTOMconstant
public static const BOTTOM:uint = 5
EPSILONconstant 
public static const EPSILON:Number = 0.005
FARconstant 
public static const FAR:uint = 1
INSIDEconstant 
public static const INSIDE:CullingState
INTERSECTconstant 
public static const INTERSECT:CullingState
LEFTconstant 
public static const LEFT:uint = 3
NEARconstant 
public static const NEAR:uint = 0
OUTSIDEconstant 
public static const OUTSIDE:CullingState
RIGHTconstant 
public static const RIGHT:uint = 2
TOPconstant 
public static const TOP:uint = 4