VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtWeatherEffect Class Reference

this class is used to create weather effects around the eye to represent effects such as mist, rain and hail. The effect is made from a particle system with simple physics applied. There are 2 initialiation types for this class: precipitation and particles. The precipitation type is an infinite scolling box of particles around the eye used for items such as mist or falling rain. The particle type is for dynamic particles such as surface hits. This class is not a stand-alone class as it relies on a larger system to initiate drawing and update methods (see DtWeatherLayerGroup and DtWeatherEffectDrawable).

Classes

struct  BlendData
 
struct  DrawData
 
struct  MeshGroup
 
struct  Particle
 
struct  SimulationUpdateJobData
 
struct  SortJobData
 

Public Types

enum  EffectType { EffectTypePrecipitation = 0, EffectTypeParticle }
 
enum  SurfaceHitType { SurfaceHitTypeNone = 0, SurfaceHitTypeHail, SurfaceHitTypeWindBlown }
 

Public Member Functions

 DtWeatherEffect (makVrv::DtDe &de)
 
virtual ~DtWeatherEffect ()
 
virtual void init (int particleCount, float particleSize, float radius, EffectType type, unsigned int randomSeed)
 
virtual void releaseGLObjects (osg::State *state) const
 
virtual void simulationUpdate (float timeStep, double currentTime, DtJobSplitter *jobSplitter)
 
virtual void postSimulationUpdate (float timeStep, double currentTime)
 
virtual void draw (DtWeatherEffect::DrawData &drawData, float cullFade=1.0f) const
 
virtual void cullUpdate (const osg::Vec3d &camPos, const osg::Matrixd &basis, DtJobSplitter *jobSplitter)
 
virtual void setSurfaceHitType (SurfaceHitType type)
 
virtual void setSurfaceHitOffset (float offset)
 
virtual void setSurfaceHitMaxSlope (float degrees)
 
virtual void setWindBlownParameters (int spawnCount, float minSpeed, float maxSpeed, float minTime, float maxTime)
 
virtual void setWind (float windDirectionRad, float windSpeedMps)
 
virtual void setWindSpeedMultiplier (float multiplier)
 
virtual void setWindLiftMultiplier (float multiplier)
 
virtual void setWindTurbulence (float multiplier)
 
virtual void setWindVariation (float minWind, float maxWind)
 
virtual void setScaleAnimation (float minX, float maxX, float minY, float maxY, float time)
 
virtual void setStreak (float multiplier)
 
virtual void setCameraStreakEnable (bool enable)
 
virtual void setStreakAdjustmentEnable (bool enable)
 
virtual void setOrientFlat (bool enable)
 
virtual void setIntensity (float intensity)
 
virtual void setFadePerIntensity (float fadeMin, float fadeMax, float intensityMin, float intensityMax)
 
virtual void setFadePerWind (float fadeMin, float fadeMax, float windMin, float windMax)
 
virtual void setTextureCoordAnimationPerWind (float multMin, float multMax, float windMin, float windMax)
 
virtual void setParticlesPerIntensity (float percentMin, float percentMax, float intensityMin, float intensityMax)
 
virtual void setBaseColor (const osg::Vec3 &color)
 
virtual void setAdditiveBlend (bool enable)
 
virtual bool additiveBlend () const
 
virtual void setVelocity (float x, float y, float z)
 
virtual void setInitRotationVariation (float rotationDeg)
 
virtual void setRotationVelocity (float velDeg)
 
virtual float radius () const
 
virtual void setTextureAtlasCell (unsigned char numColumns, unsigned char numRows, unsigned char col, unsigned char row)
 
virtual void setTextureCoordinateAnimation (float dirSpeedU, float dirSpeedV, float scale0, float scale1)
 
virtual void setTexturePatternChannelMix (float mix0, float mix1)
 
virtual void setDepthSoftness (float softness)
 
virtual float depthSoftness () const
 
virtual void setDepthProximity (float startFade, float fadeEnd, float mix)
 
virtual void setDragCoefficient (float coefficient)
 
virtual float dragCoefficient () const
 
virtual void setSortEnable (bool enable)
 
virtual bool sortEnable () const
 
virtual void runSort (const osg::Vec3 &localCamPos)
 
virtual void setClampToSurface (bool enable)
 
virtual bool clampToSurface () const
 
virtual void setGravity (const osg::Vec3 &gravity)
 
virtual void setRadiusFading (float fadeInStart, float fadeInEnd, float fadeOutStart, float fadeOutEnd)
 

Protected Member Functions

virtual void runSimulationUpdateJob (float timeStep, double currentTime)
 
virtual void updateHailSurfaceHit (float timeStep)
 
virtual void updateWindBlownSurfaceHit (float timeStep)
 
virtual void computeSortDepth (const osg::Vec3 &reference)
 
