Bitmap Camera Example Scene

Class Water

java.lang.Object
  |
  +--Water

public class Water
extends java.lang.Object

Implements the water surface, and the bitmap camera for generating the reflection image


Constructor Summary
Water(WTStage s, WTCamera c, WTGroup t)
          Constructor
 
Method Summary
 void destroy()
          Class destructor
 void onLoadComplete(WTObject o)
          Once the mesh file has loaded, onLoadComplete constructs the water model from the mesh file, and builds out the vector of vertex adjacency vectors, used to track ripple paths.
 void splash(int vertIndex)
          Generates the original wave in the pond.
 void update(float deltaTime)
          Called from the main render loop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Water

public Water(WTStage s,
             WTCamera c,
             WTGroup t)
Constructor

Parameters:
s - The main stage
c - The main rendering camera
t - The level, which can be a WTStudio level, or an actor cast to a group. This object must be fully loaded before the constructor is called.
Method Detail

destroy

public void destroy()
Class destructor


onLoadComplete

public void onLoadComplete(WTObject o)
Once the mesh file has loaded, onLoadComplete constructs the water model from the mesh file, and builds out the vector of vertex adjacency vectors, used to track ripple paths. The bitmap camera and surface shader are also set up here.


splash

public void splash(int vertIndex)
Generates the original wave in the pond.


update

public void update(float deltaTime)
Called from the main render loop. This function adjusts velocities for each vertex based its position in relation to the average height of the vertices surrounding it, and then applies its velocity to current position. The position of the bitmap camera is also set here.

Parameters:
deltaTime - The time in seconds since the last render

Bitmap Camera Example Scene