Packageorg.ffilmation.helpful.generators
Classpublic class fScatterGenerator
InheritancefScatterGenerator Inheritance flash.events.EventDispatcher
ImplementsfEngineGenerator

The scatter generator is used to randomly fill an area with objects. You specify the area to cover and a list of candidate object definitions. Elements from these definitions are randomly selected and placed along the surface.


Example
Here's an example of using this generator in a scene definition XML
     <generator>
      
      <classname>org.ffilmation.engine.generators.fScatterGenerator</classname>
      
      <data amount="50" minDistance="200" randomizeOrientation="true" noise="Ground_noise_1">
      
       <!-- Area covered by the objects -->
       <area>
        <origin x="0" y="0" z="0"/>
        <end x="4000" y="4000" z="0"/>
       </area>
       
       <!-- A Weighed list of candidates, so you can define which types appear more -->
       <candidate definition="FFTrees_misc_tree5" weight="3"/>
       <candidate definition="FFTrees_misc_tree8" weight="1"/>
      
      </data>
      
     </generator>
      

amount: Number of elements to be scattered
minDistance: Elements won't be closer than this distance
randomizeOrientation: If true elements will be given random orientation, else all will be 0
noise: If there's a perlin Noise definition that matches this name, only areas covered with that noise will be used to scatter elements



Public Methods
 MethodDefined by
  
generate(id:Number, scene:fScene, data:XMLList):EventDispatcher
fScatterGenerator
  
getPercent():Number
fScatterGenerator
  
getXML():XMLList
fScatterGenerator
Method detail
generate()method
public function generate(id:Number, scene:fScene, data:XMLList):EventDispatcher

Parameters
id:Number
 
scene:fScene
 
data:XMLList

Returns
EventDispatcher

See also

getPercent()method 
public function getPercent():Number

Returns
Number

See also

getXML()method 
public function getXML():XMLList

Returns
XMLList

See also