Class Light
java.lang.Object
com.codename1.gpu.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).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the ambient color as a packed ARGB integer.intgetColor()Returns the light color as a packed ARGB integer.floatReturns the x component of the light direction.floatReturns the y component of the light direction.floatReturns the z component of the light direction.setAmbientColor(int argb) Sets the ambient color as a packed ARGB integer.setColor(int argb) Sets the light color as a packed ARGB integer.setDirection(float x, float y, float z) Sets the world space direction the light travels.
-
Constructor Details
-
Light
public Light()
-
-
Method Details
-
setDirection
Sets the world space direction the light travels.
Parameters
-
x: the x component -
y: the y component -
z: 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
Sets the light color as a packed ARGB integer.
Parameters
argb: the packed ARGB color
Returns
this light for chaining
-
getAmbientColor
public int getAmbientColor()Returns the ambient color as a packed ARGB integer. -
setAmbientColor
Sets the ambient color as a packed ARGB integer.
Parameters
argb: the packed ARGB color
Returns
this light for chaining
-