B.Graph.Light() -> B.Graph.Locator

Represents a light.

To create the object use B.Graph.makeLight().

The Light object doesn't bring the lighting to the "scene". Any lighting technique could be implemented using this object. For example, you can traverse through all lights and set its parameters to your stages. Another example is deferred technique where you are rendering each light to the special stage. In that case you can attach a Visual to your Light and specify mesh and material.

There are no conceptual difference between "point" and "spot" light. The "spot" light is just spherical cone, i.e. a part of a sphere specified by an angle and a direction. The "point" light is the whole sphere, so it has the angle 2*PI and direction has no meaning.

METHODS:

direction()

Returns direction of the light.

The direction is calculating from Locator's transformation. It has no meaning for "point" lights.

RETURNS:

{B.Math.Vector3}

direction

angle(radians, deep)

Sets an angle of the light.

The angle has meaning only for "spot" lights. The "point" lights always has angle 2*PI.

PARAMETERS:

{number} radians

{boolean} [deep] = false

true if you want to set value through the whole hierarchy

RETURNS:

{B.Graph.Light}

this

FIRES:

angle()

Returns angle of the light.

RETURNS:

{number}

radians

radius(radius, deep)

Sets a radius of the light.

PARAMETERS:

{number} radius

{boolean} [deep] = false

true if you want to set value through the whole hierarchy

RETURNS:

{B.Graph.Light}

this

FIRES:

radius()

Returns radius of the light.

RETURNS:

{number}

radius

intensity(value, deep)

Sets intensity of the light.

PARAMETERS:

{number} value

{boolean} [deep] = false

true if you want to set value through the whole hierarchy

RETURNS:

{B.Graph.Light}

this

FIRES:

intensity()

Returns intensity of the light.

RETURNS:

{number}

intensity

deviation(value, deep)

Sets deviation of the light.

PARAMETERS:

{number} value

{boolean} [deep] = false

true if you want to set value through the whole hierarchy

RETURNS:

{B.Graph.Light}

this

FIRES:

deviation()

Returns deviation of the light.

RETURNS:

{number}

deviation

cutoff(value, deep)

Sets cutoff of the light.

PARAMETERS:

{number} value

{boolean} [deep] = false

true if you want to set value through the whole hierarchy

RETURNS:

{B.Graph.Light}

this

FIRES:

cutoff()

Returns cutoff of the light.

RETURNS:

{number}

cutoff

color(value, deep)

Sets color of the light.

PARAMETERS:

{B.Math.Color} value

{boolean} [deep] = false

true if you want to set value through the whole hierarchy

RETURNS:

{B.Graph.Light}

this

FIRES:

color()

Returns color of the light.

RETURNS:

{B.Math.Color}

color

EVENTS:

{B.Std.Event} light-changed

Reporting that the light's parameter has been changes.

METHODS:

EVENTS: