torque Torque Game Engine Documentation
TGE Version 1.5.2

WaterBlock Class Reference

#include <waterBlock.h>

Inheritance diagram for WaterBlock:

Inheritance graph
[legend]

Public Types

enum  EWaterType {
  eWater = 0,
  eOceanWater = 1,
  eRiverWater = 2,
  eStagnantWater = 3,
  eLava = 4,
  eHotLava = 5,
  eCrustyLava = 6,
  eQuicksand = 7
}
enum  WaterConst { WC_NUM_SUBMERGE_TEX = 2 }
enum  WaterAttributes { eDepthMapResolution = 512 }

Public Member Functions

 WaterBlock ()
 ~WaterBlock ()
bool onAdd (void)
 Called when the object is added to the sim.
void onRemove (void)
 Called when the object is removed from the sim.
bool onSceneAdd (SceneGraph *graph)
 Called when this is added to the SceneGraph.
void setTransform (const MatrixF &mat)
 Sets the Object -> World transform.
void setScale (const VectorF &scale)
 Sets the scale for the object.
bool prepRenderImage (SceneState *state, const U32 stateKey, const U32 startZone, const bool modifyBaseZoneState=false)
 Called when the SceneGraph is ready for the registration of RenderImages.
void renderObject (SceneState *state, SceneRenderImage *image)
 Called when the object is supposed to render itself.
void inspectPostApply (void)
 Called after any property of the object is changed in the world editor.
F32 getSurfaceHeight (void)
void UpdateFluidRegion (void)
void toggleWireFrame ()
 DECLARE_CONOBJECT (WaterBlock)
EWaterType getLiquidType () const
F32 getViscosity () const
F32 getDensity () const
U32 packUpdate (NetConnection *conn, U32 mask, BitStream *stream)
 Instructs this object to pack its state for transfer over the network.
void unpackUpdate (NetConnection *conn, BitStream *stream)
 Instructs this object to read state data previously packed with packUpdate.
bool isPointSubmerged (const Point3F &pos, bool worldSpace=true) const
bool isPointSubmergedSimple (const Point3F &pos, bool worldSpace=true) const
AudioEnvironmentgetAudioEnvironment ()

Static Public Member Functions

static void SnagTerrain (SceneObject *sceneObj, void *key)
static void cToggleWireFrame (SimObject *, S32, const char **)
static void initPersistFields ()
 Register dynamic fields in a subclass of ConsoleObject.
static bool isWater (U32 liquidType)
static bool isLava (U32 liquidType)
static bool isQuicksand (U32 liquidType)
static TextureHandle getSubmergeTexture (U32 index)

Static Public Attributes

static bool mCameraSubmerged
static U32 mSubmergedType

Protected Member Functions

bool castRay (const Point3F &start, const Point3F &end, RayInfo *info)
 Casts a ray and obtain collision information, returns true if RayInfo is modified.
void CalculateDepthMaps (void)
 Calculate Depth Map.
void GenerateDepthTextures (GBitmap *pBitmap, TextureHandle &mTexture, bool ShoreFlag)
 Generate Depth.

Private Types

typedef SceneObject Parent

Private Attributes

fluid mFluid
bool mTile
TextureHandle mSurfaceTexture
TextureHandle mSpecMaskTex
 Specular mask texture.
TextureHandle mEnvMapOverTexture
 Overhead environment map texture handle.
TextureHandle mEnvMapUnderTexture
 Undersea environment map texture handle.
TextureHandle mShoreTexture
 Shore texture handle.
PlaneF mClipPlane [6]
 Frustrum clip planes: 0=T 1=B 2=L 3=R 4=N 5=F.
TerrainBlockmpTerrain
 Terrain block.
F32 mSurfaceZ
 Height of surface (approx.).
EWaterType mLiquidType
 Type of liquid: Water? Lava? What?
F32 mDensity
 Density of liquid.
F32 mViscosity
 Viscosity of liquid.
F32 mWaveMagnitude
 Size of waves.
StringTableEntry mSurfaceName
 Surface texture.
StringTableEntry mSpecMaskName
 Specular mask texture.
F32 mSurfaceOpacity
 Opacity of surface texture.
StringTableEntry mEnvMapOverName
 Overhead environment map texture name.
StringTableEntry mEnvMapUnderName
 Undersea environment maptexture name.
F32 mEnvMapIntensity
 Intensity of environment maps.
