| Package | org.flintparticles.threeD.zones |
| Class | public class FrustrumZone |
| Inheritance | FrustrumZone Object |
| Implements | Zone3D |
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.
| Property | Defined 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 | ||
| Method | Defined 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 | ||
| camera | property |
camera:CameraThe flint camera whose frustrum should be used.
public function get camera():Camera public function set camera(value:Camera):void| viewRect | property |
viewRect:RectangleThe 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.
public function get viewRect():Rectangle public function set viewRect(value:Rectangle):void| FrustrumZone | () | Constructor |
public function FrustrumZone(camera:Camera = null, viewRect:Rectangle = null)The constructor creates a FrustrumZone zone.
Parameterscamera: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.
|
| contains | () | method |
public function contains(p:Vector3D):BooleanThe 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.
|
Boolean — true if point is inside the zone, false if it is outside.
|
| getLocation | () | method |
public function getLocation():Vector3DThe 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.
ReturnsVector3D — a random point inside the zone.
|
| getVolume | () | method |
public function getVolume():NumberThe 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.
ReturnsNumber — the volume of the box.
|