OpenGLPrakt --> cObject --> cVisibleObject --> cInteractiveObject --> cWater
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.
tsOscillationCenter | [public] | a structure describing a center of an oscillation |
public cWater ( cEventDispatcher * disp , const char * name = NULL ) ;
default constructor w/ optional object name
name | name of object (optional) |
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
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) |
public cWater ( cEventDispatcher * disp , GLfloat size_x , GLfloat size_y , GLfloat max_amp , const char * name = NULL ) ;
default constructor
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) |
public cWater ( cEventDispatcher * disp , GLfloat size_x , GLfloat size_y , GLfloat max_amp , int resolution , const char * name = NULL ) ;
default constructor
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) |
public virtual ~ cWater ( ) ;
destructor
protected GLuint mDisplayList
ID of display list which contains the surface
protected GLfloat mSizeX
side length of plane
protected GLfloat mSizeY
protected GLfloat mMaxAmp
maximum amplitude
protected GLfloat mAmpScale
current amplitude scaling factor for satisfying MaxAmp criterion
protected int mResolution
resolution of surface, if given
protected GLfloat mTexFromX
texture domain to use
protected GLfloat mTexToX
protected GLfloat mTexFromY
protected GLfloat mTexToY
protected bool mRecalculationNeeded
have we animated the surface? -> need recalculation?
protected GLfloat mTimeStamp
counter for animation events
protected int mOscillationNo
number of active oscillations
protected tsOscillationCenter * mOscillations
parameters of all oscillations
public virtual int Init ( ) ;
initialization function
public virtual void SetTextureDomain ( GLfloat x_min , GLfloat x_max , GLfloat y_min , GLfloat y_max ) ;
set texture coordinates to use
x_min | from-x |
x_max | to-x |
y_min | from-y |
y_max | to-y |
public virtual void AddOscillation ( const tsOscillationCenter & osc ) ;
add a new oscillating source
src | tsOscillationCenter w/ position, amplitude and freq. |
public virtual int ReceiveEvent ( const cEvent & event ) ;
event receiver - we listen for animation events
protected virtual void DrawThisObject ( ) ;
drawing function
protected virtual const char * GetDefaultName ( ) const ;
return class name
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.