virtual void fillSortedParticles ()
 
virtual bool bindMeshGroupData (MeshGroup *meshGroup, osg::RenderInfo &renderInfo) const
 
virtual bool bindDynamicMeshGroupData (MeshGroup *meshGroup, osg::RenderInfo &renderInfo) const
 
virtual bool bindVaoToMeshGroup (GLuint vao, MeshGroup *meshGroup, osg::RenderInfo &renderInfo) const
 
virtual void simulatePrecipitationParticles (float timeStep, double currentTime)
 
virtual void simulateParticles (float timeStep, double currentTime, osg::Vec3d &basisPosChange)
 
void wrapPosition (float &posX, float &posY, float &posZ)
 
ParticlegetFreeParticle (void)
 
void freeParticle (Particle *particle)
 
void spawnHailParticle (const osg::Vec3d &position, const osg::Vec3 &normal, const unsigned char usePhysics)
 
void spawnWindBlownParticle (const osg::Vec3d &position, const osg::Vec3 &normal, float windRandom, float cosAng)
 
const osg::Vec3 crossProduct (const osg::Vec3 &v0, const osg::Vec3 &v1)
 
float computeRandomMinMax (float fMin, float fMax)
 
void computeRandomPointInRadius (osg::Vec2 &point, float radius)
 
bool clampPosition (osg::Vec3d &position, osg::Vec3 &normal, const osg::Vec3 &up)
 
virtual float computeBlendControl (const BlendData &data, float blendPos) const
 

Static Protected Member Functions

static void theSimulationUpdateJob (void *data)
 
static int theSortBackToFront (const void *arg0, const void *arg1)
 
static void theSortJob (void *data)
 

Protected Attributes

DtDemyDe
 
osg::Matrixd myBasisRot
 
osg::Vec3d myBasisPos
 
osg::Vec3d myLastBasisPos
 
bool myBasisDirty
 
EffectType myEffectType
 
SurfaceHitType mySurfaceHitType
 
float mySurfaceHitOffset
 
float mySurfaceHitMaxSlope
 
float mySurfaceHitTimer
 
unsigned int myRandomSeed
 
osg::Vec3 myScroll
 
float myRadius
 
float myWindDirectionRad
 
float myWindSpeedMps
 
float myWindSpeedMultiplier
 
float myWindLiftMultiplier
 
float myWindTurbulence
 
float myWindMin
 
float myWindMax
 
float myDragCoefficient
 
osg::Vec3 myVelocity
 
float myInitRotationRad
 
float myRotationVelocity
 
float myEffectFade
 
float myIntensity
 
BlendData myFadeByIntensity
 
BlendData myFadeByWind
 
BlendData myTexCoordAnimSpeedByWind
 
BlendData myParticlesByIntensity
 
float myParticleSize
 
osg::Vec3 myBaseColor
 
bool myAdditiveBlend
 
osg::ref_ptr< osg::BlendFunc > myBlendFunc
 
float myStreak
 
float myStreakAdjustment
 
bool myStreakAdjustmentEnable
 
bool myCameraStreak
 
float myScaleAnimMinX
 
float myScaleAnimMaxX
 
float myScaleAnimMinY
 
float myScaleAnimMaxY
 
float myScaleSpeed
 
float myTextureAtlasCols
 
float myTextureAtlasRows
 
float myTextureAtlasCol
 
float myTextureAtlasRow
 
float myTexCoordAnimDirSpeedU
 
float myTexCoordAnimDirSpeedV
 
float myTexCoordAnimScale0
 
float myTexCoordAnimScale1
 
float myTexCoordAnimDirOffsetU
 
float myTexCoordAnimDirOffsetV
 
float myTexturePatternMix0
 
float myTexturePatternMix1
 
float myDepthSoftness
 
float myDepthProximityMix
 
float myDepthProximityStart
 
float myDepthProximityRange
 
float myDepthProximityInvRange
 
bool mySortEnable
 
bool myClampToSurface
 
bool myOrientFlat
 
osg::Vec3 myGravity
 
float myRadiusFadeInStart
 
float myRadiusFadeInFalloff
 
float myRadiusFadeOutStart
 
float myRadiusFadeOutFalloff
 
int myWindBlownSpawnCount
 
float myWindBlownMinSpeed
 
float myWindBlownMaxSpeed
 
float myWindBlownMinTime
 
float myWindBlownMaxTime
 
MeshGroupmyMeshGroup
 
DtGlVaoManagermyVaoManager
 
ParticlemyParticlesMemoryPool
 
int myParticleMemoryPoolCount
 
ParticlemyParticlesFree
 
ParticlemyParticlesActive
 
int myParticleActiveCount
 
Particle ** myRenderList
 
int myRenderParticleCount
 
SimulationUpdateJobData mySimulationUpdateJobData
 
DtJobSplitterJob mySimulationUpdateJob
 
