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

this class is used to create an effect around the eye to represent blowing particle effects such as sand. The effect is made from a particle system with simple wind physics applied. Effects can be added to a ground fog area. Each effect is initialized with a fixed particle count, particle size, and effect radius around the eye. Note that sandstorms also make use of this effect class.

Classes

struct  DrawData
 
struct  MeshGroup
 
struct  Particle
 
struct  SortJobData
 

Public Member Functions

 DtGroundFogEffect (makVrv::DtDe &de, const int &particleCount, const float &particleSize, const float &radius)
 
virtual ~DtGroundFogEffect ()
 
virtual void init (int particleCount, float particleSize, float radius)
 
virtual void releaseGLObjects (osg::State *state) const
 
virtual void draw (DtGroundFogEffect::DrawData &drawData, const osg::Vec3 &baseColor) const
 
virtual void cullUpdate (const osg::Vec3d &camPos, DtJobSplitter *jobSplitter)
 
virtual void setEnable (bool enable)
 
virtual void setWind (float windDirectionRad, float windSpeedMps)
 
virtual void setWindSpeedMultiplier (float multiplier)
 
virtual void setWindLiftMultiplier (float multiplier)
 
virtual void setWindTurbulence (float multiplier)
 
virtual void setDensity (float density)
 
virtual void setEffectFade (float fade)
 
virtual void setIntensityPerWindRamp (float start, float end)
 
virtual float computeIntensityPerWind ()
 
virtual void setBasisRotation (const osg::Matrixd &rotation)
 
virtual void setColorMult (float r, float g, float b)
 
virtual float radius () const
 
virtual void runSort (const osg::Vec3 &localCamPos)
 

Protected Member Functions

virtual void connectSignals ()
 
virtual void slot_simulationUpdate ()
 
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 simulateParticles (float timeStep, double currentTime)
 
void wrapPosition (float &posX, float &posY, float &posZ)
 

Protected Attributes

DtDemyDe
 
osg::Matrixd myBasisRot
 
bool myEnable
 
osg::Vec3 myScroll
 
float myRadius
 
float myWindDirectionRad
 
float myWindSpeedMps
 
float myWindSpeedMultiplier
 
float myWindLiftMultiplier
 
float myWindTurbulence
 
double myLastTime
 
float myEffectFade
 
float myParticleSize
 
osg::Vec3 myColorMult
 
float mfIntensityPerWindStart
 
float mfIntensityPerWindEnd
 
float myDensity
 
MeshGroupmyMeshGroup
 
DtGlVaoManagermyVaoManager
 
ParticlemyParticles
 
int myParticleCount
 
SortJobData mySortJobData
 
DtJobSplitterJob mySortJob
 
DtSignalConnectionManager myConnections
 

Private Member Functions

 DtGroundFogEffect ()
 
 DtGroundFogEffect (const DtGroundFogEffect &other)
 
DtGroundFogEffectoperator= (const DtGroundFogEffect &other)
 

Static Private Member Functions

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

Constructor & Destructor Documentation

makVrv::DtGroundFogEffect::DtGroundFogEffect ( makVrv::DtDe de,
const int particleCount,
const float &  particleSize,
const float &  radius 
)

CTOR.

virtual makVrv::DtGroundFogEffect::~DtGroundFogEffect ( )
virtual

DTOR.

makVrv::DtGroundFogEffect::DtGroundFogEffect ( )
private

Default Constructor not implemented.

makVrv::DtGroundFogEffect::DtGroundFogEffect ( const DtGroundFogEffect other)
private

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

DtGroundFogEffect& makVrv::DtGroundFogEffect::operator= ( const DtGroundFogEffect other)
private

Assignment Operator not implemented - Assignment not allowed.

virtual void makVrv::DtGroundFogEffect::init ( int  particleCount,
float  particleSize,
float  radius 
)
virtual

Initialize the effect.

virtual void makVrv::DtGroundFogEffect::releaseGLObjects ( osg::State *  state) const
virtual

Release all gl objects used by this object.

virtual void makVrv::DtGroundFogEffect::draw ( DtGroundFogEffect::DrawData drawData,
const osg::Vec3 &  baseColor 
) const
virtual

Issues the drawing command for the effect.

virtual void makVrv::DtGroundFogEffect::cullUpdate ( const osg::Vec3d &  camPos,
DtJobSplitter jobSplitter 
)
virtual

Prepares the patch for drawing bsed on the camera position.

Parameters
camPosThe camera position in fog system space.
jobSplitterA job splitter to add predraw jobs to.
virtual void makVrv::DtGroundFogEffect::setEnable ( bool  enable)
virtual

Sets the enable flag to enable or disable the effect.

Parameters
enableThe enable state to set.
virtual void makVrv::DtGroundFogEffect::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::DtGroundFogEffect::setWindSpeedMultiplier ( float  multiplier)
virtual

Sets a wind speed multiplier used for particle physics.

