BenQ Mobile

javax.microedition.m3g
Class Light

java.lang.Object
  extended byjavax.microedition.m3g.Object3D
      extended byjavax.microedition.m3g.Transformable
          extended byjavax.microedition.m3g.Node
              extended byjavax.microedition.m3g.Light

public class Light
extends Node

A scene graph node that represents different kinds of light sources. Light sources are used to determine the color of each object according to its Material attributes, as described in more detail in the Material class documentation.


Field Summary
static int AMBIENT
          A parameter to setMode, specifying an ambient light source.
static int DIRECTIONAL
          A parameter to setMode, specifying a directional light source.
static int OMNI
          A parameter to setMode, specifying an omnidirectional light source.
static int SPOT
          A parameter to setMode, specifying a spot light source.
 
Fields inherited from class javax.microedition.m3g.Node
NONE, ORIGIN, X_AXIS, Y_AXIS, Z_AXIS
 
Constructor Summary
Light()
          Constructs a new Light with default values.
 
Method Summary
 int getColor()
          Retrieves the current color of this Light.
 float getConstantAttenuation()
          Retrieves the current constant attenuation coefficient for this Light.
 float getIntensity()
          Retrieves the current intensity of this Light.
 float getLinearAttenuation()
          Retrieves the current linear attenuation coefficient for this Light.
 int getMode()
          Retrieves the current type of this Light.
 float getQuadraticAttenuation()
          Retrieves the current quadratic attenuation coefficient for this Light.
 float getSpotAngle()
          Retrieves the current spot angle of this Light.
 float getSpotExponent()
          Retrieves the current spot exponent for this Light.
 void setAttenuation(float constant, float linear, float quadratic)
          Sets the attenuation coefficients for this Light.
 void setColor(int RGB)
          Sets the color of this Light.
 void setIntensity(float intensity)
          Sets the intensity of this Light.
 void setMode(int mode)
          Sets the type of this Light.
 void setSpotAngle(float angle)
          Sets the spot cone angle for this Light.
 void setSpotExponent(float exponent)
          Sets the spot exponent for this Light.
 
Methods inherited from class javax.microedition.m3g.Node
align, getAlphaFactor, getParent, getScope, getTransformTo, isPickingEnabled, isRenderingEnabled, setAlignment, setAlphaFactor, setPickingEnable, setRenderingEnable, setScope
 
Methods inherited from class javax.microedition.m3g.Transformable
getCompositeTransform, getOrientation, getScale, getTransform, getTranslation, postRotate, preRotate, scale, setOrientation, setScale, setTransform, setTranslation, translate
 
Methods inherited from class javax.microedition.m3g.Object3D
addAnimationTrack, animate, duplicate, find, getAnimationTrack, getAnimationTrackCount, getReferences, getUserID, getUserObject, removeAnimationTrack, setUserID, setUserObject
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AMBIENT

public static final int AMBIENT
A parameter to setMode, specifying an ambient light source.

See Also:
Constant Field Values

DIRECTIONAL

public static final int DIRECTIONAL
A parameter to setMode, specifying a directional light source.

See Also:
Constant Field Values

OMNI

public static final int OMNI
A parameter to setMode, specifying an omnidirectional light source.

See Also:
Constant Field Values

SPOT

public static final int SPOT
A parameter to setMode, specifying a spot light source.

See Also:
Constant Field Values
Constructor Detail

Light

public Light()
Constructs a new Light with default values.

Method Detail

setMode

public void setMode(int mode)
Sets the type of this Light.


getMode

public int getMode()
Retrieves the current type of this Light.


setIntensity

public void setIntensity(float intensity)
Sets the intensity of this Light.


getIntensity

public float getIntensity()
Retrieves the current intensity of this Light.


setColor

public void setColor(int RGB)
Sets the color of this Light.


getColor

public int getColor()
Retrieves the current color of this Light.


setSpotAngle

public void setSpotAngle(float angle)
Sets the spot cone angle for this Light.


getSpotAngle

public float getSpotAngle()
Retrieves the current spot angle of this Light.


setSpotExponent

public void setSpotExponent(float exponent)
Sets the spot exponent for this Light.


getSpotExponent

public float getSpotExponent()
Retrieves the current spot exponent for this Light.


setAttenuation

public void setAttenuation(float constant,
                           float linear,
                           float quadratic)
Sets the attenuation coefficients for this Light.


getConstantAttenuation

public float getConstantAttenuation()
Retrieves the current constant attenuation coefficient for this Light.


getLinearAttenuation

public float getLinearAttenuation()
Retrieves the current linear attenuation coefficient for this Light.


getQuadraticAttenuation

public float getQuadraticAttenuation()
Retrieves the current quadratic attenuation coefficient for this Light.


BenQ Mobile

Copyright © 2006 BenQ Mobile GmbH & Co. OHG or respective copyright owner.
All Rights Reserved.
BenQ Corp. is a trademark licensee of Siemens AG.


For further information about Mobility Toolkit (MTK) visit our Developer Portal.