| Package | sandy.core.light |
| Class | public class Light3D |
| Inheritance | Light3D flash.events.EventDispatcher |
The light in Sandy is a light source at infinity, emitting parallel colored light.
The direction of light and the intensity can be varied
| Property | Defined by | ||
|---|---|---|---|
| color : uint
Color of the light.
| Light3D | ||
| MAX_POWER : Number = 150 [static]
Maximum value accepted.
| Light3D | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new light source.
| Light3D | ||
|
Calculates the strength of this light based on the supplied normal.
| Light3D | ||
|
destroy():void
Not in use...
| Light3D | ||
|
Returns the direction of the light.
| Light3D | ||
|
getNormalizedPower():Number
Returns the power of the light normalized to the range 0 -> 1
| Light3D | ||
|
getPower():Number
Returns the intensity of the light.
| Light3D | ||
|
setDirection(x:Number, y:Number, z:Number):void
Uneeded? setDirectionVector() does the same thing...
| Light3D | ||
|
setDirectionVector(pDir:Vector):void
Sets the direction of the Light3D.
| Light3D | ||
|
setPower(p_nPow:Number):void
The the power of the light.
| Light3D | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when the light color is changed. | Light3D | |||
| Dispatched when the light is updated. | Light3D | |||
| color | property |
color:uint [read-write]Color of the light.
Implementation public function get color():uint
public function set color(value:uint):void
| MAX_POWER | property |
public static var MAX_POWER:Number = 150Maximum value accepted. If the default value (150) seems too big or too small for you, you can change it. But be aware that the actual lighting calculations are normalised i.e. 0 -> MAX_POWER becomes 0 -> 1
| Light3D | () | constructor |
public function Light3D(p_oD:Vector, p_nPow:Number)Creates a new light source.
Parametersp_oD:Vector — The direction of the emitted light.
|
|
p_nPow:Number — Intensity of the emitted light.
|
See also
| calculate | () | method |
public function calculate(normal:Vector):NumberCalculates the strength of this light based on the supplied normal.
Parametersnormal:Vector |
Number — Number The strength between 0 and 1
|
See also
| destroy | () | method |
public function destroy():voidNot in use...
| getDirectionVector | () | method |
public function getDirectionVector():VectorReturns the direction of the light.
ReturnsVector —
The light direction
|
See also
| getNormalizedPower | () | method |
public function getNormalizedPower():NumberReturns the power of the light normalized to the range 0 -> 1
ReturnsNumber — Number a number between 0 and 1
|
| getPower | () | method |
public function getPower():NumberReturns the intensity of the light.
ReturnsNumber — The intensity as a number between 0 - MAX_POWER.
|
| setDirection | () | method |
public function setDirection(x:Number, y:Number, z:Number):voidUneeded? setDirectionVector() does the same thing...
Parametersx:Number — The x coordinate
|
|
y:Number — The y coordinate
|
|
z:Number — The z coordinate
|
| setDirectionVector | () | method |
public function setDirectionVector(pDir:Vector):voidSets the direction of the Light3D.
ParameterspDir:Vector — A Vector object representing the direction of the light.
|
See also
| setPower | () | method |
public function setPower(p_nPow:Number):voidThe the power of the light. A number between 0 and MAX_POWER is necessary. The highter the power of the light is, the less the shadows are visibles.
Parametersp_nPow:Number — Number a Number between 0 and MAX_POWER. This number is the light intensity.
|
| lightColorChanged | event |
sandy.events.SandyEvent
sandy.events.SandyEvent.LIGHT_COLOR_CHANGED
Dispatched when the light color is changed.
Defines the value of the type property of a lightColorChanged event object.
| lightUpdated | event |
sandy.events.SandyEvent
sandy.events.SandyEvent.LIGHT_UPDATED
Dispatched when the light is updated.
Defines the value of the type property of a lightUpdated event object.