StringTableEntry mShoreName
 Shore texture name.
StringTableEntry mSubmergeName [WC_NUM_SUBMERGE_TEX]
 Name of submerge texture.
bool mRemoveWetEdges
 Remove wet edges?
AudioEnvironmentmAudioEnvironment
 Audio environment handle.
bool mEditorApplied
 Editor Applied Flag.
GBitmapmDepthBitmap
 Depth Bitmap.
TextureHandle mDepthTexture
 Depth Texture.
GBitmapmShoreDepthBitmap
 Shore Bitmap.
TextureHandle mShoreDepthTexture
 Shore Texture.
bool mUseDepthMap
 Use Depth-Map Flag.
F32 mShoreDepth
 Shore Depth.
F32 mMinAlpha
 Minimum Alpha.
F32 mMaxAlpha
 Maximum Alpha.
F32 mDepthGradient
 Depth Gradient.
F32 mTessellationSurface
 Tessellation Surface.
F32 mTessellationShore
 Tessellation Shore.
F32 mSurfaceParallax
 Surface Parallax.
F32 mFlowAngle
 Flow Angle.
F32 mFlowRate
 Flow Rate.
F32 mDistortGridScale
 Distort Grid Scale.
F32 mDistortMagnitude
 Distort Magnitude.
F32 mDistortTime
 Distortion Time.
ColorF mSpecColor
F32 mSpecPower
U32 mTerrainHalfSize
U32 mTerrainSquareSize
bool mIsFluidUpdated
TextureHandle mLocalSubmergeTexture [WC_NUM_SUBMERGE_TEX]

Static Private Attributes

static TextureHandle mSubmergeTexture [WC_NUM_SUBMERGE_TEX]

Member Typedef Documentation

typedef SceneObject WaterBlock::Parent [private]

Reimplemented from SceneObject.


Member Enumeration Documentation

Enumerator:
eWater 
eOceanWater 
eRiverWater 
eStagnantWater 
eLava 
eHotLava 
eCrustyLava 
eQuicksand 

Enumerator:
WC_NUM_SUBMERGE_TEX 

Enumerator:
eDepthMapResolution 


Constructor & Destructor Documentation

WaterBlock::WaterBlock (  ) 

WaterBlock::~WaterBlock (  ) 


Member Function Documentation

bool WaterBlock::onAdd ( void   )  [virtual]

Called when the object is added to the sim.

Reimplemented from SceneObject.

void WaterBlock::onRemove ( void   )  [virtual]

Called when the object is removed from the sim.

Reimplemented from SceneObject.

bool WaterBlock::onSceneAdd ( SceneGraph graph  )  [virtual]

Called when this is added to the SceneGraph.

Parameters:
graph SceneGraph this is getting added to

Reimplemented from SceneObject.

void WaterBlock::setTransform ( const MatrixF mat  )  [virtual]

Sets the Object -> World transform.

Parameters:
mat New transform matrix

Reimplemented from SceneObject.

void WaterBlock::setScale ( const VectorF scale  )  [virtual]

Sets the scale for the object.

Parameters:
scale Scaling values

Reimplemented from SceneObject.

bool WaterBlock::prepRenderImage ( SceneState state,
const U32  stateKey,
const U32  startZone,
const bool  modifyBaseZoneState = false 
) [virtual]

Called when the SceneGraph is ready for the registration of RenderImages.

See also:
SceneState
Parameters:
state SceneState
stateKey State key of the current SceneState
startZone Base zone index
modifyBaseZoneState If true, the object needs to modify the zone state.

Reimplemented from SceneObject.

void WaterBlock::renderObject ( SceneState state,
SceneRenderImage image 
) [virtual]

Called when the object is supposed to render itself.

Parameters:
state Current rendering state.
See also:
SceneState
Parameters:
image Image associated with this object to render.
See also:
SceneRenderImage

Reimplemented from SceneObject.

void WaterBlock::inspectPostApply ( void   )  [virtual]

Called after any property of the object is changed in the world editor.

See also:
inspectPreApply

Reimplemented from SceneObject.

F32 WaterBlock::getSurfaceHeight ( void   )  [inline]

void WaterBlock::UpdateFluidRegion ( void   ) 

static void WaterBlock::SnagTerrain ( SceneObject sceneObj,
void key 
) [static]

static void WaterBlock::cToggleWireFrame ( SimObject ,
S32  ,
const char **   
) [static]

void WaterBlock::toggleWireFrame (  ) 

