C# Class Reactor.Water

Drawable game component for water rendering. Renders the scene to reflection and refraction maps that are projected onto the water plane and are distorted based on two scrolling normal maps.
Show file Open project: reisergames/reactor-v1 Class Usage Examples

Public Methods

Method Description
Draw ( ) : void
Initialize ( ) : void
LoadContent ( ) : void
SetCamera ( Matrix viewProj, Vector3 pos ) : void

Set the ViewProjection matrix and position of the Camera.

Update ( ) : void
UpdateWaterMaps ( ) : void

Updates the reflection and refraction maps. Called on update.

Water ( ) : System

Private Methods

Method Description
GenTriGrid ( int numVertRows, int numVertCols, float dx, float dz, Vector3 center, Vector3 &verts, int &indices ) : void

Generates a grid of vertices to use for the water plane.

UpdateEffectParams ( ) : void

Updates effect parameters related to the water shader

Method Details

Draw() public method

public Draw ( ) : void
return void

Initialize() public method

public Initialize ( ) : void
return void

LoadContent() public method

public LoadContent ( ) : void
return void

SetCamera() public method

Set the ViewProjection matrix and position of the Camera.
public SetCamera ( Matrix viewProj, Vector3 pos ) : void
viewProj Matrix
pos Vector3
return void

Update() public method

public Update ( ) : void
return void

UpdateWaterMaps() public method

Updates the reflection and refraction maps. Called on update.
public UpdateWaterMaps ( ) : void
return void

Water() public method

public Water ( ) : System
return System