|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjme.locale.external.feature.WaterMesh
WaterMesh
creates a mesh that represents water height values.
This mesh contains a wave origin that causes ripples to flow outward.
Constructor Summary | |
WaterMesh(int size,
int spacing,
float amplitude)
Constructor instantiates a WaterMesh object. |
Method Summary | |
void |
render()
render displays the water mesh to the view port. |
void |
setBaseHeight(float height)
setBaseHeight sets the height of the water. |
void |
setOrigin(int x,
int z)
setOrigin sets the originating point of the water mesh. |
void |
setTexture(java.lang.String filename)
setTexture sets the texture used for the watermesh. |
void |
setWindSpeed(int speed)
setWindSpeed sets the speed of the winds that generate
the waves. |
void |
update(float time)
update sets the coordinates of the mesh to properly
simulate the rise and fall of waves. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WaterMesh(int size, int spacing, float amplitude)
WaterMesh
object. The attributes
of the water mesh are defined as the passed parameters.
size
- the size of the mesh, where the total area is defined as
size x size.spacing
- defines the distance between each vertex.amplitude
- defines the amount a vertex can travel along the
y axis.
MonkeyGLException
- is thrown if water mesh is created before
the OpenGL context.
MonkeyRuntimeException
- if size is negative.Method Detail |
public void setTexture(java.lang.String filename)
setTexture
sets the texture used for the watermesh.
filename
- the image file.public void setBaseHeight(float height)
setBaseHeight
sets the height of the water.
height
- the height of the water.public void setOrigin(int x, int z)
setOrigin
sets the originating point of the water mesh.
x
- the x coordinate of the origin.z
- the y coordinate of the origin.public void setWindSpeed(int speed)
setWindSpeed
sets the speed of the winds that generate
the waves.
speed
- the speed of the winds, which generated the waves.public void update(float time)
update
sets the coordinates of the mesh to properly
simulate the rise and fall of waves.
update
in interface Water
time
- the time between frames.public void render()
render
displays the water mesh to the view port.
render
in interface Water
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |