|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CWaterShape Class ReferenceA water shape.
More...
#include <water_shape.h>
Inheritance diagram for NL3D::CWaterShape:
List of all members.
Geometry setup |
void | setWaterPoolID (uint32 id) |
| all water shape that have the same weter id will share the same height map for wave propagations. More...
|
uint32 | getWaterPoolID () const |
void | setShape (const NLMISC::CPolygon2D &poly) |
const NLMISC::CPolygon2D & | getShape () const |
| get the polygon used by this shape, in the object space. More...
|
void | getShapeInWorldSpace (NLMISC::CPolygon &poly) const |
| get the polygon this shape, in world space. More...
|
void | setWaveHeightFactor (float f) |
| Set a factor that is applied to waves height when they are displayed. default is 1. More...
|
float | getWaveHeightFactor () const |
| Get the factor that is applied to waves height when they are displayed. default is 1. More...
|
void | setScreenGridSize (uint32 x, uint32 y) |
| set the resolution for the grid that is used for tesselation. More...
|
void | setGridBorderSize (uint32 x, uint32 y) |
| set the size of borders. This is needed when water move is high, to avoid hole on the border of the screen. More...
|
uint32 | getScreenXGridSize () |
uint32 | getScreenYGridSize () |
uint32 | getXGridBorder () |
uint32 | getYGridBorder () |
Public Methods |
| NLMISC_DECLARE_CLASS (CWaterShape) |
virtual CTransformShape * | createInstance (CScene &scene) |
| inherited from IShape. More...
|
virtual bool | clip (const std::vector< CPlane > &pyramid, const CMatrix &worldMatrix) |
| inherited from IShape. More...
|
virtual void | render (IDriver *drv, CTransformShape *trans, bool opaquePass) |
| inherited from IShape. Does nothing. A new observer was set for that. More...
|
virtual void | getAABBox (NLMISC::CAABBox &bbox) const |
| inherited from IShape. More...
|
virtual float | getNumTriangles (float distance) |
| inherited from ishape. More...
|
virtual void | flushTextures (IDriver &driver) |
| inherited from ishape. More...
|
void | enableLightMapping (bool enable=true) |
| Tells this shape that it can replace its colormap by a lightmap during the zone lighting. More...
|
bool | isLightMappingEnabled () const |
|
| CWaterShape () |
| ctor. More...
|
| ~CWaterShape () |
| dtor. More...
|
void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
| serial this shape. More...
|
|
void | setEnvMap (uint index, ITexture *envMap) |
ITexture * | getEnvMap (uint index) |
const ITexture * | getEnvMap (uint index) const |
void | setHeightMap (uint k, ITexture *hm) |
| Set a height map, used to generate a bumpmap (useful if supported by hardware...) NB : not to be confused with the height map used to modify the geometry, it only modify texture. More...
|
ITexture * | getHeightMap (uint k) |
const ITexture * | getHeightMap (uint k) const |
void | setHeightMapScale (uint k, const NLMISC::CVector2f &scale) |
NLMISC::CVector2f | getHeightMapScale (uint k) const |
void | setHeightMapSpeed (uint k, const NLMISC::CVector2f &speed) |
NLMISC::CVector2f | getHeightMapSpeed (uint k) const |
void | setColorMap (ITexture *map) |
ITexture * | getColorMap () |
const ITexture * | getColorMap () const |
void | setColorMapMat (const NLMISC::CVector2f &column0, const NLMISC::CVector2f &column1, const NLMISC::CVector2f &pos) |
void | getColorMapMat (NLMISC::CVector2f &column0, NLMISC::CVector2f &column1, NLMISC::CVector2f &pos) |
|
void | setTransitionRatio (float percent) |
float | getTransitionRatio () const |
|
CTrackDefaultVector * | getDefaultPos () |
CTrackDefaultVector * | getDefaultScale () |
CTrackDefaultQuat * | getDefaultRotQuat () |
Private Methods |
void | computeBBox () |
void | envMapUpdate () |
void | updateHeightMapNormalizationFactors () |
Static Private Methods |
void | initVertexProgram () |
void | setupVertexBuffer () |
Private Attributes |
NLMISC::CAABBox | _BBox |
NLMISC::CPolygon2D | _Poly |
uint32 | _WaterPoolID |
NLMISC::CSmartPtr< ITexture > | _EnvMap [2] |
NLMISC::CSmartPtr< ITexture > | _BumpMap [2] |
NLMISC::CSmartPtr< ITexture > | _ColorMap |
NLMISC::CVector2f | _HeightMapScale [2] |
NLMISC::CVector2f | _HeightMapSpeed [2] |
NLMISC::CVector2f | _ColorMapMatColumn0 |
NLMISC::CVector2f | _ColorMapMatColumn1 |
NLMISC::CVector2f | _ColorMapMatPos |
CTrackDefaultVector | _DefaultPos |
CTrackDefaultVector | _DefaultScale |
CTrackDefaultQuat | _DefaultRotQuat |
float | _TransitionRatio |
float | _WaveHeightFactor |
bool | _ComputeLightmap |
bool | _HeightMapTouch [2] |
float | _HeightMapNormalizationFactor [2] |
Static Private Attributes |
uint32 | _XScreenGridSize = 40 |
uint32 | _YScreenGridSize = 40 |
uint32 | _MaxGridSize |
uint32 | _XGridBorder = 4 |
uint32 | _YGridBorder = 4 |
CVertexBuffer | _VB |
std::vector< uint32 > | _IBUpDown |
std::vector< uint32 > | _IBDownUp |
bool | _GridSizeTouched = true |
std::auto_ptr< CVertexProgram > | _VertexProgramBump1 |
std::auto_ptr< CVertexProgram > | _VertexProgramBump2 |
std::auto_ptr< CVertexProgram > | _VertexProgramBump1Diffuse |
std::auto_ptr< CVertexProgram > | _VertexProgramBump2Diffuse |
std::auto_ptr< CVertexProgram > | _VertexProgramNoBump |
std::auto_ptr< CVertexProgram > | _VertexProgramNoBumpDiffuse |
Friends |
class | CWaterModel |
class | CWaterRenderObs |
Detailed Description
A water shape.
On recent gfx boards with 4 texture stages, it uses the following : -A environment map computed from the hemisphere that is above the water. -A bump map used to perturbate the envmap (bump map 1). -A bump map used to perturbate the bump map 1 (bump map 0). This simulate local water motion -A color map whose both alpha and rgb are modulated with the envmap to get transparency and color of the water. These maps can be scaled, but not rotated. The bump maps can scroll at regular speed over time The envmap, when set to a CTextureBlend, will automatically blend for all shape when CWaterPoolManager::setBlend is called. This may be used to simulate a night / day transition. The color / alpha map may have arbritrary orientation over the surface -
Author:
-
Nicolas Vizerie , Nevrax France
-
Date:
-
2001
Definition at line 79 of file water_shape.h.
Constructor & Destructor Documentation
NL3D::CWaterShape::CWaterShape |
( |
|
) |
|
|
|
ctor.
Definition at line 218 of file water_shape.cpp.
References _ColorMapMatColumn0, _ColorMapMatColumn1, _ColorMapMatPos, _DefaultPos, _DefaultRotQuat, _DefaultScale, _HeightMapScale, _HeightMapSpeed, _HeightMapTouch, NLMISC::CVector::Null, and NLMISC::CVector2f::set. |
NL3D::CWaterShape::~CWaterShape |
( |
|
) |
|
|
Member Function Documentation
bool NL3D::CWaterShape::clip |
( |
const std::vector< CPlane > & |
pyramid, |
|
|
const CMatrix & |
worldMatrix |
|
) |
[virtual] |
|
void NL3D::CWaterShape::computeBBox |
( |
|
) |
[private] |
|
void NL3D::CWaterShape::enableLightMapping |
( |
bool |
enable = true |
) |
[inline] |
|
|
Tells this shape that it can replace its colormap by a lightmap during the zone lighting.
Definition at line 196 of file water_shape.h. |
void NL3D::CWaterShape::envMapUpdate |
( |
|
) |
[private] |
|
void NL3D::CWaterShape::flushTextures |
( |
IDriver & |
driver |
) |
[virtual] |
|
virtual void NL3D::CWaterShape::getAABBox |
( |
NLMISC::CAABBox & |
bbox |
) |
const [inline, virtual] |
|
const ITexture* NL3D::CWaterShape::getColorMap |
( |
|
) |
const [inline] |
|
ITexture* NL3D::CWaterShape::getColorMap |
( |
|
) |
[inline] |
|
const ITexture* NL3D::CWaterShape::getEnvMap |
( |
uint |
index |
) |
const [inline] |
|
ITexture* NL3D::CWaterShape::getEnvMap |
( |
uint |
index |
) |
[inline] |
|
const ITexture * NL3D::CWaterShape::getHeightMap |
( |
uint |
k |
) |
const |
|
float NL3D::CWaterShape::getNumTriangles |
( |
float |
distance |
) |
[virtual] |
|
uint32 NL3D::CWaterShape::getScreenXGridSize |
( |
|
) |
[inline, static] |
|
uint32 NL3D::CWaterShape::getScreenYGridSize |
( |
|
) |
[inline, static] |
|
|
get the polygon used by this shape, in the object space.
Definition at line 136 of file water_shape.h.
References _Poly. |
|
get the polygon this shape, in world space.
Definition at line 595 of file water_shape.cpp.
References _DefaultPos, _DefaultRotQuat, _DefaultScale, _Poly, NL3D::CAnimatedValueQuat, NL3D::CAnimatedValueVector, NLMISC::CMatrix::identity, NLMISC::CMatrix::rotate, NLMISC::CMatrix::scale, NLMISC::CMatrix::translate, NLMISC::CPolygon2D::Vertices, and NLMISC::CPolygon::Vertices. |
float NL3D::CWaterShape::getTransitionRatio |
( |
|
) |
const [inline] |
|
uint32 NL3D::CWaterShape::getWaterPoolID |
( |
|
) |
const [inline] |
|
float NL3D::CWaterShape::getWaveHeightFactor |
( |
|
) |
const [inline] |
|
uint32 NL3D::CWaterShape::getXGridBorder |
( |
|
) |
[inline, static] |
|
uint32 NL3D::CWaterShape::getYGridBorder |
( |
|
) |
[inline, static] |
|
void NL3D::CWaterShape::initVertexProgram |
( |
|
) |
[static, private] |
|
bool NL3D::CWaterShape::isLightMappingEnabled |
( |
|
) |
const [inline] |
|
NL3D::CWaterShape::NLMISC_DECLARE_CLASS |
( |
CWaterShape |
|
) |
|
|
virtual void NL3D::CWaterShape::render |
( |
IDriver * |
drv, |
|
|
CTransformShape * |
trans, |
|
|
bool |
opaquePass |
|
) |
[inline, virtual] |
|
void NL3D::CWaterShape::setColorMap |
( |
ITexture * |
map |
) |
|
|
void NL3D::CWaterShape::setEnvMap |
( |
uint |
index, |
|
|
ITexture * |
envMap |
|
) |
|
|
void NL3D::CWaterShape::setGridBorderSize |
( |
uint32 |
x, |
|
|
uint32 |
y |
|
) |
[static] |
|
void NL3D::CWaterShape::setHeightMap |
( |
uint |
k, |
|
|
ITexture * |
hm |
|
) |
|
|
|
Set a height map, used to generate a bumpmap (useful if supported by hardware...) NB : not to be confused with the height map used to modify the geometry, it only modify texture.
Definition at line 413 of file water_shape.cpp.
References _BumpMap, _HeightMapTouch, and nlassert. |
void NL3D::CWaterShape::setScreenGridSize |
( |
uint32 |
x, |
|
|
uint32 |
y |
|
) |
[static] |
|
void NL3D::CWaterShape::setTransitionRatio |
( |
float |
percent |
) |
[inline] |
|
void NL3D::CWaterShape::setupVertexBuffer |
( |
|
) |
[static, private] |
|
|
Definition at line 271 of file water_shape.cpp.
References _GridSizeTouched, _IBDownUp, _IBUpDown, _MaxGridSize, _VB, _XGridBorder, _XScreenGridSize, _YScreenGridSize, w, NL3D::WATER_VB_DX, NL3D::WATER_VB_POS, and x. |
void NL3D::CWaterShape::setWaterPoolID |
( |
uint32 |
id |
) |
[inline] |
|
|
all water shape that have the same weter id will share the same height map for wave propagations.
Definition at line 120 of file water_shape.h.
References _WaterPoolID, and id. |
void NL3D::CWaterShape::setWaveHeightFactor |
( |
float |
f |
) |
[inline] |
|
void NL3D::CWaterShape::updateHeightMapNormalizationFactors |
( |
|
) |
[private] |
|
Friends And Related Function Documentation
friend class CWaterModel [friend]
|
|
friend class CWaterRenderObs [friend]
|
|
Member Data Documentation
bool NL3D::CWaterShape::_ComputeLightmap [private]
|
|
bool NL3D::CWaterShape::_GridSizeTouched = true [static, private]
|
|
float NL3D::CWaterShape::_HeightMapNormalizationFactor[2] [private]
|
|
bool NL3D::CWaterShape::_HeightMapTouch[2] [private]
|
|
std::vector< uint32 > NL3D::CWaterShape::_IBDownUp [static, private]
|
|
std::vector< uint32 > NL3D::CWaterShape::_IBUpDown [static, private]
|
|
uint32 NL3D::CWaterShape::_MaxGridSize [static, private]
|
|
float NL3D::CWaterShape::_TransitionRatio [private]
|
|
std::auto_ptr< CVertexProgram > NL3D::CWaterShape::_VertexProgramBump1 [static, private]
|
|
std::auto_ptr< CVertexProgram > NL3D::CWaterShape::_VertexProgramBump1Diffuse [static, private]
|
|
std::auto_ptr< CVertexProgram > NL3D::CWaterShape::_VertexProgramBump2 [static, private]
|
|
std::auto_ptr< CVertexProgram > NL3D::CWaterShape::_VertexProgramBump2Diffuse [static, private]
|
|
std::auto_ptr< CVertexProgram > NL3D::CWaterShape::_VertexProgramNoBump [static, private]
|
|
std::auto_ptr< CVertexProgram > NL3D::CWaterShape::_VertexProgramNoBumpDiffuse [static, private]
|
|
uint32 NL3D::CWaterShape::_WaterPoolID [private]
|
|
float NL3D::CWaterShape::_WaveHeightFactor [private]
|
|
uint32 NL3D::CWaterShape::_XGridBorder = 4 [static, private]
|
|
uint32 NL3D::CWaterShape::_XScreenGridSize = 40 [static, private]
|
|
uint32 NL3D::CWaterShape::_YGridBorder = 4 [static, private]
|
|
uint32 NL3D::CWaterShape::_YScreenGridSize = 40 [static, private]
|
|
The documentation for this class was generated from the following files:
|
|