Packageaway3d.materials.utils
Classpublic class LightPrebaker
InheritanceLightPrebaker Inheritance flash.events.EventDispatcher



Public Properties
 PropertyDefined By
  renderdata : Array
[read-only] getter that returns an array of all generated BitmapData objects
LightPrebaker
Public Methods
 MethodDefined By
  
LightPrebaker(object3d:Object3D, lights:Array, sceneambient:Number = .5, rayTrace:Boolean = false, maxW:int = 1, maxH:int = 1, blur:int = 0)
Class LightPrebaker traces and merge light information into a (series) Mesh object BitmapMaterials.
LightPrebaker
  
addOnTraceComplete(listener:Function):void
Default method for adding a tracecomplete event listener
LightPrebaker
  
addOnTraceCount(listener:Function):void
Default method for adding a tracecount event listener
LightPrebaker
  
addOnTraceProgress(listener:Function):void
Default method for adding a traceprogress event listener
LightPrebaker
  
apply(aRender:Array = null):void
Starts the trace
LightPrebaker
  
cancel():void
Clears the array of BitmapData objects of the memory
LightPrebaker
  
Clears the array of BitmapData objects of the memory
LightPrebaker
  
getBitmaps():Array
getter that returns an array of all generated BitmapData objects in RenderData type.
LightPrebaker
  
removeOnTraceComplete(listener:Function):void
Default method for removing a tracecomplete event listener
LightPrebaker
  
removeOnTraceCount(listener:Function):void
Default method for removing a tracecount event listener
LightPrebaker
  
removeOnTraceProgress(listener:Function):void
Default method for removing a traceprogress event listener
LightPrebaker
Events
 Event Summary Defined By
  Dispatched while the class is busy tracing.LightPrebaker
  Dispatched each time one bitmapdata is traced if more than one.LightPrebaker
  Dispatched when trace is done.LightPrebaker
Property Detail
renderdataproperty
renderdata:Array  [read-only]

getter that returns an array of all generated BitmapData objects


Implementation
    public function get renderdata():Array
Constructor Detail
LightPrebaker()Constructor
public function LightPrebaker(object3d:Object3D, lights:Array, sceneambient:Number = .5, rayTrace:Boolean = false, maxW:int = 1, maxH:int = 1, blur:int = 0)

Class LightPrebaker traces and merge light information into a (series) Mesh object BitmapMaterials. If no material or of another type is found on a Mesh object, a default bitmapMaterial is generated and applied to it.

Parameters
object3d:Object3D — Object3D. The Mesh(es) materials to draw.
 
lights:Array — Array of PointLight3D objects. Support at this time of development just lights of type PointLight3D;
 
sceneambient:Number (default = .5) — [optional] Number. A number from 0 to 1. Defines the ambient value for the class. Light ambient values are not used. Default = .5.
 
rayTrace:Boolean (default = false) — [optional] Boolean. Set to true, the pre-baking is traced using raytrace algorythm. Note that a much greater time will be required to render. Default = false;
 
maxW:int (default = 1) — [optional] int. Defines the max width a map can have, to avoid too long render times. Default is 1, no width limit.
 
maxH:int (default = 1) — [optional] int. Defines the max height a map can have, to avoid too long render times. Default is 1, no height limit.
 
blur:int (default = 0) — [optional] int. Defines the amount of blur applied to the bitmaps after rendering. Default is 0, no blur is applied.
####INIT####
Method Detail
addOnTraceComplete()method
public function addOnTraceComplete(listener:Function):void

Default method for adding a tracecomplete event listener

Parameters

listener:Function — The listener function

addOnTraceCount()method 
public function addOnTraceCount(listener:Function):void

Default method for adding a tracecount event listener

Parameters

listener:Function — The listener function

addOnTraceProgress()method 
public function addOnTraceProgress(listener:Function):void

Default method for adding a traceprogress event listener

Parameters

listener:Function — The listener function

apply()method 
public function apply(aRender:Array = null):void

Starts the trace

Parameters

aRender:Array (default = null) — [optional] Array. A series of 0 and 1. defines if a mesh material needs to be rendered. This optional parameter is usefull for application where you would want to update only certain renderings instead of retrace everything. Length and order must be similar to Object3D structure.

cancel()method 
public function cancel():void

Clears the array of BitmapData objects of the memory

clearBitmaps()method 
public function clearBitmaps():void

Clears the array of BitmapData objects of the memory

getBitmaps()method 
public function getBitmaps():Array

getter that returns an array of all generated BitmapData objects in RenderData type.

Returns
Array — Array An array holding all generated BitmapData objects in order of generation.
removeOnTraceComplete()method 
public function removeOnTraceComplete(listener:Function):void

Default method for removing a tracecomplete event listener

Parameters

listener:Function — The listener function

removeOnTraceCount()method 
public function removeOnTraceCount(listener:Function):void

Default method for removing a tracecount event listener

Parameters

listener:Function — The listener function

removeOnTraceProgress()method 
public function removeOnTraceProgress(listener:Function):void

Default method for removing a traceprogress event listener

Parameters

listener:Function — The listener function

Event Detail
tracecomplete Event
Event Object Type: away3d.events.TraceEvent
TraceEvent.type property = away3d.events.TraceEvent

Dispatched while the class is busy tracing. Note that the source can already be used for a Material

tracecount Event  
Event Object Type: away3d.events.TraceEvent
TraceEvent.type property = away3d.events.TraceEvent

Dispatched each time one bitmapdata is traced if more than one.

traceprogress Event  
Event Object Type: away3d.events.TraceEvent
TraceEvent.type property = away3d.events.TraceEvent

Dispatched when trace is done.