SortJobData mySortJobData
 
DtJobSplitterJob mySortJob
 
DtRandomNumberGenerator myRandomNumberGen
 
DtIntersectormyIntersector = nullptr
 

Private Member Functions

 DtWeatherEffect ()=delete
 
 DtWeatherEffect (const DtWeatherEffect &other)=delete
 
DtWeatherEffectoperator= (const DtWeatherEffect &other)=delete
 

Member Enumeration Documentation

An enumeration to define the effect type. Precipitation is an ageless effect that's infinite in a scrolling box. Precipitation would be used for something like falling rain. Particle is a particle simulation that has a life span. Particle would be used for something like splashes at a specific location.

Enumerator
EffectTypePrecipitation 
EffectTypeParticle 

An enumeration to define a surface hit effect. A surface hit effect creates particles based on surface heights around the weather effect's current location. Note that the weather effect must be of type EffectTypeParticle to use surface hits. The Hail type spawns a few hail particles at a surface location. The WindBlown type spawns wind blown particles at a surface location.

Enumerator
SurfaceHitTypeNone 
SurfaceHitTypeHail 
SurfaceHitTypeWindBlown 

Constructor & Destructor Documentation

makVrv::DtWeatherEffect::DtWeatherEffect ( makVrv::DtDe de)

CTOR.

virtual makVrv::DtWeatherEffect::~DtWeatherEffect ( )
virtual

DTOR.

makVrv::DtWeatherEffect::DtWeatherEffect ( )
privatedelete

Default Constructor not implemented.

makVrv::DtWeatherEffect::DtWeatherEffect ( const DtWeatherEffect other)
privatedelete

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

DtWeatherEffect& makVrv::DtWeatherEffect::operator= ( const DtWeatherEffect other)
privatedelete

Assignment Operator not implemented - Assignment not allowed.

virtual void makVrv::DtWeatherEffect::init ( int  particleCount,
float  particleSize,
float  radius,
EffectType  type,
unsigned int  randomSeed 
)
virtual

Initialize the effect.

Parameters
particleCountThe maximum number of particles to simulate.
particleSizeThe base particle size.
radiusThe effect radius.
typethe type of effect.
randomSeedSets a random seed used during initialization. The random seed value is set by the current time, but this seed is an offset that is added to that to allow multiple effects created at the same time, to look different.
virtual void makVrv::DtWeatherEffect::releaseGLObjects ( osg::State *  state) const
virtual

Release all gl objects used by this object.

virtual void makVrv::DtWeatherEffect::simulationUpdate ( float  timeStep,
double  currentTime,
DtJobSplitter jobSplitter 
)
virtual

Run a simulation update to simulate particle movement.

Parameters
timeStepThe time step to simulate.
currentTimeThe current simulation time.
jobSplitterA job splitter to add simulation jobs to.
virtual void makVrv::DtWeatherEffect::postSimulationUpdate ( float  timeStep,
double  currentTime 
)
virtual

Run a post simulation update. This is specifically here to update things that might not be job thread safe.

Parameters
timeStepThe time step to simulate.
virtual void makVrv::DtWeatherEffect::draw ( DtWeatherEffect::DrawData drawData,
float  cullFade = 1.0f 
) const
virtual

Issues the drawing command for the effect.

Parameters
drawDataThe drawing data structure containing draw parameters.
cullFadeAn addition fade value used for culling falloff.
virtual void makVrv::DtWeatherEffect::cullUpdate ( const osg::Vec3d &  camPos,
const osg::Matrixd &  basis,
DtJobSplitter jobSplitter 
)
virtual

Prepares the effect for drawing based on the camera position.

Parameters
camPosThe camera position.
basisRotThe basis rotation at the camera location.
jobSplitterA job splitter to add predraw jobs to.
virtual void makVrv::DtWeatherEffect::setSurfaceHitType ( SurfaceHitType  type)
virtual

Sets a type used to generate hit particles on the ground surface. A surface hit effect creates particles based on surface heights around the weather effect's current location. The weather effect must be of type EffectTypeParticle to use surface hits.

Parameters
typeThe type of surface hit to enable.
virtual void makVrv::DtWeatherEffect::setSurfaceHitOffset ( float  offset)
virtual

Sets a position offset used for particles that hit a surface.

Parameters
offsetThe amount to offset the hit position by the suface normal direction.
virtual void makVrv::DtWeatherEffect::setSurfaceHitMaxSlope ( float  degrees)
virtual

Sets the max surface slope angle allowed for a particle to spawn for a surface hit.

Parameters
angleDegThe maximum slope angle in degrees (0 - 90).
virtual void makVrv::DtWeatherEffect::setWindBlownParameters ( int  spawnCount,
float  minSpeed,
float  maxSpeed,
float  minTime,
float  maxTime 
)
virtual

