Precipitation
Engine/source/T3D/fx/precipitation.h
Public Types
_Anonymous_ { DataMask = Parent::NextFreeMask << 0 PercentageMask = Parent::NextFreeMask << 1 StormMask = Parent::NextFreeMask << 2 TransformMask = Parent::NextFreeMask << 3 TurbulenceMask = Parent::NextFreeMask << 4 NextFreeMask = Parent::NextFreeMask << 5 }
Protected Types
Parent
Protected Attributes
Ambient sound.
bool
Animate the splashes using the frames in the texture.
How high drops will render.
bool
Whether or not to do collision.
If greater than zero, will animate the drops from the frames in the texture.
Texture handle for raindrop.
Stores the current drop hit mask.
bool
Should drops collide with players.
bool
Should drops collide with vehicles.
The shader used for raindrops.
The distance at which fading of the particles begins.
The distance at which fading of the particles ends.
bool
Does the system follow the camera or stay where it's placed.
Set it to 0 to disable the glow or use it to control
Used to skip processTick when we haven't been visible.
Coefficient to sin/cos for adding turbulence.
The maximum drops allowed in one render batch.
Server-side set var (NOT exposed to console) which controls how many drops are present [0,1].
GFXVertexBufferHandle< GFXVertexPCT >
bool
This enables the precipitation to be rendered during reflection passes.
bool
Rotate the drops relative to the camera velocity This is useful for "streak" type drops.
Point2F *
texture coordinates for splash texture
Texture handle for splash.
The shader used for splashes.
Splash billboard size.
struct Precipitation::@185
Point2F *
texture coords for rain texture
struct Precipitation::@186
How fast the turbulence wraps in a circle.
bool
This enables shading of the drops and splashes by the sun color.
bool
True to use true billboards, false for axis-aligned billboards.
bool
Whether to use turbulence or not (MAY EFFECT PERFORMANCE)
bool
This enables the wind from the sky SceneObject to effect the velocitiy of the drops.
Public Attributes
Protected Functions
createSplash(Raindrop * drop)
Adds a drop to the splash list.
destroySplash(Raindrop * drop)
Removes a drop from the splash list.
Adds/removes drops from the list to have the right # of drops.
Re-inits the textures and shaders.
Re-inits the texture coord lookup tables.
interpolateTick(F32 delta)
Interpolates between tick events.
Deletes the entire drop list.
bool
onAdd()
Called when the object is added to the sim.
prepRenderImage(SceneRenderState * state)
Called when the SceneManager is ready for the registration of render instances.
processTick(const Move * move)
Processes a move event and updates object state once every 32 milliseconds.
renderObject(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * )
setTransform(const MatrixF & mat)
Sets the Object -> World transform.
spawnNewDrop(Raindrop * drop)
Same as spawnDrop except also does z position.
Public Functions
Called after any property of the object is changed in the world editor.
modifyStorm(F32 pct, U32 ms)
bool
onNewDataBlock(GameBaseData * dptr, bool reload)
Called when a new datablock is set.
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Instructs this object to pack its state for transfer over the network.
setPercentage(F32 pct)
setTurbulence(F32 max, F32 speed, U32 ms)
This is used to smoothly change the turbulence over a desired time period.
unpackUpdate(NetConnection * conn, BitStream * stream)
Instructs this object to read state data previously packed with packUpdate.
Public Static Functions
Detailed Description
Public Types
@187
Enumerator
- DataMask = Parent::NextFreeMask << 0
- PercentageMask = Parent::NextFreeMask << 1
- StormMask = Parent::NextFreeMask << 2
- TransformMask = Parent::NextFreeMask << 3
- TurbulenceMask = Parent::NextFreeMask << 4
- NextFreeMask = Parent::NextFreeMask << 5
Protected Types
typedef GameBase Parent
Protected Attributes
SFXSource * mAmbientSound
Ambient sound.
bool mAnimateSplashes
Animate the splashes using the frames in the texture.
F32 mBoxHeight
How high drops will render.
F32 mBoxWidth
How far away in the x and y directions drops will render.
PrecipitationData * mDataBlock
GFXStateBlockRef mDefaultSB
GFXStateBlockRef mDistantSB
bool mDoCollision
Whether or not to do collision.
S32 mDropAnimateMS
If greater than zero, will animate the drops from the frames in the texture.
GFXTexHandle mDropHandle
Texture handle for raindrop.
Raindrop * mDropHead
Drop linked list head.
U32 mDropHitMask
Stores the current drop hit mask.
bool mDropHitPlayers
Should drops collide with players.
bool mDropHitVehicles
Should drops collide with vehicles.
GFXShaderRef mDropShader
The shader used for raindrops.
GFXShaderConstHandle * mDropShaderAmbientSC
GFXShaderConstHandle * mDropShaderCameraPosSC
GFXShaderConstBufferRef mDropShaderConsts
GFXShaderConstHandle * mDropShaderFadeStartEndSC
GFXShaderConstHandle * mDropShaderModelViewSC
F32 mDropSize
Droplet billboard size.
F32 mFadeDistance
The distance at which fading of the particles begins.
F32 mFadeDistanceEnd
The distance at which fading of the particles ends.
bool mFollowCam
Does the system follow the camera or stay where it's placed.
LinearColorF mGlowIntensity
Set it to 0 to disable the glow or use it to control
the intensity of each channel.
U32 mLastRenderFrame
Used to skip processTick when we haven't been visible.
F32 mMaxMass
Maximum mass of drops.
F32 mMaxSpeed
Maximum downward speed of drops.
F32 mMaxTurbulence
Coefficient to sin/cos for adding turbulence.
U32 mMaxVBDrops
The maximum drops allowed in one render batch.
F32 mMinMass
Minimum mass of drops.
F32 mMinSpeed
Minimum downward speed of drops.
S32 mNumDrops
Number of drops in the scene.
F32 mPercentage
Server-side set var (NOT exposed to console) which controls how many drops are present [0,1].
GFXPrimitiveBufferHandle mRainIB
GFXVertexBufferHandle< GFXVertexPCT > mRainVB
bool mReflect
This enables the precipitation to be rendered during reflection passes.
This is expensive.
bool mRotateWithCamVel
Rotate the drops relative to the camera velocity This is useful for "streak" type drops.
Point2F * mSplashCoords
texture coordinates for splash texture
GFXTexHandle mSplashHandle
Texture handle for splash.
Raindrop * mSplashHead
Splash linked list head.
S32 mSplashMS
How long in milliseconds a splash will last.
GFXShaderRef mSplashShader
The shader used for splashes.
GFXShaderConstHandle * mSplashShaderAmbientSC
GFXShaderConstHandle * mSplashShaderCameraPosSC
GFXShaderConstBufferRef mSplashShaderConsts
GFXShaderConstHandle * mSplashShaderFadeStartEndSC
GFXShaderConstHandle * mSplashShaderModelViewSC
F32 mSplashSize
Splash billboard size.
struct Precipitation::@185 mStormData
Point2F * mTexCoords
texture coords for rain texture
struct Precipitation::@186 mTurbulenceData
F32 mTurbulenceSpeed
How fast the turbulence wraps in a circle.
bool mUseLighting
This enables shading of the drops and splashes by the sun color.
bool mUseTrueBillboards
True to use true billboards, false for axis-aligned billboards.
bool mUseTurbulence
Whether to use turbulence or not (MAY EFFECT PERFORMANCE)
bool mUseWind
This enables the wind from the sky SceneObject to effect the velocitiy of the drops.
Public Attributes
F32 endMax
F32 endPct
F32 endSpeed
F32 startMax
F32 startPct
F32 startSpeed
U32 startTime
U32 totalTime
bool valid
Protected Functions
createSplash(Raindrop * drop)
Adds a drop to the splash list.
destroySplash(Raindrop * drop)
Removes a drop from the splash list.
fillDropList()
Adds/removes drops from the list to have the right # of drops.
findDropCutoff(Raindrop * drop, const Box3F & box, const VectorF & windVel)
Casts a ray to see if/when a drop will collide.
getWindVelocity()
initMaterials()
Re-inits the textures and shaders.
initRenderObjects()
Re-inits the texture coord lookup tables.
interpolateTick(F32 delta)
Reimplemented from: ProcessObject
killDropList()
Deletes the entire drop list.
onAdd()
Reimplemented from: SceneObject
onRemove()
Reimplemented from: SceneObject
prepRenderImage(SceneRenderState * state)
Reimplemented from: SceneObject
processTick(const Move * move)
Reimplemented from: ProcessObject
renderObject(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * )
setTransform(const MatrixF & mat)
Reimplemented from: SceneObject
spawnDrop(Raindrop * drop)
Fills drop info with random velocity, x/y positions, and mass.
spawnNewDrop(Raindrop * drop)
Same as spawnDrop except also does z position.
wrapDrop(Raindrop * drop, const Box3F & box, const U32 currTime, const VectorF & windVel)
Wraps a drop within the specified box.
Public Functions
Precipitation()
~Precipitation()
DECLARE_CONOBJECT(Precipitation )
inspectPostApply()
Reimplemented from: SceneObject
modifyStorm(F32 pct, U32 ms)
onNewDataBlock(GameBaseData * dptr, bool reload)
Reimplemented from: GameBase
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Reimplemented from: SceneObject
setPercentage(F32 pct)
setTurbulence(F32 max, F32 speed, U32 ms)
This is used to smoothly change the turbulence over a desired time period.
Setting ms to zero will cause the change to be instantaneous. Setting max zero will disable turbulence.
unpackUpdate(NetConnection * conn, BitStream * stream)
Reimplemented from: SceneObject