Packageaway3d.materials.utils
Classpublic class SimpleShadow
InheritanceSimpleShadow Inheritance Object

This class generates a top projection shadow from vertex information of a given Object3D, Most suitable for still objects. Can be updated at runtime but will offer very poor performance.



Public Properties
 PropertyDefined By
  base : Number
Defines the base for the projection.
SimpleShadow
  blur : int
Defines the amount of blur for the projection
SimpleShadow
  color : uint
return the color set for the shadow generation
SimpleShadow
  object : Object3D
[write-only] Defines the object3d that will be used for the projection Note that the update method is automaticaly called when set.
SimpleShadow
  plane : Plane
[read-only] return the plane where the shadow is set as Material
SimpleShadow
  range : Number
Defines the range for the projection, the greater, the more alpha.
SimpleShadow
  source : BitmapData
[read-only] return the generated shadow projection BitmapData;
SimpleShadow
Public Methods
 MethodDefined By
  
SimpleShadow(object3d:Object3D, color:uint = 0xFF666666, blur:Number = 4, base:Number, range:Number)
Creates a new SimpleShadow object.
SimpleShadow
  
apply(scene:Scene3D = null):BitmapData
generates the shadow projection
SimpleShadow
  
adjusts the shadow position to the model according to pivot of the object
SimpleShadow
  
update(color:Number):void
generates the shadow projection
SimpleShadow
Property Detail
baseproperty
base:Number

Defines the base for the projection. It defines the y position of the plane object By default the plane is located at the base of the object


Implementation
    public function get base():Number
    public function set base(value:Number):void
blurproperty 
blur:int

Defines the amount of blur for the projection


Implementation
    public function get blur():int
    public function set blur(value:int):void
colorproperty 
color:uint

return the color set for the shadow generation


Implementation
    public function get color():uint
    public function set color(value:uint):void
objectproperty 
object:Object3D  [write-only]

Defines the object3d that will be used for the projection Note that the update method is automaticaly called when set. The handler is only to be used if the previous class object3d was nulled.


Implementation
    public function set object(value:Object3D):void
planeproperty 
plane:Plane  [read-only]

return the plane where the shadow is set as Material


Implementation
    public function get plane():Plane
rangeproperty 
range:Number

Defines the range for the projection, the greater, the more alpha. when distance vertice to projection base is exceeded, no trace occurs.


Implementation
    public function get range():Number
    public function set range(value:Number):void
sourceproperty 
source:BitmapData  [read-only]

return the generated shadow projection BitmapData;


Implementation
    public function get source():BitmapData
Constructor Detail
SimpleShadow()Constructor
public function SimpleShadow(object3d:Object3D, color:uint = 0xFF666666, blur:Number = 4, base:Number, range:Number)

Creates a new SimpleShadow object. this class generate a projected shadow. Not suitable if shadows need to be updated at runtime in scenes with lots of polygons.

Parameters
object3d:Object3D — Object3D: The object3d that will generate the shadow. Nested object3ds in ObjectContainer3Ds are also supported.
 
color:uint (default = 0xFF666666) — [optional] uint: The color for the shadow. Note that the value must have alpha. Default value is 0xFF333333.
 
blur:Number (default = 4) — [optional] Number: The blur value that defines the sharpness of the shadow. Default value is 4.
 
base:Number (default = NaN) — [optional] Number: The y value the shadow must be calculated from. Default value is the lowest y value of the object3d in the scene.
 
range:Number (default = NaN) — [optional] Number: The range value affects the blur and alpha according to distance. Default value is undefined.
####INIT####
Method Detail
apply()method
public function apply(scene:Scene3D = null):BitmapData

generates the shadow projection

Parameters

scene:Scene3D (default = null)

Returns
BitmapData
positionPlane()method 
public function positionPlane():void

adjusts the shadow position to the model according to pivot of the object

update()method 
public function update(color:Number):void

generates the shadow projection

Parameters

color:Number (default = NaN)