|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CWaterHeightMap Class Reference#include <water_height_map.h>
Inheritance diagram for NL3D::CWaterHeightMap:
List of all members.
Public Methods |
void | animate (float deltaT) |
| Animate this water pool. More...
|
void | setSize (uint32 size) |
| Set this quad dimension. More...
|
uint32 | getSize (void) const |
| return the size of the height map. More...
|
void | setUserPos (sint x, sint y) |
| Set the userPos (relative to the height map coordinates). More...
|
void | getUserPos (sint &x, sint &y) const |
| Retrieve the use pos NB: this may be different from the params of a former call to setUserPos (should have been taken in account). More...
|
void | perturbate (sint x, sint y, sint radius, float intensity) |
| create a perturbation in the height map. More...
|
virtual void | perturbate (const NLMISC::CVector2f &pos, float strenght, float radius) |
| Inherited from UWaterHeightMap. More...
|
void | perturbatePoint (sint x, sint y, float intensity) |
| create a point perturbation in the height map. More...
|
virtual void | perturbatePoint (const NLMISC::CVector2f &pos, float strenght) |
| Inherited from UWaterHeightMap. More...
|
virtual float | getHeight (const NLMISC::CVector2f &pos) |
| Inherited from UWaterHeightMap. More...
|
float * | getPointer (void) |
| get a pointer on the current buffer. More...
|
float * | getPrevPointer (void) |
| get a pointer on the previous buffer. More...
|
float | getBufferRatio () const |
| get the ratio between the previous and the current buffer. More...
|
void | enableWaves (bool enabled=true) |
| enable automatic waves generation. More...
|
bool | areWavesEnabled () const |
| test wheter automatic waves generation is enabled. More...
|
void | setWaves (float intensity, float period, uint radius, bool border) |
| Tells this height map the params to automatically generate waves. More...
|
float | getWaveIntensity () const |
| get the intensity of waves. More...
|
float | getWavePeriod () const |
| get the period of waves. More...
|
uint32 | getWaveImpulsionRadius () const |
| radius of impulsion for the waves. More...
|
bool | getBorderWaves () const |
| Test whether waves are enabled on the border. More...
|
void | setDamping (float damping) |
| damping. More...
|
float | getDamping () const |
void | setFilterWeight (float filterWeight) |
| filter weight. More...
|
float | getFilterWeight () const |
void | setUnitSize (float unitSize) |
| water unit size. More...
|
float | getUnitSize () const |
| get the size in meter of a heightmap texel. More...
|
void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
| serial the pools data's. More...
|
void | setName (const std::string &name) |
| Set this pool name. More...
|
const std::string & | getName () const |
| Get this pool name. More...
|
| CWaterHeightMap () |
virtual | ~CWaterHeightMap () |
void | setPropagationTime (float time) |
| Set the propagation time. This is the time needed to go from one unit to one other in the height map. More...
|
TAnimationTime | getPropagationTime () const |
| Get the propagation time. More...
|
Public Attributes |
sint64 | Date |
| the last update date. More...
|
Private Types |
typedef std::vector< float > | TFloatVect |
typedef std::vector< NLMISC::CVector2f > | TFloat2Vect |
Private Methods |
void | animateWaves (float deltaT) |
void | updateUserPos () |
void | animatePart (float startTime, float endTime) |
void | propagate (uint startLine, uint endLine) |
| Perform water propagation on this quad. More...
|
void | filter (uint startLine, uint endLine) |
| apply a filter on the height field. More...
|
void | swapBuffers (float deltaT) |
| swap the height maps. It must be called once propagation and filtering have been performed. More...
|
void | clearArea (uint8 currMap, sint x, sint y, sint width, sint height) |
| clear an area of the water height map (has clipping, but no wrapping). More...
|
void | clearZone (sint x, sint y, sint width, sint height) |
void | makeCpy (uint buffer, uint dX, uint dY, uint sX, uint sY, uint width, uint height) |
| displace the height map, when a boundary has been reached. More...
|
void | clearBorder (uint currMap) |
| clear the borders. More...
|
Private Attributes |
std::string | _Name |
bool | _WavesEnabled |
float | _Damping |
float | _FilterWeight |
float | _UnitSize |
float | _WaveIntensity |
float | _WavePeriod |
uint32 | _WaveImpulsionRadius |
bool | _BorderWaves |
float | _EmitEllapsedTime |
float | _PropagateEllapsedTime |
TAnimationTime | _PropagationTime |
uint | _X |
uint | _Y |
uint | _NewX |
uint | _NewY |
TFloatVect | _Map [NumWaterMap] |
uint8 | _CurrMap |
uint32 | _Size |
Friends |
class | CWaterPoolManager |
Member Typedef Documentation
typedef std::vector<float> NL3D::CWaterHeightMap::TFloatVect [private]
|
|
Constructor & Destructor Documentation
NL3D::CWaterHeightMap::CWaterHeightMap |
( |
|
) |
|
|
virtual NL3D::CWaterHeightMap::~CWaterHeightMap |
( |
|
) |
[inline, virtual] |
|
Member Function Documentation
void NL3D::CWaterHeightMap::animate |
( |
float |
deltaT |
) |
|
|
void NL3D::CWaterHeightMap::animatePart |
( |
float |
startTime, |
|
|
float |
endTime |
|
) |
[private] |
|
void NL3D::CWaterHeightMap::animateWaves |
( |
float |
deltaT |
) |
[private] |
|
bool NL3D::CWaterHeightMap::areWavesEnabled |
( |
|
) |
const [inline] |
|
void NL3D::CWaterHeightMap::clearArea |
( |
uint8 |
currMap, |
|
|
sint |
x, |
|
|
sint |
y, |
|
|
sint |
width, |
|
|
sint |
height |
|
) |
[private] |
|
void NL3D::CWaterHeightMap::clearBorder |
( |
uint |
currMap |
) |
[private] |
|
void NL3D::CWaterHeightMap::clearZone |
( |
sint |
x, |
|
|
sint |
y, |
|
|
sint |
width, |
|
|
sint |
height |
|
) |
[private] |
|
void NL3D::CWaterHeightMap::enableWaves |
( |
bool |
enabled = true |
) |
[inline] |
|
void NL3D::CWaterHeightMap::filter |
( |
uint |
startLine, |
|
|
uint |
endLine |
|
) |
[private] |
|
|
apply a filter on the height field.
Definition at line 399 of file water_height_map.cpp.
References _CurrMap, _FilterWeight, _Map, _Size, _X, _Y, min, nlassert, NL3D::NumWaterMap, offset, x, and y.
Referenced by animatePart. |
bool NL3D::CWaterHeightMap::getBorderWaves |
( |
|
) |
const [inline] |
|
float NL3D::CWaterHeightMap::getBufferRatio |
( |
|
) |
const [inline] |
|
float NL3D::CWaterHeightMap::getDamping |
( |
|
) |
const [inline] |
|
float NL3D::CWaterHeightMap::getFilterWeight |
( |
|
) |
const [inline] |
|
|
Inherited from UWaterHeightMap.
Get the height of water at the given location.
Implements NL3D::UWaterHeightMap.
Definition at line 726 of file water_height_map.cpp.
References _Size, _UnitSize, _X, _Y, NL3D::BilinFilter, getBufferRatio, getPointer, getPrevPointer, offset, NLMISC::CVector2f::x, and NLMISC::CVector2f::y. |
const std::string& NL3D::CWaterHeightMap::getName |
( |
void |
|
) |
const [inline] |
|
float* NL3D::CWaterHeightMap::getPointer |
( |
void |
|
) |
[inline] |
|
float* NL3D::CWaterHeightMap::getPrevPointer |
( |
void |
|
) |
[inline] |
|
TAnimationTime NL3D::CWaterHeightMap::getPropagationTime |
( |
|
) |
const [inline] |
|
uint32 NL3D::CWaterHeightMap::getSize |
( |
void |
|
) |
const [inline] |
|
float NL3D::CWaterHeightMap::getUnitSize |
( |
|
) |
const [inline, virtual] |
|
void NL3D::CWaterHeightMap::getUserPos |
( |
sint & |
x, |
|
|
sint & |
y |
|
) |
const |
|
|
Retrieve the use pos NB: this may be different from the params of a former call to setUserPos (should have been taken in account).
Definition at line 347 of file water_height_map.cpp.
References _X, _Y, x, and y. |
uint32 NL3D::CWaterHeightMap::getWaveImpulsionRadius |
( |
|
) |
const [inline] |
|
float NL3D::CWaterHeightMap::getWaveIntensity |
( |
|
) |
const [inline] |
|
float NL3D::CWaterHeightMap::getWavePeriod |
( |
|
) |
const [inline] |
|
void NL3D::CWaterHeightMap::perturbate |
( |
const NLMISC::CVector2f & |
pos, |
|
|
float |
strenght, |
|
|
float |
radius |
|
) |
[virtual] |
|
void NL3D::CWaterHeightMap::perturbate |
( |
sint |
x, |
|
|
sint |
y, |
|
|
sint |
radius, |
|
|
float |
intensity |
|
) |
|
|
|
create a perturbation in the height map.
Definition at line 575 of file water_height_map.cpp.
References _CurrMap, _Map, _Size, _X, _Y, nlassert, NL3D::NumWaterMap, TFloatVect, v, x, and y.
Referenced by animateWaves, and perturbate. |
void NL3D::CWaterHeightMap::perturbatePoint |
( |
const NLMISC::CVector2f & |
pos, |
|
|
float |
strenght |
|
) |
[virtual] |
|
void NL3D::CWaterHeightMap::perturbatePoint |
( |
sint |
x, |
|
|
sint |
y, |
|
|
float |
intensity |
|
) |
|
|
void NL3D::CWaterHeightMap::propagate |
( |
uint |
startLine, |
|
|
uint |
endLine |
|
) |
[private] |
|
|
Perform water propagation on this quad.
You should call swapBuffers after this, or after calling filter. -
Parameters:
-
damping |
The attenuation factor used for propagation. |
Definition at line 356 of file water_height_map.cpp.
References _CurrMap, _Damping, _Map, _Size, _X, _Y, clearBorder, min, nlassert, NL3D::NumWaterMap, offset, x, and y.
Referenced by animatePart. |
void NL3D::CWaterHeightMap::setDamping |
( |
float |
damping |
) |
[inline] |
|
void NL3D::CWaterHeightMap::setFilterWeight |
( |
float |
filterWeight |
) |
[inline] |
|
void NL3D::CWaterHeightMap::setName |
( |
const std::string & |
name |
) |
[inline] |
|
void NL3D::CWaterHeightMap::setPropagationTime |
( |
float |
time |
) |
|
|
void NL3D::CWaterHeightMap::setSize |
( |
uint32 |
size |
) |
|
|
void NL3D::CWaterHeightMap::setUnitSize |
( |
float |
unitSize |
) |
[inline] |
|
void NL3D::CWaterHeightMap::setUserPos |
( |
sint |
x, |
|
|
sint |
y |
|
) |
|
|
|
Set the userPos (relative to the height map coordinates).
This is needed because a height map can't be used with large surface (such as a sea). As a consequence, the height map is only valid below the user (e.g from user.x - 0.5 * size to user.x + 0.5 *size). When setPos is called, and if a move has occured, new area of the height field are set to 0 The pos set will be taken in account when buffers have been swapped (e.g when the propagation time as ellapsed)
Definition at line 339 of file water_height_map.cpp.
References _NewX, _NewY, x, and y. |
void NL3D::CWaterHeightMap::setWaves |
( |
float |
intensity, |
|
|
float |
period, |
|
|
uint |
radius, |
|
|
bool |
border |
|
) |
|
|
|
Tells this height map the params to automatically generate waves.
They are generated as perturbation on the border of the field -
Parameters:
-
intensity |
The intensity of the waves. 0 disable waves \period the time ellapsed between each waves \radius the radius od the impulsion of the waves to be created \border true if waves should only be generated on the border of height map, (actually, where waves can't be seen because of distance, this avoid to see the impulsion) |
Definition at line 667 of file water_height_map.cpp.
References _BorderWaves, _WaveImpulsionRadius, _WaveIntensity, _WavePeriod, and border. |
void NL3D::CWaterHeightMap::swapBuffers |
( |
float |
deltaT |
) |
[private] |
|
void NL3D::CWaterHeightMap::updateUserPos |
( |
|
) |
[private] |
|
|
Definition at line 78 of file water_height_map.cpp.
References _NewX, _NewY, _Size, _X, _Y, clearZone, makeCpy, min, nlassert, NL3D::NumWaterMap, x, and y.
Referenced by swapBuffers. |
Friends And Related Function Documentation
friend class CWaterPoolManager [friend]
|
|
Member Data Documentation
bool NL3D::CWaterHeightMap::_BorderWaves [private]
|
|
uint8 NL3D::CWaterHeightMap::_CurrMap [private]
|
|
float NL3D::CWaterHeightMap::_Damping [private]
|
|
float NL3D::CWaterHeightMap::_EmitEllapsedTime [private]
|
|
float NL3D::CWaterHeightMap::_FilterWeight [private]
|
|
std::string NL3D::CWaterHeightMap::_Name [private]
|
|
uint NL3D::CWaterHeightMap::_NewX [private]
|
|
uint NL3D::CWaterHeightMap::_NewY [private]
|
|
float NL3D::CWaterHeightMap::_PropagateEllapsedTime [private]
|
|
uint32 NL3D::CWaterHeightMap::_Size [private]
|
|
|
Definition at line 242 of file water_height_map.h.
Referenced by animatePart, animateWaves, clearArea, clearBorder, filter, getHeight, getSize, makeCpy, perturbate, perturbatePoint, propagate, setPropagationTime, setSize, and updateUserPos. |
float NL3D::CWaterHeightMap::_UnitSize [private]
|
|
uint32 NL3D::CWaterHeightMap::_WaveImpulsionRadius [private]
|
|
float NL3D::CWaterHeightMap::_WaveIntensity [private]
|
|
float NL3D::CWaterHeightMap::_WavePeriod [private]
|
|
bool NL3D::CWaterHeightMap::_WavesEnabled [private]
|
|
uint NL3D::CWaterHeightMap::_X [private]
|
|
uint NL3D::CWaterHeightMap::_Y [private]
|
|
sint64 NL3D::CWaterHeightMap::Date
|
|
The documentation for this class was generated from the following files:
|
|