Sets the parameters used for the SurfaceHitTypeWindBlown surface hit type.

Parameters
spawnCountThe number of particles to spawn.
minSpeedThe minimum wind speed multiplier.
maxSpeedThe maximum wind speed multiplier.
minTimeThe minimum alive time.
maxTimeThe maximum alive time.
virtual void makVrv::DtWeatherEffect::setWind ( float  windDirectionRad,
float  windSpeedMps 
)
virtual

Sets the current wind.

Parameters
windDirectionRadThe wind direction in radians.
windSpeedMpsThe wind speed in meters per second.
virtual void makVrv::DtWeatherEffect::setWindSpeedMultiplier ( float  multiplier)
virtual

Sets a wind speed multiplier used for particle physics.

Parameters
multiplierThe multiplier value.
virtual void makVrv::DtWeatherEffect::setWindLiftMultiplier ( float  multiplier)
virtual

Sets a wind lift multiplier used for particle physics.

Parameters
multiplierThe lift multiplier value can be positive (up) or negative (down).
virtual void makVrv::DtWeatherEffect::setWindTurbulence ( float  multiplier)
virtual

Sets a wind turbulence multiplier for particle physics.

Parameters
multiplierThe multiplier value (basically height deviation in meters).
virtual void makVrv::DtWeatherEffect::setWindVariation ( float  minWind,
float  maxWind 
)
virtual

Sets the particle wind response variation when physics are enabled.

Parameters
minWindThe minimum (scalar) a particle is affected by wind.
maxWindThe maximum (scalar) a particle is affected by wind.
virtual void makVrv::DtWeatherEffect::setScaleAnimation ( float  minX,
float  maxX,
float  minY,
float  maxY,
float  time 
)
virtual

Sets parameters for animated shrink/grow on the particle axis. Scale is cycled back and forth over time from normal to scaled value.

Parameters
minXThe minimum x axis size multiplier.
maxXThe maximum x axis size multiplier.
minYThe minimum y axis size multiplier.
maxXThe maximum y axis size multiplier.
speedThe time of 1 animation cycle in seconds.
virtual void makVrv::DtWeatherEffect::setStreak ( float  multiplier)
virtual

Sets a streak value to control particle streaking based on movement. A streak value of 0 disables streaking. A value greater than 0 lengthens the particle based on how fast it is moving.

Parameters
multiplierThe streak multiplier value.
virtual void makVrv::DtWeatherEffect::setCameraStreakEnable ( bool  enable)
virtual

Sets the flag to enable particle camera movement streak effect. If streak is enabled (see setStreak()), then this method enables or disables the camera movement streak effect.

Parameters
enableSet to true to enable camera streak (default is not enabled).
virtual void makVrv::DtWeatherEffect::setStreakAdjustmentEnable ( bool  enable)
virtual

Sets the flag to enable streak effect framerate adjustment. If enabled, the streak length will be adjusted when frame rate dips below 60hz. This keeps particles from stretching too much at low frame rates. This should only be enabled for fast moving particles.

Parameters
enableSet to true to enable adjustment. (default is enabled).
virtual void makVrv::DtWeatherEffect::setOrientFlat ( bool  enable)
virtual

Sets the particles to be rendered in a flat orientation.

virtual void makVrv::DtWeatherEffect::setIntensity ( float  intensity)
virtual

Sets a (0.0 - 1.0) value to control the effect intensity.

Parameters
intensityThe intensity scalar (0.0 - 1.0).
virtual void makVrv::DtWeatherEffect::setFadePerIntensity ( float  fadeMin,
float  fadeMax,
float  intensityMin,
float  intensityMax 
)
virtual

Sets an effect fade ramp based on the current intensity. Fade will be fadeMin if intensity < intensityMin. Fade will be fadeMax if intensityMin = intensityMax.

Parameters
fadeMinThe fade value (0.0 to 1.0) when intensity = intensityMin.
fadeMaxThe fade value (0.0 to 1.0) when intensity = intensityMax.
intensityMinThe intensity (0.0 to 1.0) at which the ramp begins.
intensityMaxThe intensity (0.0 to 1.0) at which the ramp ends.
virtual void makVrv::DtWeatherEffect::setFadePerWind ( float  fadeMin,
float  fadeMax,
float  windMin,
float  windMax 
)
virtual

Sets an effect fade ramp based on the current wind in mps. Fade will be fadeMin if wind < windMin. Fade will be fadeMax if windMin = windMax.

Parameters
fadeMinThe fade value (0.0 to 1.0) when wind = windMin.
fadeMaxThe fade value (0.0 to 1.0) when wind = windMax.
windMinThe wind speed at which the ramp begins.
windMaxThe wind speed at which the ramp ends.
virtual void makVrv::DtWeatherEffect::setTextureCoordAnimationPerWind ( float  multMin,
float  multMax,
float  windMin,
float  windMax 
)
virtual

Sets an effect texture coordinate animation speed ramp based on the current wind in mps. Computed output will be multMin if wind < windMin. Computed output will be multMax if windMin = windMax.

Parameters
multMinThe texture animation speed multiplier value (0.0 to 1.0) when wind = windMin.
multMaxThe texture animation speed value (0.0 to 1.0) when wind = windMax.
windMinThe wind speed at which the ramp begins.
windMaxThe wind speed at which the ramp ends.
virtual void makVrv::DtWeatherEffect::setParticlesPerIntensity ( float  percentMin,
float  percentMax,
float  intensityMin,
float  intensityMax 
)
virtual

Sets a particles percentage ramp based on the current intensity. Percent will be percentMin if intensity < intensityMin. Percent will be percentMax if intensityMin = intensityMax.

Parameters
percentMinThe percent value (0.0 to 1.0) when intensity = intensityMin.
percentMaxThe percent value (0.0 to 1.0) when intensity = intensityMax.
intensityMinThe intensity (0.0 to 1.0) at which the ramp begins.
intensityMaxThe intensity (0.0 to 1.0) at which the ramp ends.
virtual void makVrv::DtWeatherEffect::setBaseColor ( const osg::Vec3 &  color)
virtual

Sets a base color for the effect.

Parameters
colorThe r,g,b color values.
virtual void makVrv::DtWeatherEffect::setAdditiveBlend ( bool  enable)
virtual

Enables additive blending mode for rendering.

Parameters
enableSet to true for additive or false for alphablend.
virtual bool makVrv::DtWeatherEffect::additiveBlend ( ) const
virtual

Returns the additive blend mode flag.

virtual void makVrv::DtWeatherEffect::setVelocity ( float  x,
float  y,
float  z 
)
virtual

Sets a velocity for all effect particles.

Parameters
(x,y,z)The x,y,z local space velocity values.
virtual void makVrv::DtWeatherEffect::setInitRotationVariation ( float  rotationDeg)
virtual

Sets particle +- initial random rotation.

Parameters
rotationDegThe initial rotation variation in degrees.
virtual void makVrv::DtWeatherEffect::setRotationVelocity ( float  velDeg)
virtual

Sets particle maximum rotation velocity.

Parameters
velDegThe rotation velocity in degrees per second.
virtual float makVrv::DtWeatherEffect::radius ( ) const
virtual

Returns the radius of the effect.

virtual void makVrv::DtWeatherEffect::setTextureAtlasCell ( unsigned char  numColumns,
unsigned char  numRows,
unsigned char  col,
unsigned char  row 
)
virtual

Sets the texture cell to use for a texture atlas transparency mask channel.

Parameters
numColumnsThe number of columns in the texture.
numRowsThe number of rows in the texture.
colThe cell column to use.
rowThe cell row to use.
virtual void makVrv::DtWeatherEffect::setTextureCoordinateAnimation ( float  dirSpeedU,
float  dirSpeedV,
float  scale0,
float  scale1 
)
virtual

Sets texture uv coordinate animation settings applied to the transpancey pattern channels.

Parameters
dirSpeedUThe U scrolling speed (u space per second).
dirSpeedVThe V scrolling speed (v space per second).
scaleThe uv scale for pattern 0. (1.0 = one full texture)
scaleThe uv scale for pattern 1. (1.0 = one full texture)
virtual void makVrv::DtWeatherEffect::setTexturePatternChannelMix ( float  mix0,
float  mix1 
)
virtual

Sets the texture channel mix values for the transparancy patterns. This is used to mix between the r and g channels of the transparency patterns.

Parameters
mixA rg mixing value in the range of (0.0 to 1.0) for pattern 0.
mixA rg mixing value in the range of (0.0 to 1.0) for pattern 1.
virtual void makVrv::DtWeatherEffect::setDepthSoftness ( float  softness)
virtual

Sets the softness for transparency fade when close to a surface.

Parameters
softnessThe distance in meters to start the softness fade.
virtual float makVrv::DtWeatherEffect::depthSoftness ( ) const
virtual

Returns the softness for transparency fade when close to a surface.

virtual void makVrv::DtWeatherEffect::setDepthProximity ( float  startFade,
float  fadeEnd,
float  mix 
)
virtual

Sets depth proximity values, to fade particle at it moves away from a surface.

Parameters
startFadeThe depth distance to start fading out.
fadeRangeThe depth distance to end fading out.
mixThe amount of the fading value to use. (0 = full off, 1 = full on)
virtual void makVrv::DtWeatherEffect::setDragCoefficient ( float  coefficient)
virtual

Sets the drag coefficient for particles.

Parameters
coefficientThe coefficient value.
virtual float makVrv::DtWeatherEffect::dragCoefficient ( ) const
virtual

