|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.light.Light
com.jme3.light.SpotLight
public class SpotLight
Represents a spot light. A spot light emmit a cone of light from a position and in a direction. It can be used to fake torch lights or car's lights.
In addition to a position and a direction, spot lights also have a range which can be used to attenuate the influence of the light depending on the distance between the light and the effected object. Also the angle of the cone can be tweaked by changing the spot inner angle and the spot outer angle. the spot inner angle determin the cone of light where light has full influence. the spot outer angle determin the cone global cone of light of the spot light. the light intensity slowly decrease between the inner cone and the outer cone.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jme3.light.Light |
---|
Light.Type |
Field Summary | |
---|---|
protected Vector3f |
direction
|
protected float |
invSpotRange
|
protected float |
packedAngleCos
|
protected Vector3f |
position
|
protected float |
spotInnerAngle
|
protected float |
spotOuterAngle
|
protected float |
spotRange
|
Fields inherited from class com.jme3.light.Light |
---|
color, enabled, lastDistance, name |
Constructor Summary | |
---|---|
SpotLight()
|
Method Summary | |
---|---|
protected void |
computeLastDistance(Spatial owner)
Used internally to compute the last distance value. |
Vector3f |
getDirection()
|
float |
getInvSpotRange()
for internal use only |
float |
getPackedAngleCos()
for internal use only |
Vector3f |
getPosition()
|
float |
getSpotInnerAngle()
returns the spot inner angle |
float |
getSpotOuterAngle()
returns the spot outer angle |
float |
getSpotRange()
|
Light.Type |
getType()
Returns the light type |
void |
read(JmeImporter im)
|
void |
setDirection(Vector3f direction)
|
void |
setPosition(Vector3f position)
|
void |
setSpotInnerAngle(float spotInnerAngle)
Sets the inner angle of the cone of influence. |
void |
setSpotOuterAngle(float spotOuterAngle)
Sets the outer angle of the cone of influence. |
void |
setSpotRange(float spotRange)
Set the range of the light influence. |
void |
write(JmeExporter ex)
|
Methods inherited from class com.jme3.light.Light |
---|
clone, getColor, getName, setColor, setName |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Vector3f position
protected Vector3f direction
protected float spotInnerAngle
protected float spotOuterAngle
protected float spotRange
protected float invSpotRange
protected float packedAngleCos
Constructor Detail |
---|
public SpotLight()
Method Detail |
---|
protected void computeLastDistance(Spatial owner)
Light
computeLastDistance
in class Light
public Light.Type getType()
Light
getType
in class Light
Light.Type
public Vector3f getDirection()
public void setDirection(Vector3f direction)
public Vector3f getPosition()
public void setPosition(Vector3f position)
public float getSpotRange()
public void setSpotRange(float spotRange)
Setting a non-zero range indicates the light should use attenuation. If a pixel's distance to this light's position is greater than the light's range, then the pixel will not be effected by this light, if the distance is less than the range, then the magnitude of the influence is equal to distance / range.
spotRange
- the range of the light influence.
java.lang.IllegalArgumentException
- If spotRange is negativepublic float getInvSpotRange()
public float getSpotInnerAngle()
public void setSpotInnerAngle(float spotInnerAngle)
spotInnerAngle
- public float getSpotOuterAngle()
public void setSpotOuterAngle(float spotOuterAngle)
spotOuterAngle
- public float getPackedAngleCos()
public void write(JmeExporter ex) throws java.io.IOException
write
in interface Savable
write
in class Light
java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
read
in interface Savable
read
in class Light
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |