public abstract class Light extends java.lang.Object implements Savable, java.lang.Cloneable
All light source types have a color.
Modifier and Type | Class and Description |
---|---|
static class |
Light.Type
Describes the light type.
|
Modifier and Type | Field and Description |
---|---|
protected ColorRGBA |
color |
protected boolean |
enabled |
protected float |
lastDistance
Used in LightList for caching the distance
to the owner spatial.
|
protected java.lang.String |
name
The light name.
|
Modifier | Constructor and Description |
---|---|
protected |
Light() |
protected |
Light(ColorRGBA color) |
Modifier and Type | Method and Description |
---|---|
Light |
clone() |
protected abstract void |
computeLastDistance(Spatial owner)
Used internally to compute the last distance value.
|
ColorRGBA |
getColor()
Returns the color of the light.
|
java.lang.String |
getName()
Return the light name.
|
abstract Light.Type |
getType()
Returns the light type
|
abstract boolean |
intersectsBox(BoundingBox box,
TempVars vars)
Determines if the light intersects with the given bounding box.
|
abstract boolean |
intersectsFrustum(Camera camera,
TempVars vars)
Determines if the light intersects with the given camera frustum.
|
abstract boolean |
intersectsSphere(BoundingSphere sphere,
TempVars vars)
Determines if the light intersects with the given bounding sphere.
|
boolean |
isEnabled()
Returns true if this light is enabled.
|
boolean |
isFrustumCheckNeeded() |
boolean |
isIntersectsFrustum() |
void |
read(JmeImporter im) |
void |
setColor(ColorRGBA color)
Sets the light color.
|
void |
setEnabled(boolean enabled)
Set to false in order to disable a light and have it filtered out from being included in rendering.
|
void |
setFrustumCheckNeeded(boolean frustumCheckNeeded) |
void |
setIntersectsFrustum(boolean intersectsFrustum) |
void |
setName(java.lang.String name)
This method sets the light name.
|
void |
write(JmeExporter ex) |
protected ColorRGBA color
protected transient float lastDistance
protected boolean enabled
protected java.lang.String name
protected Light()
protected Light(ColorRGBA color)
public ColorRGBA getColor()
public void setName(java.lang.String name)
name
- the light namepublic java.lang.String getName()
public void setColor(ColorRGBA color)
color
- the light color.public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- true to enable and false to disable the light.public boolean isFrustumCheckNeeded()
public void setFrustumCheckNeeded(boolean frustumCheckNeeded)
public boolean isIntersectsFrustum()
public void setIntersectsFrustum(boolean intersectsFrustum)
public abstract boolean intersectsBox(BoundingBox box, TempVars vars)
For non-local lights, such as directional lights
,
ambient lights
, or point lights
without influence radius, this method should always return true.
box
- The box to check intersection against.vars
- TempVars in case it is needed.public abstract boolean intersectsSphere(BoundingSphere sphere, TempVars vars)
For non-local lights, such as directional lights
,
ambient lights
, or point lights
without influence radius, this method should always return true.
sphere
- The sphere to check intersection against.vars
- TempVars in case it is needed.public abstract boolean intersectsFrustum(Camera camera, TempVars vars)
directional lights
,
ambient lights
, or point lights
without influence radius, this method should always return true.camera
- The camera frustum to check intersection against.vars
- TempVars in case it is needed.public Light clone()
clone
in class java.lang.Object
public void write(JmeExporter ex) throws java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
protected abstract void computeLastDistance(Spatial owner)
owner
- the Spatial whose distance is to be determinedpublic abstract Light.Type getType()
Light.Type