Returns the drag coefficient for particles.

virtual void makVrv::DtWeatherEffect::setSortEnable ( bool  enable)
virtual

Sets the flag to enable sorting particles within the effect.

Parameters
enableSet to true to enable sorting.
virtual bool makVrv::DtWeatherEffect::sortEnable ( ) const
virtual

Returns the flag to enable sorting particles within the effect.

virtual void makVrv::DtWeatherEffect::runSort ( const osg::Vec3 &  localCamPos)
virtual

Sorts particles for the current view. Fills indice buffer.

Parameters
localCamPosThe local camera position.
virtual void makVrv::DtWeatherEffect::setClampToSurface ( bool  enable)
virtual

Sets the flag to enable particles to clamp to a surface in the shader.

Parameters
enableSet to true to enable clamping.
virtual bool makVrv::DtWeatherEffect::clampToSurface ( ) const
virtual

Returns the flag to enable particles to clamp to a surface in the shader.

virtual void makVrv::DtWeatherEffect::setGravity ( const osg::Vec3 &  gravity)
virtual

Sets the gravity (mps^2) used when particle physics are enabled.

Parameters
gravityThe acceleration value.
virtual void makVrv::DtWeatherEffect::setRadiusFading ( float  fadeInStart,
float  fadeInEnd,
float  fadeOutStart,
float  fadeOutEnd 
)
virtual

Sets radius linear fading values for fading in/out particles based on distance.

Parameters
fadeInStartThe distance to begin fading in.
fadeInEndThe distance to be fully faded in.
fadeOutStartThe distance to begin fading out.
fadeOutEndThe distance to be fully faded out.
virtual void makVrv::DtWeatherEffect::runSimulationUpdateJob ( float  timeStep,
double  currentTime 
)
protectedvirtual

Called during a muti-thread update job to run a simulation update.

Parameters
timeStepThe change in time.
currentTimeThe current simulation time.
virtual void makVrv::DtWeatherEffect::updateHailSurfaceHit ( float  timeStep)
protectedvirtual

Does an update for the Hail surface hit type.

Parameters
timeStepThe simulation time step.
virtual void makVrv::DtWeatherEffect::updateWindBlownSurfaceHit ( float  timeStep)
protectedvirtual

Does an update for the WindBlown surface hit type.

Parameters
timeStepThe simulation time step.
virtual void makVrv::DtWeatherEffect::computeSortDepth ( const osg::Vec3 &  reference)
protectedvirtual

Computes the sort depth for all cells.

Parameters
referenceThe reference position to compute sort depth from.
virtual void makVrv::DtWeatherEffect::fillSortedParticles ( )
protectedvirtual

Fills the gpu buffer with sorted particle data.

virtual bool makVrv::DtWeatherEffect::bindMeshGroupData ( MeshGroup meshGroup,
osg::RenderInfo &  renderInfo 
) const
protectedvirtual

Binds the mesh group data to the vbo's.

Parameters
meshGroupThe mesh group object to bind.
renderInfoThe current rendering info.
virtual bool makVrv::DtWeatherEffect::bindDynamicMeshGroupData ( MeshGroup meshGroup,
osg::RenderInfo &  renderInfo 
) const
protectedvirtual

Binds the dynamic mesh group data to the vbo's.

Parameters
meshGroupThe mesh group object to bind.
renderInfoThe current rendering info.
virtual bool makVrv::DtWeatherEffect::bindVaoToMeshGroup ( GLuint  vao,
MeshGroup meshGroup,
osg::RenderInfo &  renderInfo 
) const
protectedvirtual

Binds the given voa to vbo's for a mesh group.

Parameters
vaoThe GL VAO handle.
meshGroupThe mesh group to bind.
renderInfoThe current rendering info.
virtual void makVrv::DtWeatherEffect::simulatePrecipitationParticles ( float  timeStep,
double  currentTime 
)
protectedvirtual

Simulates particles (movements, etc...) for precipitation.

Parameters
timeStepThe change in time.
currentTimeThe current simulation time.
virtual void makVrv::DtWeatherEffect::simulateParticles ( float  timeStep,
double  currentTime,
osg::Vec3d &  basisPosChange 
)
protectedvirtual

Simulates particles (life, movements, etc...).

Parameters
timeStepThe change in time.
currentTimeThe current simulation time.
basisPosChangeThe change in basis position.
void makVrv::DtWeatherEffect::wrapPosition ( float &  posX,
float &  posY,
float &  posZ 
)
protected

Keeps the given position in the effect radius.

Parameters
posXThe X position to constrain.
posYThe Y position to constrain.
posZThe Z position to constrain.
Particle* makVrv::DtWeatherEffect::getFreeParticle ( void  )
protected

Returns a particle from the free list. Makes the particle the head of the active list. NULL(0) if no particles are available.

