|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjme.locale.external.feature.WaterPlane
WaterPlane
implements the Water
interface and
defines a water feature to be used with Terrain
levels. The
water is defined by a single quad with an applied texture and animation
values. The supported animation is the water plane rising and falling and
the texture sliding across the plane.
Constructor Summary | |
WaterPlane(int size,
float baseLevel,
float variation)
Constructor instantiates a new WaterPlane object. |
Method Summary | |
void |
render()
render renders a single quad with the set
texture, color and location. |
void |
setColor(Vector color)
setColor sets the color of the water texture. |
void |
setRepeat(float repeat)
setRepeat sets the number of times to repeat the
water texture across the quad. |
void |
setTexture(java.lang.String filename)
setTexture sets the texture for the water plane. |
void |
setTextureAnimation(float x,
float z)
setTextureAnimation denotes the amount to move
the texture across the water plane. |
void |
setTransparency(float transparency)
setTransparency sets the transparency or alpha
of the water plane. |
void |
setWaveSpeed(float speed)
setWaveSpeed sets the speed to move the water
plane up/down. |
void |
update(float time)
update updates the location of the water plane
and the setting for the texture. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WaterPlane(int size, float baseLevel, float variation)
WaterPlane
object.
The size of the plane is defined, as well as what elevation to
set it at and how much to vary the elevation.
size
- the size of the water plane.baseLevel
- the starting elevation of the plane.variation
- the amount to vary to height of the plane (base +- variation)
MonkeyRuntimeException
- if the size is less than zero.Method Detail |
public void setTexture(java.lang.String filename)
setTexture
sets the texture for the water plane.
filename
- the image file to load the texture from.
MonkeyRuntimeException
- if filename is null.public void setTextureAnimation(float x, float z)
setTextureAnimation
denotes the amount to move
the texture across the water plane. Both positive and negative
values are supported to allow for animation in all directions.
x
- the amount to move the texture on the x axis.z
- the amount to move the texture on the z axis.public void setWaveSpeed(float speed)
setWaveSpeed
sets the speed to move the water
plane up/down.
speed
- the speed to move the water plane on the y-axis.public void setColor(Vector color)
setColor
sets the color of the water texture.
color
- the color of the water texture.public void setTransparency(float transparency)
setTransparency
sets the transparency or alpha
of the water plane. Completely opaque is 1 and completely
transparent is 0.
transparency
- the level of transparency for the water plane.public void setRepeat(float repeat)
setRepeat
sets the number of times to repeat the
water texture across the quad. By default it will be repeated
16 times.
repeat
- the number of times to repeat the water texture.public void update(float time)
update
updates the location of the water plane
and the setting for the texture. The rise/fall of the plane's
height is adjusted as well as the texture coordinates for
animating.
update
in interface Water
time
- the time value for frame independant animations.public void render()
render
renders a single quad with the set
texture, color and location.
render
in interface Water
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |