public class SpotLight extends AbstractLight
Modifier and Type | Field and Description |
---|---|
private double |
lightX
The light position, in user space
|
private double |
lightY
The light position, in user space
|
private double |
lightZ
The light position, in user space
|
private double |
limitingConeAngle
Limiting cone angle
|
private double |
limitingCos
Limiting cone angle
|
private double |
pointAtX
Point where the light points to
|
private double |
pointAtY
Point where the light points to
|
private double |
pointAtZ
Point where the light points to
|
private double[] |
S
Light direction vector
|
private double |
specularExponent
Specular exponent (light focus)
|
Constructor and Description |
---|
SpotLight(double lightX,
double lightY,
double lightZ,
double pointAtX,
double pointAtY,
double pointAtZ,
double specularExponent,
double limitingConeAngle,
java.awt.Color lightColor) |
Modifier and Type | Method and Description |
---|---|
void |
getLight(double x,
double y,
double z,
double[] L)
Computes the light vector in (x, y, z)
|
void |
getLight4(double x,
double y,
double z,
double[] L)
computes light vector in (x, y, z).
|
double |
getLightBase(double x,
double y,
double z,
double[] L)
Computes the light vector in (x, y, z)
|
double[][] |
getLightRow4(double x,
double y,
double dx,
int width,
double[][] z,
double[][] lightRow) |
double |
getLightX() |
double |
getLightY() |
double |
getLightZ() |
double |
getLimitingConeAngle() |
double |
getPointAtX() |
double |
getPointAtY() |
double |
getPointAtZ() |
double |
getSpecularExponent() |
boolean |
isConstant() |
getColor, getLightMap, getLightRow, setColor, sRGBToLsRGB
private double lightX
private double lightY
private double lightZ
private double pointAtX
private double pointAtY
private double pointAtZ
private double specularExponent
private double limitingConeAngle
private double limitingCos
private final double[] S
public SpotLight(double lightX, double lightY, double lightZ, double pointAtX, double pointAtY, double pointAtZ, double specularExponent, double limitingConeAngle, java.awt.Color lightColor)
public double getLightX()
public double getLightY()
public double getLightZ()
public double getPointAtX()
public double getPointAtY()
public double getPointAtZ()
public double getSpecularExponent()
public double getLimitingConeAngle()
public boolean isConstant()
isConstant
in interface Light
isConstant
in class AbstractLight
public final double getLightBase(double x, double y, double z, double[] L)
x
- x-axis coordinate where the light should be computedy
- y-axis coordinate where the light should be computedz
- z-axis coordinate where the light should be computedL
- array of length 3 where the result is storedpublic final void getLight(double x, double y, double z, double[] L)
x
- x-axis coordinate where the light should be computedy
- y-axis coordinate where the light should be computedz
- z-axis coordinate where the light should be computedL
- array of length 3 where the result is stored,
x,y,z are scaled by light intensity.public final void getLight4(double x, double y, double z, double[] L)
x
- x-axis coordinate where the light should be computedy
- y-axis coordinate where the light should be computedz
- z-axis coordinate where the light should be computedL
- array of length 4 where result is stored.
0,1,2 are x,y,z respectively of light vector (normalized).
3 is the intensity of the light at this point.public double[][] getLightRow4(double x, double y, double dx, int width, double[][] z, double[][] lightRow)