void makVrv::DtWeatherEffect::freeParticle ( Particle particle)
protected

Adds the given particle to the free list. Handles unlinking from the active list.

void makVrv::DtWeatherEffect::spawnHailParticle ( const osg::Vec3d &  position,
const osg::Vec3 &  normal,
const unsigned char  usePhysics 
)
protected

Spawns a hail particle at the given location.

Parameters
positionThe world location.
normalThe spawn direction.
usePhysicsSet to 1 if the particle should use physics otherwise 0.
void makVrv::DtWeatherEffect::spawnWindBlownParticle ( const osg::Vec3d &  position,
const osg::Vec3 &  normal,
float  windRandom,
float  cosAng 
)
protected

Spawns a wind blown particle at the given location.

Parameters
positionThe world surface location.
normalThe world surface normal.
windRandomA +- wind random direction offset in radians.
cosAngleThe cosine of the surface normal vs world up.
const osg::Vec3 makVrv::DtWeatherEffect::crossProduct ( const osg::Vec3 &  v0,
const osg::Vec3 &  v1 
)
protected

Returns the cross product of the given 2 vectors.

Parameters
v0The first vector.
v1The second vector.
float makVrv::DtWeatherEffect::computeRandomMinMax ( float  fMin,
float  fMax 
)
protected

Computes a random floating point value in the min max range.

Parameters
minThe minimum value.
maxThe maximum value.
void makVrv::DtWeatherEffect::computeRandomPointInRadius ( osg::Vec2 &  point,
float  radius 
)
protected

Computes a random point in a radius with even distribution.

Parameters
pointThe computed point (output).
radiusThe radius.
bool makVrv::DtWeatherEffect::clampPosition ( osg::Vec3d &  position,
osg::Vec3 &  normal,
const osg::Vec3 &  up 
)
protected

Clamps the given position to a ground surface. Returns true if successful.

Parameters
positionThe input/output position to clamp.
normalThe output surface normal.
upThe up vector to use for detecting surfaces below the position.
virtual float makVrv::DtWeatherEffect::computeBlendControl ( const BlendData data,
float  blendPos 
) const
protectedvirtual

Computes an ouput value based on the given blending data and blend position.

Parameters
dataThe blending data (see BlendData struct for details).
blendPosThe blend position.
static void makVrv::DtWeatherEffect::theSimulationUpdateJob ( void *  data)
staticprotected

simulation update job function used as a callback for job splitting

static int makVrv::DtWeatherEffect::theSortBackToFront ( const void *  arg0,
const void *  arg1 
)
staticprotected

sort function used for qsorting particles

static void makVrv::DtWeatherEffect::theSortJob ( void *  data)
staticprotected

sort job function used as a callback for job splitting

Member Data Documentation

