public final class Light

  1. Object
  2. Light
A single directional light plus a global ambient term, consumed by lit materials (Material.Type.LAMBERT and Material.Type.PHONG). The direction is the direction the light travels, in world space. Set the active light on the device with GraphicsDevice.setLight(Light).

Constructors

public Light()

Methods

public Light setDirection(float x, float y, float z)Sets the world space direction the light travels.
public float getDirectionX()Returns the x component of the light direction.
public float getDirectionY()Returns the y component of the light direction.
public float getDirectionZ()Returns the z component of the light direction.
public int getColor()Returns the light color as a packed ARGB integer.
public Light setColor(int argb)Sets the light color as a packed ARGB integer.
public int getAmbientColor()Returns the ambient color as a packed ARGB integer.
public Light setAmbientColor(int argb)Sets the ambient color as a packed ARGB integer.

Inherited methods

Constructor details

Light

public Light()

Method details

setDirection

public Light setDirection(float x, float y, float z)
Sets the world space direction the light travels.

Parameters

x float
the x component
y float
the y component
z float
the z component

Returns

this light for chaining

getDirectionX

public float getDirectionX()
Returns the x component of the light direction.

getDirectionY

public float getDirectionY()
Returns the y component of the light direction.

getDirectionZ

public float getDirectionZ()
Returns the z component of the light direction.

getColor

public int getColor()
Returns the light color as a packed ARGB integer.

setColor

public Light setColor(int argb)
Sets the light color as a packed ARGB integer.

Parameters

argb int
the packed ARGB color

Returns

this light for chaining

getAmbientColor

public int getAmbientColor()
Returns the ambient color as a packed ARGB integer.

setAmbientColor

public Light setAmbientColor(int argb)
Sets the ambient color as a packed ARGB integer.

Parameters

argb int
the packed ARGB color

Returns

this light for chaining