| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Leaf javax.media.j3d.Light javax.media.j3d.PointLight javax.media.j3d.SpotLight
SpotLight | public class SpotLight extends PointLight (Code) | | The SpotLight object specifies an attenuated light source at a
fixed point in space that radiates light in a specified direction
from the light source. A SpotLight has the same attributes as a
PointLight node, with the addition of the following:
- Direction - The axis of the cone of light. The default
direction is (0.0, 0.0, -1.0). The spot light direction is
significant only when the spread angle is not PI radians
(which it is by default).
- Spread angle - The angle in radians between the direction axis
and a ray along the edge of the cone. Note that the angle of the
cone at the apex is then twice this value. The range of values
is [0.0,PI/2] radians, with a special value of PI radians. Values
lower than 0 are clamped to 0 and values over PI/2 are clamped
to PI. The default spread angle is PI radians.
- Concentration - Specifies how quickly the light intensity
attenuates as a function of the angle of radiation as measured from
the direction of radiation. The light's intensity is highest at the
center of the cone and is attenuated toward the edges of the cone
by the cosine of the angle between the direction of the light
and the direction from the light to the object being lit, raised
to the power of the spot concentration exponent.
The higher the concentration value, the more focused the light
source. The range of values is [0.0,128.0]. The default
concentration is 0.0, which provides uniform light
distribution.
A spot light contributes to diffuse and specular reflections, which
depend on the orientation and position of an object's surface.
A spot light does not contribute to ambient reflections.
|
Field Summary | |
final public static int | ALLOW_CONCENTRATION_READ Specifies that the Node allows reading its spot lights concentration
information. | final public static int | ALLOW_CONCENTRATION_WRITE Specifies that the Node allows writing to its spot lights concentration
information. | final public static int | ALLOW_DIRECTION_READ Specifies that the Node allows reading its spot lights direction
information. | final public static int | ALLOW_DIRECTION_WRITE Specifies that the Node allows writing to its spot lights direction
information. | final public static int | ALLOW_SPREAD_ANGLE_READ Specifies that the Node allows reading its spot lights spread angle
information. | final public static int | ALLOW_SPREAD_ANGLE_WRITE Specifies that the Node allows writing to its spot lights spread angle
information. |
Constructor Summary | |
public | SpotLight() Constructs a SpotLight node with default parameters. | public | SpotLight(Color3f color, Point3f position, Point3f attenuation, Vector3f direction, float spreadAngle, float concentration) Constructs and initializes a SpotLight node using the
specified parameters. | public | SpotLight(boolean lightOn, Color3f color, Point3f position, Point3f attenuation, Vector3f direction, float spreadAngle, float concentration) Constructs and initializes a SpotLight node using the
specified parameters. |
Method Summary | |
public Node | cloneNode(boolean forceDuplicate) Used to create a new instance of the node. | void | createRetained() Creates the retained mode SpotLightRetained object that this
SpotLight component object will point to. | void | duplicateAttributes(Node originalNode, boolean forceDuplicate) Copies all SpotLight information from
originalNode into
the current node. | public float | getConcentration() Gets spot light concentration. | public void | getDirection(Vector3f direction) Gets this Light's current direction and places it in the
parameter specified. | public float | getSpreadAngle() Gets spot light spread angle.
the new spread angle for spot light. | public void | setConcentration(float concentration) Sets spot light concentration. | public void | setDirection(float x, float y, float z) Sets light direction. | public void | setDirection(Vector3f direction) Sets this Light's current direction and places it in the parameter specified. | public void | setSpreadAngle(float spreadAngle) Sets spot light spread angle. |
ALLOW_CONCENTRATION_READ | final public static int ALLOW_CONCENTRATION_READ(Code) | | Specifies that the Node allows reading its spot lights concentration
information.
|
ALLOW_CONCENTRATION_WRITE | final public static int ALLOW_CONCENTRATION_WRITE(Code) | | Specifies that the Node allows writing to its spot lights concentration
information.
|
ALLOW_DIRECTION_READ | final public static int ALLOW_DIRECTION_READ(Code) | | Specifies that the Node allows reading its spot lights direction
information.
|
ALLOW_DIRECTION_WRITE | final public static int ALLOW_DIRECTION_WRITE(Code) | | Specifies that the Node allows writing to its spot lights direction
information.
|
ALLOW_SPREAD_ANGLE_READ | final public static int ALLOW_SPREAD_ANGLE_READ(Code) | | Specifies that the Node allows reading its spot lights spread angle
information.
|
ALLOW_SPREAD_ANGLE_WRITE | final public static int ALLOW_SPREAD_ANGLE_WRITE(Code) | | Specifies that the Node allows writing to its spot lights spread angle
information.
|
SpotLight | public SpotLight()(Code) | | Constructs a SpotLight node with default parameters.
The default values are as follows:
direction : (0,0,-1)
spread angle : PI radians
concentration : 0.0
|
SpotLight | public SpotLight(Color3f color, Point3f position, Point3f attenuation, Vector3f direction, float spreadAngle, float concentration)(Code) | | Constructs and initializes a SpotLight node using the
specified parameters.
Parameters: color - the color of the light source Parameters: position - the position of the light in three-space Parameters: attenuation - the attenuation (constant, linear, quadratic)of the light Parameters: direction - the direction of the light Parameters: spreadAngle - the spread angle of the light Parameters: concentration - the concentration of the light |
SpotLight | public SpotLight(boolean lightOn, Color3f color, Point3f position, Point3f attenuation, Vector3f direction, float spreadAngle, float concentration)(Code) | | Constructs and initializes a SpotLight node using the
specified parameters.
Parameters: lightOn - flag indicating whether this light is on or off Parameters: color - the color of the light source Parameters: position - the position of the light in three-space Parameters: attenuation - the attenuation (constant, linear, quadratic) of the light Parameters: direction - the direction of the light Parameters: spreadAngle - the spread angle of the light Parameters: concentration - the concentration of the light |
cloneNode | public Node cloneNode(boolean forceDuplicate)(Code) | | Used to create a new instance of the node. This routine is called
by cloneTree to duplicate the current node.
Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. See Also: Node.cloneTree See Also: Node.cloneNode See Also: Node.duplicateNode See Also: NodeComponent.setDuplicateOnCloneTree |
createRetained | void createRetained()(Code) | | Creates the retained mode SpotLightRetained object that this
SpotLight component object will point to.
|
duplicateAttributes | void duplicateAttributes(Node originalNode, boolean forceDuplicate)(Code) | | Copies all SpotLight information from
originalNode into
the current node. This method is called from the
cloneNode method which is, in turn, called by the
cloneTree method.
Parameters: originalNode - the original node to duplicate. Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. exception: RestrictedAccessException - if this object is part of a liveor compiled scenegraph. See Also: Node.duplicateNode See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
getConcentration | public float getConcentration()(Code) | | Gets spot light concentration.
the new concentration for spot light exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getDirection | public void getDirection(Vector3f direction)(Code) | | Gets this Light's current direction and places it in the
parameter specified.
Parameters: direction - the vector that will receive this node's direction exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getSpreadAngle | public float getSpreadAngle()(Code) | | Gets spot light spread angle.
the new spread angle for spot light. The value returnedis the clamped value. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setConcentration | public void setConcentration(float concentration)(Code) | | Sets spot light concentration.
Parameters: concentration - the new concentration for spot light exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setDirection | public void setDirection(float x, float y, float z)(Code) | | Sets light direction.
Parameters: x - the new X direction Parameters: y - the new Y direction Parameters: z - the new Z direction exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setDirection | public void setDirection(Vector3f direction)(Code) | | Sets this Light's current direction and places it in the parameter specified.
Parameters: direction - the vector that will receive this node's direction exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setSpreadAngle | public void setSpreadAngle(float spreadAngle)(Code) | | Sets spot light spread angle.
Parameters: spreadAngle - the new spread angle for spot light exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph. |
|
|