| 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 whit light.
The direction of light and the intensity can be varied
| Property | Defined by | ||
|---|---|---|---|
| MAX_POWER : Number = 150 [static]
Maximum value accepted.
| Light3D | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new light source.
| Light3D | ||
|
Calculate the strength of this light based on the supplied normal
| Light3D | ||
|
destroy():void
| 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
Set the position of the {
| Light3D | ||
|
setDirectionVector(pDir:Vector):void
| Light3D | ||
|
setPower(p_nPow:Number):void
The the power of the light.
| Light3D | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Light3D | ||||
| 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.
|
| calculate | () | method |
public function calculate(normal:Vector):NumberCalculate the strength of this light based on the supplied normal
Parametersnormal:Vector |
Number — Number the strength between 0 and 1
|
| destroy | () | method |
public function destroy():void
| getDirectionVector | () | method |
public function getDirectionVector():VectorReturns the direction of the light.
ReturnsVector —
The light direction
|
| 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):voidSet the position of the {
Parametersx:Number — the x coordinate
|
|
y:Number — the y coordinate
|
|
z:Number — the z coordinate
|
| setDirectionVector | () | method |
| 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.
|
| lightUpdated | event |