Packageorg.flintparticles.threeD.zones
Classpublic class FrustrumZone
InheritanceFrustrumZone Inheritance Object
Implements Zone3D

The FrustrumZone zone defines a zone in the shape of a camera frustrum. The frustrum is the area of space visible using the camera. Everything in the camera's field of view is inside the frustrum and everything outside the camera's field of view is outside the frustrum.

When using this zone, it is possible to adjust the view rect used when calculating the frustrum so that the frustrum is slightly larger (or smaller) than the camera's actual view frustrum.



Public Properties
 PropertyDefined By
  camera : Camera
The flint camera whose frustrum should be used.
FrustrumZone
  viewRect : Rectangle
The rectangle describing the size and position of the viewing window.
FrustrumZone
Public Methods
 MethodDefined By
  
FrustrumZone(camera:Camera = null, viewRect:Rectangle = null)
The constructor creates a FrustrumZone zone.
FrustrumZone
  
contains(p:Vector3D):Boolean
The contains method determines whether a point is inside the box.
FrustrumZone
  
getLocation():Vector3D
The getLocation method returns a random point inside the box.
FrustrumZone
  
getVolume():Number
The getArea method returns the volume of the box.
FrustrumZone
Property Detail
cameraproperty
camera:Camera

The flint camera whose frustrum should be used.


Implementation
    public function get camera():Camera
    public function set camera(value:Camera):void
viewRectproperty 
viewRect:Rectangle

The rectangle describing the size and position of the viewing window. The camera points at position 0,0 in this rectangle, so a normal frustrum would have the form new Rectangle( -w/2, -h/2, w, h ). If using a BitmapRenderer, you could use the renderer's canvas as the viewRect, but you may want a slightly larger rectangle if this zone is used for removing particles via a DeathZone action to allow for the size of the particles.


Implementation
    public function get viewRect():Rectangle
    public function set viewRect(value:Rectangle):void
Constructor Detail
FrustrumZone()Constructor
public function FrustrumZone(camera:Camera = null, viewRect:Rectangle = null)

The constructor creates a FrustrumZone zone.

Parameters
camera:Camera (default = null) — The flint camera whose frustrum should be used.
 
viewRect:Rectangle (default = null) — The rectangle describing the size and position of the viewing window. The camera points at position 0,0 in this rectangle, so a normal frustrum would have the form new Rectangle( -w/2, -h/2, w, h ). If using a BitmapRenderer, you could use the renderer's canvas as the viewRect, but you may want a slightly larger rectangle if this zone is used for removing particles via a DeathZone action.
Method Detail
contains()method
public function contains(p:Vector3D):Boolean

The contains method determines whether a point is inside the box. This method is used by the initializers and actions that use the zone. Usually, it need not be called directly by the user.

Parameters

p:Vector3D — The x coordinate of the location to test for.

Returns
Boolean — true if point is inside the zone, false if it is outside.
getLocation()method 
public function getLocation():Vector3D

The getLocation method returns a random point inside the box. This method is used by the initializers and actions that use the zone. Usually, it need not be called directly by the user.

Returns
Vector3D — a random point inside the zone.
getVolume()method 
public function getVolume():Number

The getArea method returns the volume of the box. This method is used by the MultiZone class. Usually, it need not be called directly by the user.

Returns
Number — the volume of the box.