public class DistantLight extends Light
DistantLight
is one which has direction but no position,
such as the Sun (for practical purposes) when it strikes Earth.
The direction of the DistantLight
is given by a Vector3D
.
The default direction for a DistantLight
is [-1,-1,-1], i.e.,
coming from the first octant toward the origin.
DistantLight
s also have all the properties inherited from abstract
base class Light
.
Constructor and Description |
---|
DistantLight()
Constructs a
DistantLight with direction [-1,-1,-1] and with
all other properties as defined by the no-argument constructor of class
Light . |
Modifier and Type | Method and Description |
---|---|
Vector3D |
getDirection()
Returns a
Vector3D giving the direction of this DistantLight . |
void |
setDirection(Vector3D dir)
Sets the direction of this
DistantLight to the direction
of the specified Vector3D . |
java.lang.String |
toString()
Returns a String representation of this
DistantLight . |
getAmbient, getDiffuse, getName, getSpecular, setAmbient, setDiffuse, setName, setSpecular
public DistantLight()
DistantLight
with direction [-1,-1,-1] and with
all other properties as defined by the no-argument constructor of class
Light
.public Vector3D getDirection()
public void setDirection(Vector3D dir)
public java.lang.String toString()
DistantLight
.
The returned String is formed by concatenating to the result of the
method Light.toString()
the result of the method Vector3D.toString()
.