WaterObject

Engine/source/environment/waterObject.h

More...

Protected Types

enum
consts {
  MAX_WAVES = 3
  MAX_FOAM = 2
  NUM_ANIM_FRAMES = 32
}
enum
MaskBits {
  UpdateMask = Parent::NextFreeMask << 0
  WaveMask = Parent::NextFreeMask << 1
  MaterialMask = Parent::NextFreeMask << 2
  TextureMask = Parent::NextFreeMask << 3
  SoundMask = Parent::NextFreeMask << 4
  NextFreeMask = Parent::NextFreeMask << 5
}
enum
MaterialType {
  WaterMat = 0
  UnderWaterMat 
  BasicWaterMat 
  BasicUnderWaterMat 
  NumMatTypes 
}

Private Types

Parent 

Protected Attributes

bool
mFoamDir [MAX_WAVES]
mFoamOpacity [MAX_WAVES]
mFoamSpeed [MAX_WAVES]
mFoamTexScale [MAX_WAVES]

Defined in WaterCommon but set and used by child classes.

mRippleDir [MAX_WAVES]
mRippleMagnitude [MAX_WAVES]
mRippleSpeed [MAX_WAVES]
mSurfMatName [NumMatTypes]

Defined here and sent to the shader in WaterCommon::setShaderParams but needs to be initialized in child classes prior to that call.

mWaveDir [MAX_WAVES]
mWaveMagnitude [MAX_WAVES]
mWaveSpeed [MAX_WAVES]

Protected Static Attributes

bool

Force all water objects to use static cubemap reflections.

bool

A global for enabling wireframe rendering on all water objects.

Public Functions

bool

Return true if the given point is contained by the object's (collision) shape.

Return the ambient sound space active inside the volume of this object or NULL if the object does not have its own ambient space.

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

bool

Called when the object is added to the sim.

Called when the object is removed from the sim.

packUpdate(NetConnection * conn, U32 mask, BitStream * stream)

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

Called when the SceneManager is ready for the registration of render instances.

bool

Process constructor options. (ie, new SimObject(1,2,3))

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

Public Static Functions

Protected Static Functions

bool
_checkDensity(void * object, const char * index, const char * data)
bool
_setFullReflect(void * object, const char * index, const char * data)

Detailed Description

Protected Types

consts

Enumerator

MAX_WAVES = 3
MAX_FOAM = 2
NUM_ANIM_FRAMES = 32
MaskBits

Enumerator

UpdateMask = Parent::NextFreeMask << 0
WaveMask = Parent::NextFreeMask << 1
MaterialMask = Parent::NextFreeMask << 2
TextureMask = Parent::NextFreeMask << 3
SoundMask = Parent::NextFreeMask << 4
NextFreeMask = Parent::NextFreeMask << 5
MaterialType

Enumerator

WaterMat = 0
UnderWaterMat
BasicWaterMat
BasicUnderWaterMat
NumMatTypes

Private Types

typedef SceneObject Parent 

Protected Attributes

bool mBasicLighting 
F32 mClarity 
CubemapData * mCubemap 
String mCubemapName 
F32 mDensity 
F32 mDepthGradientMax 
GFXTexHandle mDepthGradientTex 
String mDepthGradientTexName 
F32 mDistortEndDist 
F32 mDistortFullDepth 
F32 mDistortStartDist 
bool mEmissive 
F32 mFoamAmbientLerp 
Point2F mFoamDir [MAX_WAVES]
F32 mFoamMaxDepth 
F32 mFoamOpacity [MAX_WAVES]
F32 mFoamRippleInfluence 
F32 mFoamSpeed [MAX_WAVES]
GFXTexHandle mFoamTex 
String mFoamTexName 
Point2F mFoamTexScale [MAX_WAVES]
F32 mFresnelBias 
F32 mFresnelPower 
bool mFullReflect 
bool mGenerateVB 
String mLiquidType 
BaseMatInstance * mMatInstances [NumMatTypes]
WaterMatParams mMatParamHandles [NumMatTypes]
MatrixSet * mMatrixSet 
F32 mMiscParamW 

Defined in WaterCommon but set and used by child classes.

If true will refuse to render a reflection even if called from the ReflectionManager, is set true if occlusion query is enabled and it determines it is occluded. Derived classes can set this value prior to calling Parent::setShaderConst to pass it into the shader miscParam.w