WaterBlock::DECLARE_CONOBJECT ( WaterBlock   ) 

static void WaterBlock::initPersistFields (  )  [static]

Register dynamic fields in a subclass of ConsoleObject.

See also:
addField(), addFieldV(), addDepricatedField(), addGroup(), endGroup()

Reimplemented from SceneObject.

EWaterType WaterBlock::getLiquidType (  )  const [inline]

static bool WaterBlock::isWater ( U32  liquidType  )  [static]

static bool WaterBlock::isLava ( U32  liquidType  )  [static]

static bool WaterBlock::isQuicksand ( U32  liquidType  )  [static]

F32 WaterBlock::getViscosity (  )  const [inline]

F32 WaterBlock::getDensity (  )  const [inline]

U32 WaterBlock::packUpdate ( NetConnection conn,
U32  mask,
BitStream stream 
) [virtual]

Instructs this object to pack its state for transfer over the network.

Parameters:
conn Net connection being used
mask Mask indicating fields to transmit.
stream Bitstream to pack data to
Returns:
Any bits which were not dealt with. The value is stored by the networking system. Don't set bits you weren't passed.

Reimplemented from NetObject.

void WaterBlock::unpackUpdate ( NetConnection conn,
BitStream stream 
) [virtual]

Instructs this object to read state data previously packed with packUpdate.

Parameters:
conn Net connection being used
stream stream to read from

Reimplemented from NetObject.

bool WaterBlock::isPointSubmerged ( const Point3F pos,
bool  worldSpace = true 
) const

bool WaterBlock::isPointSubmergedSimple ( const Point3F pos,
bool  worldSpace = true 
) const

AudioEnvironment* WaterBlock::getAudioEnvironment (  )  [inline]

static TextureHandle WaterBlock::getSubmergeTexture ( U32  index  )  [inline, static]

bool WaterBlock::castRay ( const Point3F start,
const Point3F end,
RayInfo info 
) [protected, virtual]

Casts a ray and obtain collision information, returns true if RayInfo is modified.

Parameters:
start Start point of ray
end End point of ray
info Collision information obtained (out)

Reimplemented from SceneObject.

void WaterBlock::CalculateDepthMaps ( void   )  [protected]

Calculate Depth Map.

void WaterBlock::GenerateDepthTextures ( GBitmap pBitmap,
TextureHandle &  mTexture,
bool  ShoreFlag 
) [protected]

Generate Depth.


Field Documentation

bool WaterBlock::mTile [private]

TextureHandle WaterBlock::mSurfaceTexture [private]

TextureHandle WaterBlock::mSpecMaskTex [private]

Specular mask texture.

TextureHandle WaterBlock::mEnvMapOverTexture [private]

Overhead environment map texture handle.

TextureHandle WaterBlock::mEnvMapUnderTexture [private]

Undersea environment map texture handle.

TextureHandle WaterBlock::mShoreTexture [private]

Shore texture handle.

Frustrum clip planes: 0=T 1=B 2=L 3=R 4=N 5=F.

Terrain block.

Height of surface (approx.).

Type of liquid: Water? Lava? What?

Density of liquid.

Viscosity of liquid.

Size of waves.

Surface texture.

Specular mask texture.

Opacity of surface texture.

Overhead environment map texture name.

Undersea environment maptexture name.

Intensity of environment maps.

Shore texture name.

StringTableEntry WaterBlock::mSubmergeName[WC_NUM_SUBMERGE_TEX] [private]

Name of submerge texture.

Remove wet edges?

Audio environment handle.

Editor Applied Flag.

Depth Bitmap.

TextureHandle WaterBlock::mDepthTexture [private]

Depth Texture.

Shore Bitmap.

TextureHandle WaterBlock::mShoreDepthTexture [private]

Shore Texture.

bool WaterBlock::mUseDepthMap [private]

Use Depth-Map Flag.

Shore Depth.

Minimum Alpha.

Maximum Alpha.

Depth Gradient.

Tessellation Surface.

Tessellation Shore.

Surface Parallax.

Flow Angle.

Flow Rate.

Distort Grid Scale.

Distort Magnitude.

Distortion Time.

TextureHandle WaterBlock::mLocalSubmergeTexture[WC_NUM_SUBMERGE_TEX] [private]

TextureHandle WaterBlock::mSubmergeTexture[WC_NUM_SUBMERGE_TEX] [static, private]




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen