|
||||||||||
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.PointLight
public class PointLight
Represents a point light. A point light emits light from a given position into all directions in space. E.g a lamp or a bright effect. Point light positions are in world space.
In addition to a position, point lights also have a radius which can be used to attenuate the influence of the light depending on the distance between the light and the effected object.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jme3.light.Light |
---|
Light.Type |
Field Summary | |
---|---|
protected float |
invRadius
|
protected Vector3f |
position
|
protected float |
radius
|
Fields inherited from class com.jme3.light.Light |
---|
color, enabled, lastDistance, name |
Constructor Summary | |
---|---|
PointLight()
|
Method Summary | |
---|---|
void |
computeLastDistance(Spatial owner)
Used internally to compute the last distance value. |
float |
getInvRadius()
for internal use only |
Vector3f |
getPosition()
Returns the world space position of the light. |
float |
getRadius()
Returns the radius of the light influence. |
Light.Type |
getType()
Returns the light type |
void |
read(JmeImporter im)
|
void |
setPosition(Vector3f position)
Set the world space position of the light. |
void |
setRadius(float radius)
Set the radius 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 float radius
protected float invRadius
Constructor Detail |
---|
public PointLight()
Method Detail |
---|
public void computeLastDistance(Spatial owner)
Light
computeLastDistance
in class Light
public Vector3f getPosition()
setPosition(com.jme3.math.Vector3f)
public void setPosition(Vector3f position)
position
- the world space position of the light.public float getRadius()
public void setRadius(float radius)
Setting a non-zero radius indicates the light should use attenuation. If a pixel's distance to this light's position is greater than the light's radius, then the pixel will not be effected by this light, if the distance is less than the radius, then the magnitude of the influence is equal to distance / radius.
radius
- the radius of the light influence.
java.lang.IllegalArgumentException
- If radius is negativepublic float getInvRadius()
public Light.Type getType()
Light
getType
in class Light
Light.Type
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 |