DtDe& makVrv::DtWeatherEffect::myDe
protected
osg::Matrixd makVrv::DtWeatherEffect::myBasisRot
protected
osg::Vec3d makVrv::DtWeatherEffect::myBasisPos
protected
osg::Vec3d makVrv::DtWeatherEffect::myLastBasisPos
protected
bool makVrv::DtWeatherEffect::myBasisDirty
protected
EffectType makVrv::DtWeatherEffect::myEffectType
protected
SurfaceHitType makVrv::DtWeatherEffect::mySurfaceHitType
protected
float makVrv::DtWeatherEffect::mySurfaceHitOffset
protected
float makVrv::DtWeatherEffect::mySurfaceHitMaxSlope
protected
float makVrv::DtWeatherEffect::mySurfaceHitTimer
protected
unsigned int makVrv::DtWeatherEffect::myRandomSeed
protected
osg::Vec3 makVrv::DtWeatherEffect::myScroll
protected
float makVrv::DtWeatherEffect::myRadius
protected
float makVrv::DtWeatherEffect::myWindDirectionRad
protected
float makVrv::DtWeatherEffect::myWindSpeedMps
protected
float makVrv::DtWeatherEffect::myWindSpeedMultiplier
protected
float makVrv::DtWeatherEffect::myWindLiftMultiplier
protected
float makVrv::DtWeatherEffect::myWindTurbulence
protected
float makVrv::DtWeatherEffect::myWindMin
protected
float makVrv::DtWeatherEffect::myWindMax
protected
float makVrv::DtWeatherEffect::myDragCoefficient
protected
osg::Vec3 makVrv::DtWeatherEffect::myVelocity
protected
float makVrv::DtWeatherEffect::myInitRotationRad
protected
float makVrv::DtWeatherEffect::myRotationVelocity
protected
float makVrv::DtWeatherEffect::myEffectFade
protected
float makVrv::DtWeatherEffect::myIntensity
protected
BlendData makVrv::DtWeatherEffect::myFadeByIntensity
protected
BlendData makVrv::DtWeatherEffect::myFadeByWind
protected
BlendData makVrv::DtWeatherEffect::myTexCoordAnimSpeedByWind
protected
BlendData makVrv::DtWeatherEffect::myParticlesByIntensity
protected
float makVrv::DtWeatherEffect::myParticleSize
protected
osg::Vec3 makVrv::DtWeatherEffect::myBaseColor
protected
bool makVrv::DtWeatherEffect::myAdditiveBlend
protected
osg::ref_ptr<osg::BlendFunc> makVrv::DtWeatherEffect::myBlendFunc
protected
float makVrv::DtWeatherEffect::myStreak
protected
float makVrv::DtWeatherEffect::myStreakAdjustment
protected
bool makVrv::DtWeatherEffect::myStreakAdjustmentEnable
protected
bool makVrv::DtWeatherEffect::myCameraStreak
protected
float makVrv::DtWeatherEffect::myScaleAnimMinX
protected
float makVrv::DtWeatherEffect::myScaleAnimMaxX
protected
float makVrv::DtWeatherEffect::myScaleAnimMinY
protected
float makVrv::DtWeatherEffect::myScaleAnimMaxY
protected
float makVrv::DtWeatherEffect::myScaleSpeed
protected
float makVrv::DtWeatherEffect::myTextureAtlasCols
protected
float makVrv::DtWeatherEffect::myTextureAtlasRows
protected
float makVrv::DtWeatherEffect::myTextureAtlasCol
protected
float makVrv::DtWeatherEffect::myTextureAtlasRow
protected
float makVrv::DtWeatherEffect::myTexCoordAnimDirSpeedU
protected
float makVrv::DtWeatherEffect::myTexCoordAnimDirSpeedV
protected
float makVrv::DtWeatherEffect::myTexCoordAnimScale0
protected
float makVrv::DtWeatherEffect::myTexCoordAnimScale1
protected
float makVrv::DtWeatherEffect::myTexCoordAnimDirOffsetU
protected
float makVrv::DtWeatherEffect::myTexCoordAnimDirOffsetV
protected
float makVrv::DtWeatherEffect::myTexturePatternMix0
protected
float makVrv::DtWeatherEffect::myTexturePatternMix1
protected
float makVrv::DtWeatherEffect::myDepthSoftness
protected
float makVrv::DtWeatherEffect::myDepthProximityMix
protected
float makVrv::DtWeatherEffect::myDepthProximityStart
protected
float makVrv::DtWeatherEffect::myDepthProximityRange
protected
float makVrv::DtWeatherEffect::myDepthProximityInvRange
protected
bool makVrv::DtWeatherEffect::mySortEnable
protected
bool makVrv::DtWeatherEffect::myClampToSurface
protected
bool makVrv::DtWeatherEffect::myOrientFlat
protected
osg::Vec3 makVrv::DtWeatherEffect::myGravity
protected
float makVrv::DtWeatherEffect::myRadiusFadeInStart
protected
float makVrv::DtWeatherEffect::myRadiusFadeInFalloff
protected
float makVrv::DtWeatherEffect::myRadiusFadeOutStart
protected
float makVrv::DtWeatherEffect::myRadiusFadeOutFalloff
protected
int makVrv::DtWeatherEffect::myWindBlownSpawnCount
protected
float makVrv::DtWeatherEffect::myWindBlownMinSpeed
protected
float makVrv::DtWeatherEffect::myWindBlownMaxSpeed
protected
float makVrv::DtWeatherEffect::myWindBlownMinTime
protected
float makVrv::DtWeatherEffect::myWindBlownMaxTime
protected
MeshGroup* makVrv::DtWeatherEffect::myMeshGroup
protected
DtGlVaoManager* makVrv::DtWeatherEffect::myVaoManager
protected
Particle* makVrv::DtWeatherEffect::myParticlesMemoryPool
protected
int makVrv::DtWeatherEffect::myParticleMemoryPoolCount
protected
Particle* makVrv::DtWeatherEffect::myParticlesFree
protected
Particle* makVrv::DtWeatherEffect::myParticlesActive
protected
int makVrv::DtWeatherEffect::myParticleActiveCount
protected
Particle** makVrv::DtWeatherEffect::myRenderList
protected
int makVrv::DtWeatherEffect::myRenderParticleCount
protected
SimulationUpdateJobData makVrv::DtWeatherEffect::mySimulationUpdateJobData
protected
DtJobSplitterJob makVrv::DtWeatherEffect::mySimulationUpdateJob
protected
SortJobData makVrv::DtWeatherEffect::mySortJobData
protected
DtJobSplitterJob makVrv::DtWeatherEffect::mySortJob
protected
DtRandomNumberGenerator makVrv::DtWeatherEffect::myRandomNumberGen
protected
DtIntersector* makVrv::DtWeatherEffect::myIntersector = nullptr
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)