public class SpotLight extends PointLight
Light.Type
Modifier and Type | Field and Description |
---|---|
private float |
pointsAtX |
private float |
pointsAtY |
private float |
pointsAtZ |
private float |
specularExponent |
Constructor and Description |
---|
SpotLight()
Constructs a new
PointLight with default position (0,0,0),
direction (pointing at (0,0,0)) and specular exponent (1.0). |
SpotLight(float x,
float y,
float z,
Color4f color)
Constructs a new
SpotLight with the given position and color,
with the default direction (pointing at (0,0,0)) and specular exponent
(1.0). |
Modifier and Type | Method and Description |
---|---|
float[] |
getNormalizedLightDirection()
Returns a float array containing the normalized
(x,y,z)
direction vector of this light source. |
float[] |
getNormalizedLightPosition()
Returns a float array containing the normalized
(x,y,z)
position of this light source. |
float |
getPointsAtX()
Returns the x coordinate of the direction vector for this light.
|
float |
getPointsAtY()
Returns the y coordinate of the direction vector for this light.
|
float |
getPointsAtZ()
Returns the z coordinate of the direction vector for this light.
|
float |
getSpecularExponent()
Returns the specular exponent, which controls the focus of this
light source.
|
void |
setPointsAtX(float pointsAtX)
Sets the x coordinate of the direction vector for this light.
|
void |
setPointsAtY(float pointsAtY)
Sets the y coordinate of the direction vector for this light.
|
void |
setPointsAtZ(float pointsAtZ)
Sets the z coordinate of the direction vector for this light.
|
void |
setSpecularExponent(float specularExponent)
Sets the specular exponent, which controls the focus of this
light source.
|
private float pointsAtX
private float pointsAtY
private float pointsAtZ
private float specularExponent
public SpotLight()
PointLight
with default position (0,0,0),
direction (pointing at (0,0,0)) and specular exponent (1.0).public SpotLight(float x, float y, float z, Color4f color)
SpotLight
with the given position and color,
with the default direction (pointing at (0,0,0)) and specular exponent
(1.0).x
- the x coordinate of the light positiony
- the y coordinate of the light positionz
- the z coordinate of the light positioncolor
- the color of the lightjava.lang.IllegalArgumentException
- if color
is nullpublic float getPointsAtX()
public void setPointsAtX(float pointsAtX)
Min: n/a Max: n/a Default: 0.0 Identity: n/a
pointsAtX
- the x coordinate of the direction vector for this lightpublic float getPointsAtY()
public void setPointsAtY(float pointsAtY)
Min: n/a Max: n/a Default: 0.0 Identity: n/a
pointsAtY
- the y coordinate of the direction vector for this lightpublic float getPointsAtZ()
public void setPointsAtZ(float pointsAtZ)
Min: n/a Max: n/a Default: 0.0 Identity: n/a
pointsAtZ
- the z coordinate of the direction vector for this lightpublic float getSpecularExponent()
public void setSpecularExponent(float specularExponent)
Min: 0.0 Max: 4.0 Default: 1.0 Identity: 1.0
specularExponent
- the specular exponent of this lightpublic float[] getNormalizedLightPosition()
Light
(x,y,z)
position of this light source.getNormalizedLightPosition
in class PointLight
public float[] getNormalizedLightDirection()
(x,y,z)
direction vector of this light source.