Parameters
multiplierThe multiplier value.
virtual void makVrv::DtGroundFogEffect::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::DtGroundFogEffect::setWindTurbulence ( float  multiplier)
virtual

Sets a wind turbulence multiplier for particle physics.

Parameters
multiplierThe multiplier value (basically height deviation in meters).
virtual void makVrv::DtGroundFogEffect::setDensity ( float  density)
virtual

Sets a density value to control exp2 distance thickness (generally <= 1.0). The higher the density, the more the effect becomes apparent closer to the eye.

virtual void makVrv::DtGroundFogEffect::setEffectFade ( float  fade)
virtual

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

virtual void makVrv::DtGroundFogEffect::setIntensityPerWindRamp ( float  start,
float  end 
)
virtual

Sets an intensity ramp based on wind speed.

Parameters
startThe starting wind speed in mps. (no effect)
endThe ending wind speed in mps. (full effect)
virtual float makVrv::DtGroundFogEffect::computeIntensityPerWind ( )
virtual

Returns an intensity (0.0 - 1.0) based on current wind and wind ramp.

virtual void makVrv::DtGroundFogEffect::setBasisRotation ( const osg::Matrixd &  rotation)
virtual

Sets the current basis rotation used for earth calculations.

virtual void makVrv::DtGroundFogEffect::setColorMult ( float  r,
float  g,
float  b 
)
virtual

Sets a base color color multiplier.

Parameters
(r,g,b)The r,g,b multiplier values.
virtual float makVrv::DtGroundFogEffect::radius ( ) const
virtual

Returns the radius of the effect.

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

Sorts particles for the current view. Fills indice buffer.

Parameters
localCamPosThe local camera position.
virtual void makVrv::DtGroundFogEffect::connectSignals ( )
protectedvirtual

Connects all the signals, Non-virtural, called in the ctor.

virtual void makVrv::DtGroundFogEffect::slot_simulationUpdate ( )
protectedvirtual

Signal handler to run a simulation update.

virtual void makVrv::DtGroundFogEffect::computeSortDepth ( const osg::Vec3 &  reference)
protectedvirtual

Computes the sort depth for all cells.

virtual void makVrv::DtGroundFogEffect::fillSortedParticles ( )
protectedvirtual

Fills the gpu buffer with sorted particle data.

virtual bool makVrv::DtGroundFogEffect::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::DtGroundFogEffect::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::DtGroundFogEffect::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::DtGroundFogEffect::simulateParticles ( float  timeStep,
double  currentTime 
)
protectedvirtual

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

timeStep The change in time. currentTime The current simulation time.

void makVrv::DtGroundFogEffect::wrapPosition ( float &  posX,
float &  posY,
float &  posZ 
)
protected

Keeps the given position in the effect radius.

posX The X position to constrain. posY The Y position to constrain. posZ The Z position to constrain.

static int makVrv::DtGroundFogEffect::theSortBackToFront ( const void *  arg0,
const void *  arg1 
)
staticprivate

sort function used for qsorting particles

static void makVrv::DtGroundFogEffect::theSortJob ( void *  data)
staticprivate

sort job function used as a callback for job splitting

Member Data Documentation

DtDe& makVrv::DtGroundFogEffect::myDe
protected
osg::Matrixd makVrv::DtGroundFogEffect::myBasisRot
protected
bool makVrv::DtGroundFogEffect::myEnable
protected
osg::Vec3 makVrv::DtGroundFogEffect::myScroll
protected
float makVrv::DtGroundFogEffect::myRadius
protected
float makVrv::DtGroundFogEffect::myWindDirectionRad
protected
float makVrv::DtGroundFogEffect::myWindSpeedMps
protected
float makVrv::DtGroundFogEffect::myWindSpeedMultiplier
protected
float makVrv::DtGroundFogEffect::myWindLiftMultiplier
protected
float makVrv::DtGroundFogEffect::myWindTurbulence
protected
double makVrv::DtGroundFogEffect::myLastTime
protected
float makVrv::DtGroundFogEffect::myEffectFade
protected
float makVrv::DtGroundFogEffect::myParticleSize
protected
osg::Vec3 makVrv::DtGroundFogEffect::myColorMult
protected
float makVrv::DtGroundFogEffect::mfIntensityPerWindStart
protected
float makVrv::DtGroundFogEffect::mfIntensityPerWindEnd
protected
float makVrv::DtGroundFogEffect::myDensity
protected
MeshGroup* makVrv::DtGroundFogEffect::myMeshGroup
protected
DtGlVaoManager* makVrv::DtGroundFogEffect::myVaoManager
protected
Particle* makVrv::DtGroundFogEffect::myParticles
protected
int makVrv::DtGroundFogEffect::myParticleCount
protected
SortJobData makVrv::DtGroundFogEffect::mySortJobData
protected
DtJobSplitterJob makVrv::DtGroundFogEffect::mySortJob
protected
DtSignalConnectionManager makVrv::DtGroundFogEffect::myConnections
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)