Packageorg.flintparticles.threeD.zones
Classpublic class GreyscaleZone
InheritanceGreyscaleZone Inheritance Object
Implements Zone3D

The Greyscale zone defines a shaped zone based on a BitmapData object. The zone contains all pixels in the bitmap that are not black, with a weighting such that lighter pixels are more likely to be selected than darker pixels when creating particles inside the zone.



Public Properties
 PropertyDefined By
  bitmapData : BitmapData
The bitmapData object that defines the zone.
GreyscaleZone
  corner : Vector3D
The position for the top left corner of the bitmap data for the zone.
GreyscaleZone
  left : Vector3D
The left side of the zone from the corner.
GreyscaleZone
  top : Vector3D
The top side of the zone from the corner.
GreyscaleZone
Public Methods
 MethodDefined By
  
GreyscaleZone(bitmapData:BitmapData = null, corner:Vector3D = null, top:Vector3D = null, left:Vector3D = null)
The constructor creates a Greyscale zone.
GreyscaleZone
  
contains(p:Vector3D):Boolean
The contains method determines whether a point is inside the zone.
GreyscaleZone
  
getLocation():Vector3D
The getLocation method returns a random point inside the zone.
GreyscaleZone
  
getVolume():Number
The getVolume method returns the size of the zone.
GreyscaleZone
  
invalidate():void
This method forces the zone to revaluate itself.
GreyscaleZone
Property Detail
bitmapDataproperty
bitmapData:BitmapData

The bitmapData object that defines the zone.


Implementation
    public function get bitmapData():BitmapData
    public function set bitmapData(value:BitmapData):void
cornerproperty 
corner:Vector3D

The position for the top left corner of the bitmap data for the zone.


Implementation
    public function get corner():Vector3D
    public function set corner(value:Vector3D):void
leftproperty 
left:Vector3D

The left side of the zone from the corner. The length of the vector indicates how long the side is.


Implementation
    public function get left():Vector3D
    public function set left(value:Vector3D):void
topproperty 
top:Vector3D

The top side of the zone from the corner. The length of the vector indicates how long the side is.


Implementation
    public function get top():Vector3D
    public function set top(value:Vector3D):void
Constructor Detail
GreyscaleZone()Constructor
public function GreyscaleZone(bitmapData:BitmapData = null, corner:Vector3D = null, top:Vector3D = null, left:Vector3D = null)

The constructor creates a Greyscale zone. To avoid distorting the zone, the top and left vectors should be perpendicular and the same lengths as the width and height of the bitmap data object. Vectors that are not the same width and height as the bitmap data object will scale the zone and vectors that are not perpendicular will skew the zone.

Parameters
bitmapData:BitmapData (default = null) — The bitmapData object that defines the zone.
 
corner:Vector3D (default = null) — The position for the top left corner of the bitmap data for the zone.
 
top:Vector3D (default = null) — The top side of the zone from the corner. The length of the vector indicates how long the side is.
 
left:Vector3D (default = null) — The left side of the zone from the corner. The length of the vector indicates how long the side is.
Method Detail
contains()method
public function contains(p:Vector3D):Boolean

The contains method determines whether a point is inside the zone. 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 zone. 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 getVolume method returns the size of the zone. This method is used by the MultiZone class. Usually, it need not be called directly by the user.

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

This method forces the zone to revaluate itself. It should be called whenever the contents of the BitmapData object change. However, it is an intensive method and calling it frequently will likely slow your code down.