Packageaway3d.materials.utils
Classpublic class SimpleShadow

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
SimpleShadow
  blur : int
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
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
  
positionPlane():void
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  [read-write]Implementation
    public function get base():Number
    public function set base(value:Number):void
blurproperty 
blur:int  [read-write]Implementation
    public function get blur():int
    public function set blur(value:int):void
colorproperty 
color:uint  [read-write]

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  [read-write]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)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 — [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 — [optional] Number: The range value affects the blur and alpha according to distance. Default value is undefined.
Init Parameters
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
Wiki link
Click to go to the wiki page for 'away3d.materials.utils.SimpleShadow'

Code examples

Comments