|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.video.model.GradientColoration
public class GradientColoration
Coloration implementation that smoothly interpolates between two or more
different Materials, giving a nice shaded appearance.
GradientColoration is composed of three optional gradients that operate
along the three axes: X, Y, and Z. Each has a high limit, a low limit, a
high Material and a low Material. The limits are coordinates on the axis.
At any point greater than or equal to the high limit, the color is the high
material. At any point greater than or equal to the lower limit, it is the
low Material. At any point inbetween, the Material is interpolated, giving a
smooth gradation between the two colors.
Gradients along all three axes can be enabled at the same time, but the
appearance of such is usually not so interesting. It is usually best to only
enable one.
API Stability: Stable.
Constructor Summary | |
---|---|
GradientColoration()
Constructs a GradientColoration. |
Method Summary | |
---|---|
void |
draw(Context options,
int number,
float[] vertex)
Causes the Coloration to be drawn. |
boolean |
isXEnabled()
Provides the means to determine if the X gradient is enabled. |
boolean |
isYEnabled()
Provides the means to determine if the Y gradient is enabled. |
boolean |
isZEnabled()
Provides the means to determine if the Z gradient is enabled. |
void |
load(Hierarchy h)
Configures this Coloration from the given Hierarchy. |
void |
setXElements(float xHigh,
float xLow,
Material xHighMat,
Material xLowMat)
Sets the X elements of the coloration and also enables the X shading. |
void |
setXEnabled(boolean enable)
Enables or disables the X gradient. |
void |
setYElements(float yHigh,
float yLow,
Material yHighMat,
Material yLowMat)
Sets the Y elements of the coloration and also enables the Y shading. |
void |
setYEnabled(boolean enable)
Enables or disables the Y gradient. |
void |
setZElements(float zHigh,
float zLow,
Material zHighMat,
Material zLowMat)
Sets the Z elements of the coloration and also enables the Z shading. |
void |
setZEnabled(boolean enable)
Enables or disables the Z gradient. |
void |
store(Hierarchy h)
Stores this Coloration to the given Hierarchy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GradientColoration()
Method Detail |
---|
public void setXElements(float xHigh, float xLow, Material xHighMat, Material xLowMat)
xHigh
- the upper limit of the X gradations.xLow
- the lower limit of the X gradations.xHighMat
- the Material associated with the upper limit.xLowMat
- the Material associated with the lower limit.public void setYElements(float yHigh, float yLow, Material yHighMat, Material yLowMat)
yHigh
- the upper limit of the Y gradations.yLow
- the lower limit of the Y gradations.yHighMat
- the Material associated with the upper limit.yLowMat
- the Material associated with the lower limit.public void setZElements(float zHigh, float zLow, Material zHighMat, Material zLowMat)
zHigh
- the upper limit of the Z gradations.zLow
- the lower limit of the Z gradations.zHighMat
- the Material associated with the upper limit.zLowMat
- the Material associated with the lower limit.public void setXEnabled(boolean enable)
enable
- if true, the gradient is enabled. If false, it is
disabled.public boolean isXEnabled()
public void setYEnabled(boolean enable)
enable
- if true, the gradient is enabled. If false, it is
disabled.public boolean isYEnabled()
public void setZEnabled(boolean enable)
enable
- if true, the gradient is enabled. If false, it is
disabled.public boolean isZEnabled()
public void draw(Context options, int number, float[] vertex)
Coloration
draw
in interface Coloration
options
- the rendering options that are being used. Implementatons
of this interface should pay attention to the color related flags.number
- the current vertex number.vertex
- the current vertex position (x, y, and z coordinates).public void load(Hierarchy h)
Coloration
load
in interface Coloration
h
- the Hierarchy to configure this Coloration from.public void store(Hierarchy h)
Coloration
store
in interface Coloration
h
- the Hierarchy to store this Coloration to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |