|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.motorola.iden.micro3d.Light
Light
class contains and manages lighting setting. The Micro3D
engine supports two types of lighting: ambient light and directional light.
For directional light, only a single white light is supported. The
Light
class can be used to specify the intensity and direction
for the light.
Field Summary | |
static int |
MAX_AMBIENT_LIGHT_INTENSITY
Maximum ambient light intensity. |
static int |
MAX_DIRECTIONAL_LIGHT_INTENSITY
Maximum directional light intensity. |
static int |
MIN_AMBIENT_LIGHT_INTENSITY
Minimum ambient light intensity. |
static int |
MIN_DIRECTIONAL_LIGHT_INTENSITY
Minimum directional light intensity. |
Constructor Summary | |
Light(int ambientIntensity,
Vector3D direction,
int directionalIntensity)
Creates a Light object with the specified parameters.
|
Method Summary | |
int |
getAmbientIntensity()
Returns the ambient light intensity for this Light object.
|
int |
getDirectionalIntensity()
Returns the directional light intensity for this Light object.
|
Vector3D |
getDirectionVector()
Returns the Vector3D representing the direction of light for
this Light object.
|
void |
setAmbientIntensity(int intensity)
Sets the ambient light intensity for this Light object.
|
void |
setDirectionalIntensity(int intensity)
Sets the directional light intensity for this Light object.
|
void |
setDirectionVector(Vector3D direction)
Sets and enables or disables directional lighting for this Light object.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MIN_AMBIENT_LIGHT_INTENSITY
public static final int MAX_AMBIENT_LIGHT_INTENSITY
public static final int MIN_DIRECTIONAL_LIGHT_INTENSITY
public static final int MAX_DIRECTIONAL_LIGHT_INTENSITY
Constructor Detail |
public Light(int ambientIntensity, Vector3D direction, int directionalIntensity) throws java.lang.IllegalArgumentException
Light
object with the specified parameters.
The specified ambient light intensity must be in the range
[0, 4096]
. Values less than 0 will be adjusted to 0, while
values greater than 4096 will be adjusted to 4096.
The specified directional light intensity must be in the range
[0, 16384]
. Values less than 0 will be adjusted to 0, while
values greater than 16384 will be adjusted to 16834.
The specified light direction must be a non-zero vector. If the direction
vector is null
, directional lighting is disabled.ambientIntensity
- the ambient light intensity.direction
- the directional light vector, or null
to
disable directional lighting.directionalIntensity
- the directional light intensity value.java.lang.IllegalArgumentException
- if the specified direction vector is a
zero vector.Method Detail |
public int getAmbientIntensity()
Light
object.
public void setAmbientIntensity(int intensity)
Light
object.
Intensity values range from 0 to 4096. Values less than 0
will be adjusted to 0 (Light.MIN_AMBIENT_LIGHT_INTENSITY
),
while values greater than 4096 will be adjusted to 4096
(Light.MAX_AMBIENT_LIGHT_INTENSITY
).
intensity
- the ambient light intensity.MIN_AMBIENT_LIGHT_INTENSITY
,
MAX_AMBIENT_LIGHT_INTENSITY
public Vector3D getDirectionVector()
Vector3D
representing the direction of light for
this Light
object.
If directional lighting is not set this method returns null
.
public void setDirectionVector(Vector3D direction) throws java.lang.IllegalArgumentException
Light
object.
The Vector3D
should describe the direction of light
or null
to disable directional lighting.direction
- the directional light vector, or null
to
disable directional lighting.java.lang.IllegalArgumentException
- if the direction vector is a zero vector.public int getDirectionalIntensity()
Light
object.
public void setDirectionalIntensity(int intensity)
Light
object.
The directional vector must not be null
for this value
to take effect. The valid range for the directional light intensity is
[0, 16384]. Values less than 0 will be adjusted to 0
(Light.MIN_DIRECTIONAL_LIGHT_INTENSITY
), while values greater
than 16384 will be adjusted to 16384
(Light.MAX_DIRECTIONAL_LIGHT_INTENSITY
). The intensity value
of 4096 is equivalent to intensity of 1.00 (100%). If the intensity is
100% and the light is shown directly in front of the object, the untouched
texture RGB value is rendered.
intensity
- the directional light intensity.setDirectionVector(com.motorola.iden.micro3d.Vector3D)
,
MIN_DIRECTIONAL_LIGHT_INTENSITY
,
MAX_DIRECTIONAL_LIGHT_INTENSITY
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |