Package com.ardor3d.light
Class SpotLight
java.lang.Object
com.ardor3d.light.Light
com.ardor3d.light.PointLight
com.ardor3d.light.SpotLight
- All Implemented Interfaces:
Savable
,Serializable
SpotLight defines a light that has a location in space and emits light within a cone. This cone is defined by an
angle and exponent. Typically this light's values are attenuated based on the distance of the point light and the
object it illuminates.
- 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 TypeMethodDescriptionfloat
getAngle()
getAngle
returns the angle of the spot light.float
getExponent
gets the spot exponent of this light.getType()
getType
returns the type of this light (Type.Spot).void
read
(InputCapsule capsule) void
setAngle
(float angle) setAngle
sets the angle of focus of the spot light measured from the direction vector.void
setDirection
(ReadOnlyVector3 direction) void
setExponent
(float exponent) setExponent
sets the spot exponent of this light.void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.light.PointLight
getLocation, setLocation, setLocation
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
-
SpotLight
public SpotLight()Constructor instantiates a newSpotLight
object. The initial position of the light is (0,0,0) with angle 0, and colors white.
-
-
Method Details
-
getDirection
- Returns:
- the direction the spot light is pointing.
-
setDirection
- Parameters:
direction
- the direction the spot light is pointing.
-
getAngle
public float getAngle()getAngle
returns the angle of the spot light.- Returns:
- the angle (in degrees)
- See Also:
-
setAngle
public void setAngle(float angle) setAngle
sets the angle of focus of the spot light measured from the direction vector. Think of this as the angle of a cone. Therefore, if you specify 10 degrees, you will get a 20 degree cone (10 degrees off either side of the direction vector.) 180 degrees means radiate in all directions.- Parameters:
angle
- the angle (in degrees) which must be between 0 and 90 (inclusive) or the special case 180.
-
getExponent
public float getExponent()getExponent
gets the spot exponent of this light.- Returns:
- the spot exponent of this light.
- See Also:
-
setExponent
public void setExponent(float exponent) setExponent
sets the spot exponent of this light. This value represents how focused the light beam is.- Parameters:
exponent
- the spot exponent of this light. Should be between 0-128
-
getType
getType
returns the type of this light (Type.Spot).- Overrides:
getType
in classPointLight
- Returns:
- the type of light that has been created.
- See Also:
-
write
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classPointLight
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classPointLight
- Throws:
IOException
-