Scripting API

Home Scripting API Index Class Overview

com.nolimitscoaster

Class SceneObjectLight


public class SceneObjectLight
extends Object

Represents a handle to a light inside a scene object

Method Summary

void getColor(nlvm.math3d.Vector3f v)
  Returns the color of the light in gamma (sRGB) color space.
void getColorLinear(nlvm.math3d.Vector3f v)
  Returns the color of the light in linear color space.
float getIntensity()
  Returns the intensity of the light.
int getLightIndex()
  Returns the index of the light inside the owning scene object
String getName()
  Returns the name of this light as specified in the 3d object
bool isEnabled()
  Returns if the light source is enabled
void setColor(float red, float green, float blue)
  Sets the color of the light.
void setColor(nlvm.math3d.Vector3f v)
  Sets the color of the light.
void setColorLinear(float red, float green, float blue)
  Sets the color of the light, using linear color space values.
void setColorLinear(nlvm.math3d.Vector3f v)
  Sets the color of the light. Values are in linear color space.
void setEnabled(bool enable)
  Enables or disables the light source
void setPosition(nlvm.math3d.Vector3f v)
  Sets the position of the light. The position is relative to the transformation of the owning scene object.
void setSpotDirection(nlvm.math3d.Vector3f v)
  Sets the spot direction of the light. The direction is relative to the transformation of the owning scene object.
void setSpotUpVector(nlvm.math3d.Vector3f v)
  The up-vector describes together with the direction vector the spotlight's orientation.


Method Detail


getColor

public final void getColor(nlvm.math3d.Vector3f v)

Returns the color of the light in gamma (sRGB) color space.

Parameters:

v - Will return color in v (x=red, y=green, z=blue). Must not be null.

getColorLinear

public final void getColorLinear(nlvm.math3d.Vector3f v)

Returns the color of the light in linear color space.

Parameters:

v - Will return color in v (x=red, y=green, z=blue). Must not be null.

Since:
    2.6.2.0


getIntensity

public final float getIntensity()

Returns the intensity of the light.

The intensity of the NL2SCO light settings is returned. The value is constant. The engine only uses this value to set the initial light color, by converting the default color into linear color space and multiplying it with the intensity factor. Please note that light color computations with intensity factors, should always be done in linear color space. For this reason there are getColorLinear and setColorLinear methods available.

Returns:
    the intensity

Since:
    2.6.2.0


getLightIndex

public final int getLightIndex()

Returns the index of the light inside the owning scene object

Returns:
    index of light


getName

public final String getName()

Returns the name of this light as specified in the 3d object

Returns:
    name of light


isEnabled

public final bool isEnabled()

Returns if the light source is enabled

Light sources are enabled by default

Returns:
    true when the light is enabled


setColor

public final void setColor(float red, float green, float blue)

Sets the color of the light.

Values are in gamma (sRGB) color space (as converted from bytes with dividing by 255).

Parameters:

red - Red color component (typically 0..1)
green - Green color component (typically 0..1)
blue - Blue color component (typically 0..1)

setColor

public final void setColor(nlvm.math3d.Vector3f v)

Sets the color of the light.

Values are in gamma (sRGB) color space (as converted from bytes with dividing by 255).

Parameters:

v - Vector with color (x=red, y=green, z=blue). Must not be null.

setColorLinear

public final void setColorLinear(float red, float green, float blue)

Sets the color of the light, using linear color space values.

Parameters:

red - Red color component
green - Green color component
blue - Blue color component

Since:
    2.6.2.0


setColorLinear

public final void setColorLinear(nlvm.math3d.Vector3f v)

Sets the color of the light. Values are in linear color space.

Parameters:

v - Vector with color (x=red, y=green, z=blue). Must not be null.

Since:
    2.6.2.0


setEnabled

public final void setEnabled(bool enable)

Enables or disables the light source

Light sources are enabled by default

Parameters:

enable - true=Enable light, false=disable light

setPosition

public final void setPosition(nlvm.math3d.Vector3f v)

Sets the position of the light. The position is relative to the transformation of the owning scene object.

Behaviour is undefined when using key frame animation playback.

Parameters:

v - Vector with position. All values in meters. Must not be null.

setSpotDirection

public final void setSpotDirection(nlvm.math3d.Vector3f v)

Sets the spot direction of the light. The direction is relative to the transformation of the owning scene object.

Behaviour is undefined when using key frame animation playback.

Parameters:

v - Vector with spot direction. Should be unit-length. Must not be null.

setSpotUpVector

public final void setSpotUpVector(nlvm.math3d.Vector3f v)

The up-vector describes together with the direction vector the spotlight's orientation.

The up-vector is only needed if a custom cookie texture is used, otherwise the direction vector is sufficient for the light's orientation. Behaviour is undefined when using key frame animation playback.

Parameters:

v - Vector with spot-up direction. Should be unit-length. Must not be null.