Waterflow
Visualize water in terrain
Water Class Reference

Specialized version of height map that handles multiple drawing programs. More...

#include <myDrawable.h>

Inherits HeightMap.

List of all members.

Public Member Functions

 Water (GLuint *drawPrograms, GLuint *sizes, GLfloat maxHeight, GLuint inputHeightBuffer)
 Simple contructor.

Static Public Member Functions

static void TW_CALL GetDrawProgramCB (void *value, void *clientData)
 Used by AntTweakBar to get current program used for drawing.
static void TW_CALL GetMaxDepthCB (void *value, void *clientData)
 Used by AntTweakBar to get max depth.
static void TW_CALL GetTransparencyCB (void *value, void *clientData)
 Used by AntTweakBar to get which texture is in use.
static void TW_CALL SetDrawProgramCB (const void *value, void *clientData)
 Used by AntTweakBar to set which program should be used to draw.
static void TW_CALL SetMaxDepthCB (const void *value, void *clientData)
 Used by AntTweakBar to set max depth.
static void TW_CALL SetTransparencyCB (const void *value, void *clientData)
 Used by AntTweakBar to set which texture to use.

Private Member Functions

void initDepthProgram ()
 For water some additional parameters needs to be set.

Private Attributes

GLfloat maxDepth
 Depth drawn as black in the depth shader.
GLuint programs [2]
 Program to toggle between (1 = normal, 2 = depth shader)
GLint programToDraw
 Which program to use when drawing.
GLfloat transparency
 Tranparancy of the water.
GLuint vaos [2]
 Which VAO to use for drawing.

Detailed Description

Specialized version of height map that handles multiple drawing programs.

Currently has the possibility of drawing two different programs and some special parameters.

Todo:
Could generalize this to the original height map class

Definition at line 167 of file myDrawable.h.


Constructor & Destructor Documentation

Water::Water ( GLuint *  drawPrograms,
GLuint *  sizes,
GLfloat  maxHeight,
GLuint  inputHeightBuffer 
)

Simple contructor.

Takes a few parameters for initial setup of the size of the height map data.

Parameters:
drawProgramsThe initial program to use for drawing the model
sizesWidth and Height of the data
maxHeightThe height map maximum height (low assumed to be 0)
inputHeightBufferBuffer ID of the height map data

Definition at line 348 of file myDrawable.cpp.


Member Function Documentation

void Water::initDepthProgram ( ) [private]

For water some additional parameters needs to be set.

Creates extra VAO's for use with the other programs, still references the same buffers though but for depth drawing we done need normals.

Definition at line 367 of file myDrawable.cpp.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations