APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.scenario.effect.light

public Class SpotLight

extends PointLight
Class Inheritance
Imports
com.sun.scenario.effect.Color4f

Represents a spot light source at a given position in 3D space, with configurable direction and focus.

Field Summary

Modifier and TypeField and Description
private float
private float
private float
private float

Constructor Summary

AccessConstructor and Description
public
SpotLight()

Constructs a new PointLight with default position (0,0,0), direction (pointing at (0,0,0)) and specular exponent (1.0).

public
SpotLight(float
the x coordinate of the light position
x
,
float
the y coordinate of the light position
y
,
float
the z coordinate of the light position
z
,
Color4f
the color of the light
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).

Method Summary

Modifier and TypeMethod and Description
public float[]

Returns:

the normalized direction vector of this light source
getNormalizedLightDirection
()

Returns a float array containing the normalized (x,y,z) direction vector of this light source.

public float[]
getNormalizedLightPosition()

Overrides com.sun.scenario.effect.light.PointLight.getNormalizedLightPosition.

Returns a float array containing the normalized (x,y,z) position of this light source.

public float

Returns:

the x coordinate of the direction vector for this light
getPointsAtX
()

Returns the x coordinate of the direction vector for this light.

public float

Returns:

the y coordinate of the direction vector for this light
getPointsAtY
()

Returns the y coordinate of the direction vector for this light.

public float

Returns:

the z coordinate of the direction vector for this light
getPointsAtZ
()

Returns the z coordinate of the direction vector for this light.

public float

Returns:

the specular exponent of this light
getSpecularExponent
()

Returns the specular exponent, which controls the focus of this light source.

public void
setPointsAtX(float
the x coordinate of the direction vector for this light
pointsAtX
)

Sets the x coordinate of the direction vector for this light.

public void
setPointsAtY(float
the y coordinate of the direction vector for this light
pointsAtY
)

Sets the y coordinate of the direction vector for this light.

public void
setPointsAtZ(float
the z coordinate of the direction vector for this light
pointsAtZ
)

Sets the z coordinate of the direction vector for this light.

public void
setSpecularExponent(float
the specular exponent of this light
specularExponent
)

Sets the specular exponent, which controls the focus of this light source.

Inherited from com.sun.scenario.effect.light.PointLight:
getXgetYgetZsetXsetYsetZ

Field Detail

pointsAtXback to summary
private float pointsAtX
pointsAtYback to summary
private float pointsAtY
pointsAtZback to summary
private float pointsAtZ
specularExponentback to summary
private float specularExponent

Constructor Detail

SpotLightback to summary
public SpotLight()

Constructs a new PointLight with default position (0,0,0), direction (pointing at (0,0,0)) and specular exponent (1.0).

SpotLightback to summary
public 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).

Parameters
x:float

the x coordinate of the light position

y:float

the y coordinate of the light position

z:float

the z coordinate of the light position

color:Color4f

the color of the light

Exceptions
IllegalArgumentException:
if color is null

Method Detail

getNormalizedLightDirectionback to summary
public float[] getNormalizedLightDirection()

Returns a float array containing the normalized (x,y,z) direction vector of this light source.

Returns:float[]

the normalized direction vector of this light source

getNormalizedLightPositionback to summary
public float[] getNormalizedLightPosition()

Overrides com.sun.scenario.effect.light.PointLight.getNormalizedLightPosition.

Doc from com.sun.scenario.effect.light.Light.getNormalizedLightPosition.

Returns a float array containing the normalized (x,y,z) position of this light source.

Annotations
@Override
getPointsAtXback to summary
public float getPointsAtX()

Returns the x coordinate of the direction vector for this light.

Returns:float

the x coordinate of the direction vector for this light

getPointsAtYback to summary
public float getPointsAtY()

Returns the y coordinate of the direction vector for this light.

Returns:float

the y coordinate of the direction vector for this light

getPointsAtZback to summary
public float getPointsAtZ()

Returns the z coordinate of the direction vector for this light.

Returns:float

the z coordinate of the direction vector for this light

getSpecularExponentback to summary
public float getSpecularExponent()

Returns the specular exponent, which controls the focus of this light source.

Returns:float

the specular exponent of this light

setPointsAtXback to summary
public void setPointsAtX(float pointsAtX)

Sets the x coordinate of the direction vector for this light.

      Min: n/a
      Max: n/a
  Default: 0.0
 Identity: n/a
Parameters
pointsAtX:float

the x coordinate of the direction vector for this light

setPointsAtYback to summary
public void setPointsAtY(float pointsAtY)

Sets the y coordinate of the direction vector for this light.

      Min: n/a
      Max: n/a
  Default: 0.0
 Identity: n/a
Parameters
pointsAtY:float

the y coordinate of the direction vector for this light

setPointsAtZback to summary
public void setPointsAtZ(float pointsAtZ)

Sets the z coordinate of the direction vector for this light.

      Min: n/a
      Max: n/a
  Default: 0.0
 Identity: n/a
Parameters
pointsAtZ:float

the z coordinate of the direction vector for this light

setSpecularExponentback to summary
public void setSpecularExponent(float specularExponent)

Sets the specular exponent, which controls the focus of this light source.

      Min: 0.0
      Max: 4.0
  Default: 1.0
 Identity: 1.0
Parameters
specularExponent:float

the specular exponent of this light