OpenGLPrakt --> cObject --> cVisibleObject --> cInteractiveObject --> cWater

class cWater
    extends cInteractiveObject as public

Water surface object.

This object displays a water surface. The surface extends from (-size_x/2,-size_y/2,-max_amp) to (size_x/2, size_y/2, max_amp) Texture coordinates are generated also. (default: (0.0,0.0)-(1.0,1.0))

The maximum amplitude defaults to 1.0, the default resolution is 8 subdivisions per side, which means 128 triangles.

Source:
../src/cWater.hh:31

Nested Classes, Structs and Unions:
tsOscillationCenter [public] a structure describing a center of an oscillation

Constructors Index

cWater
[public] default constructor w/ optional object name
cWater
[public] constructor w/ optional size and object name
cWater
[public] default constructor
cWater
[public] default constructor
~cWater
[public] destructor


Variables Index

mAmpScale
[protected] current amplitude scaling factor for satisfying MaxAmp criterion
mDisplayList
[protected] ID of display list which contains the surface
mMaxAmp
[protected] maximum amplitude
mOscillationNo
[protected] number of active oscillations
mOscillations
[protected] parameters of all oscillations
mRecalculationNeeded
[protected] have we animated the surface? -> need recalculation?
mResolution
[protected] resolution of surface, if given
mSizeX
[protected] side length of plane
mSizeY
[protected]
mTexFromX
[protected] texture domain to use
mTexFromY
[protected]
mTexToX
[protected]
mTexToY
[protected]
mTimeStamp
[protected] counter for animation events


Methods Index

AddOscillation
[public] add a new oscillating source
CalculateWater
[protected] calculate the water surface
DrawThisObject
[protected] drawing function
GetDefaultName
[protected] return class name
Init
[public] initialization function
ReceiveEvent
[public] event receiver - we listen for animation events
SetTextureDomain
[public] set texture coordinates to use


Constructors

cWater

public cWater ( cEventDispatcher * disp ,
                const char * name = NULL ) ;

default constructor w/ optional object name

Parameters:
name name of object (optional)

cWater

public cWater ( cEventDispatcher * disp ,
                GLfloat size_x ,
                GLfloat size_y ,
                const char * name = NULL ) ;

constructor w/ optional size and object name

default max_amp of 1.0 is used

Parameters:
size_x (GLdouble) x side length of water (default: 1.0)
size_y (GLdouble) y side length of water (default: 1.0)
name name of object (optional)

cWater

public cWater ( cEventDispatcher * disp ,
                GLfloat size_x ,
                GLfloat size_y ,
                GLfloat max_amp ,
                const char * name = NULL ) ;

default constructor

Parameters:
size_x (GLdouble) x side length of water (default: 1.0)
size_y (GLdouble) y side length of water (default: 1.0)
max_amp maximum amplitude
name name of object (optional)

cWater

public cWater ( cEventDispatcher * disp ,
                GLfloat size_x ,
                GLfloat size_y ,
                GLfloat max_amp ,
                int resolution ,
                const char * name = NULL ) ;

default constructor

Parameters:
size_x (GLdouble) x side length of water (default: 1.0)
size_y (GLdouble) y side length of water (default: 1.0)
max_amp maximum amplitude
resolution subdivisions per side (default: 8)
name name of object (optional)

cWater

public virtual ~ cWater ( ) ;

destructor


Variables

mDisplayList

protected GLuint mDisplayList

ID of display list which contains the surface

mSizeX

protected GLfloat mSizeX

side length of plane

mSizeY

protected GLfloat mSizeY

mMaxAmp

protected GLfloat mMaxAmp

maximum amplitude

mAmpScale

protected GLfloat mAmpScale

current amplitude scaling factor for satisfying MaxAmp criterion

mResolution

protected int mResolution

resolution of surface, if given

mTexFromX

protected GLfloat mTexFromX

texture domain to use

mTexToX

protected GLfloat mTexToX

mTexFromY

protected GLfloat mTexFromY

mTexToY

protected GLfloat mTexToY

mRecalculationNeeded

protected bool mRecalculationNeeded

have we animated the surface? -> need recalculation?

mTimeStamp

protected GLfloat mTimeStamp

counter for animation events

mOscillationNo

protected int mOscillationNo

number of active oscillations

mOscillations

protected tsOscillationCenter * mOscillations

parameters of all oscillations


Methods

Init

public virtual int Init ( ) ;

initialization function

SetTextureDomain

public virtual void SetTextureDomain ( GLfloat x_min ,
                                       GLfloat x_max ,
                                       GLfloat y_min ,
                                       GLfloat y_max ) ;

set texture coordinates to use

Parameters:
x_min from-x
x_max to-x
y_min from-y
y_max to-y

AddOscillation

public virtual void AddOscillation ( const tsOscillationCenter & osc ) ;

add a new oscillating source

Parameters:
src tsOscillationCenter w/ position, amplitude and freq.

ReceiveEvent

public virtual int ReceiveEvent ( const cEvent & event ) ;

event receiver - we listen for animation events

Return:
0 - event accepted, -1 - event not accepted

DrawThisObject

protected virtual void DrawThisObject ( ) ;

drawing function

GetDefaultName

protected virtual const char * GetDefaultName ( ) const ;

return class name

CalculateWater

protected virtual void CalculateWater ( ) ;

calculate the water surface


This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.

Click here to return to the top of the page.