Package com.ardor3d.light
Class DirectionalLight
java.lang.Object
com.ardor3d.light.Light
com.ardor3d.light.DirectionalLight
- All Implemented Interfaces:
Savable
,Serializable
DirectionalLight
defines a light that is assumed to be infinitely far away (something similar to the
sun). This means the direction of the light rays are all parallel. The direction field of this class identifies the
direction in which the light is traveling, which is opposite how jME works.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ardor3d.light.Light
Light.Type
-
Field Summary
Fields inherited from class com.ardor3d.light.Light
_shadowCaster, DEFAULT_AMBIENT, DEFAULT_DIFFUSE, DEFAULT_SPECULAR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetType()
getType
returns this light's type (Type.Directional).void
read
(InputCapsule capsule) void
setDirection
(double x, double y, double z) void
setDirection
(ReadOnlyVector3 direction) void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.light.Light
copyFrom, getAmbient, getClassTag, getConstant, getDiffuse, getLightMask, getLinear, getName, getQuadratic, getSpecular, isAttenuate, isEnabled, isShadowCaster, popLightMask, pushLightMask, setAmbient, setAttenuate, setConstant, setDiffuse, setEnabled, setLightMask, setLinear, setName, setQuadratic, setShadowCaster, setSpecular
-
Constructor Details
-
DirectionalLight
public DirectionalLight()Constructor instantiates a newDirectionalLight
object. The initial light colors are white and the direction the light travels is along the positive z axis (0,0,1).
-
-
Method Details
-
getDirection
- Returns:
- the direction the light traveling in.
-
setDirection
- Parameters:
direction
- the direction the light is traveling in.
-
setDirection
public void setDirection(double x, double y, double z) - Parameters:
x
- the direction the light is traveling in on the x axis.y
- the direction the light is traveling in on the y axis.z
- the direction the light is traveling in on the z axis.
-
getType
getType
returns this light's type (Type.Directional). -
write
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classLight
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classLight
- Throws:
IOException
-