public abstract class Light
extends java.lang.Object
Constructor and Description |
---|
Light()
Constructs a
Light with default coefficients
ambient = {0,0,0,1}, diffuse = {1,1,1,1}, and specular = {1,1,1,1}
and a default name containing a unique trailing integer. |
Modifier and Type | Method and Description |
---|---|
float[] |
getAmbient()
Returns a float [] containing the ambient reflection coefficients of this Light.
|
float[] |
getDiffuse()
Returns the diffuse reflection coefficients of this Light.
|
java.lang.String |
getName()
Returns the name of this Light.
|
float[] |
getSpecular()
Returns the specular reflection coefficients of this Light.
|
void |
setAmbient(float[] amb)
Sets the ambient reflection coefficients of this Light to the specified
array of values.
|
void |
setDiffuse(float[] diff)
Sets the diffuse reflection coefficients of this Light to the specified
array of values.
|
void |
setName(java.lang.String newName)
Sets the name of this Light to the specified String.
|
void |
setSpecular(float[] spec)
Sets the specular reflection coefficients of this Light to the specified
array of values.
|
java.lang.String |
toString()
Returns a String representation of this Light, including the class name,
the Light's name, and the ambient, diffuse, and specular reflection
coefficients of the Light.
|
public Light()
Light
with default coefficients
ambient = {0,0,0,1}, diffuse = {1,1,1,1}, and specular = {1,1,1,1}
and a default name containing a unique trailing integer.public float[] getAmbient()
public void setAmbient(float[] amb)
public float[] getDiffuse()
public void setDiffuse(float[] diff)
public float[] getSpecular()
public void setSpecular(float[] spec)
public void setName(java.lang.String newName)
public java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object