NamedTexTarget mNamedDepthGradTex 
F32 mOverallFoamOpacity 
F32 mOverallRippleMagnitude 
F32 mOverallWaveMagnitude 
PlaneReflector mPlaneReflector 
F32 mReflectivity 
bool mReflectNormalUp 
ReflectorDesc mReflectorDesc 
Point2F mRippleDir [MAX_WAVES]
F32 mRippleMagnitude [MAX_WAVES]
F32 mRippleSpeed [MAX_WAVES]
GFXTexHandle mRippleTex 
String mRippleTexName 
Point2F mRippleTexScale [MAX_WAVES]
SFXAmbience * mSoundAmbience 
LinearColorF mSpecularColor 
F32 mSpecularPower 
String mSurfMatName [NumMatTypes]
bool mUnderwater 
ColorI mUnderwaterColor 
SimObjectPtr< PostEffect > mUnderwaterPostFx 
GFXStateBlockRef mUnderwaterSB 
F32 mUndulateMaxDist 

Defined here and sent to the shader in WaterCommon::setShaderParams but needs to be initialized in child classes prior to that call.

F32 mViscosity 
WaterFogData mWaterFogData 
PlaneF mWaterPlane 
Point3F mWaterPos 
Point2F mWaveDir [MAX_WAVES]
F32 mWaveMagnitude [MAX_WAVES]
F32 mWaveSpeed [MAX_WAVES]

Protected Static Attributes

bool smDisableTrueReflections 

Force all water objects to use static cubemap reflections.

bool smWireframe 

A global for enabling wireframe rendering on all water objects.

Public Functions

WaterObject()

~WaterObject()

containsPoint(const Point3F & point)

Reimplemented from: SceneObject

DECLARE_CONOBJECT(WaterObject )

getDensity()

getFlow(const Point3F & pos)

Reimplemented by: River

getLiquidType()

getSoundAmbience()

Reimplemented from: SceneObject

getSurfaceHeight(const Point2F & pos)

Reimplemented by: River, WaterBlock, WaterPlane

getViscosity()

getWaterCoverage(const Box3F & worldBox)

Reimplemented by: River, WaterBlock, WaterPlane

inspectPostApply()

Reimplemented from: SceneObject

Reimplemented by: River, WaterBlock, WaterPlane

isUnderwater(const Point3F & pnt)

Reimplemented by: River, WaterBlock, WaterPlane

onAdd()

Reimplemented from: SceneObject

Reimplemented by: River, WaterBlock, WaterPlane

onRemove()

Reimplemented from: SceneObject

Reimplemented by: River, WaterBlock, WaterPlane

packUpdate(NetConnection * conn, U32 mask, BitStream * stream)

Reimplemented from: SceneObject

Reimplemented by: River, WaterBlock, WaterPlane

prepRenderImage(SceneRenderState * state)

Reimplemented from: SceneObject

Reimplemented by: WaterPlane

processArguments(S32 argc, ConsoleValueRef * argv)

Reimplemented from: SimGroup

renderObject(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * overrideMat)

unpackUpdate(NetConnection * conn, BitStream * stream)

Reimplemented from: SceneObject

Reimplemented by: River, WaterBlock, WaterPlane

updateUnderwaterEffect(SceneRenderState * state)

Reimplemented by: River

Public Static Functions

consoleInit()

initPersistFields()

Protected Functions

_getWaterPlane(const Point3F & camPos, PlaneF & outPlane, Point3F & outPos)

Reimplemented by: River, WaterBlock, WaterPlane

_onDisableTrueRelfections()

Callback used internally when smDisableTrueReflections changes.

cleanupMaterials()

drawUnderwaterFilter(SceneRenderState * state)

getMaterialIndex(const Point3F & camPos)

getUnderwaterEffect()

initMaterial(S32 idx)

initTextures()

innerRender(SceneRenderState * state)

Reimplemented by: River, WaterBlock, WaterPlane

setCustomTextures(S32 matIdx, U32 pass, const WaterMatParams & paramHandles)

setShaderParams(SceneRenderState * state, BaseMatInstance * mat, const WaterMatParams & paramHandles)

Reimplemented by: River, WaterBlock, WaterPlane

setShaderXForms(BaseMatInstance * mat)

setupVBIB()

Reimplemented by: WaterBlock

Protected Static Functions

_checkDensity(void * object, const char * index, const char * data)

_setFullReflect(void * object, const char * index, const char * data)