VR-Forces 4.8 Class Documentation
 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. More...

Classes

struct  DrawData
 A structure used to hold data for drawing. More...
 
struct  MeshGroup
 A structure used to define a mesh group (voa, positions, coords). More...
 
struct  Particle
 A structure used to define a simulation particle. More...
 
struct  SortJobData
 a structure to hold data for a sorting job More...
 

Public Member Functions

 DtGroundFogEffect (makVrv::DtDe &de)
 CTOR. More...
 
virtual ~DtGroundFogEffect ()
 DTOR. More...
 
virtual void init (int particleCount, float particleSize, float radius)
 Initialize the effect. More...
 
virtual void releaseGLObjects (osg::State *state) const
 Release all gl objects used by this object. More...
 
virtual void draw (DtGroundFogEffect::DrawData &drawData, const osg::Vec3 &baseColor) const
 Issues the drawing command for the effect. More...
 
virtual void cullUpdate (const osg::Vec3d &camPos, DtJobSplitter *jobSplitter)
 Prepares the patch for drawing bsed on the camera position. More...
 
virtual void setEnable (bool enable)
 Sets the enable flag to enable or disable the effect. More...
 
virtual void setWind (float windDirectionRad, float windSpeedMps)
 Sets the current wind. More...
 
virtual void setWindSpeedMultiplier (float multiplier)
 Sets a wind speed multiplier used for particle physics. More...
 
virtual void setWindLiftMultiplier (float multiplier)
 Sets a wind lift multiplier used for particle physics. More...
 
virtual void setWindTurbulence (float multiplier)
 Sets a wind turbulence multiplier for particle physics. More...
 
virtual void setDensity (float density)
 Sets a density value to control exp2 distance thickness (generally <= 1.0). More...
 
virtual void setEffectFade (float fade)
 Sets a (0.0 - 1.0) value to control the effect fade. More...
 
virtual void setIntensityPerWindRamp (float start, float end)
 Sets an intensity ramp based on wind speed. More...
 
virtual float computeIntensityPerWind ()
 Returns an intensity (0.0 - 1.0) based on current wind and wind ramp. More...
 
virtual void setBasisRotation (const osg::Matrixd &rotation)
 Sets the current basis rotation used for earth calculations. More...
 
virtual void setColorMult (float r, float g, float b)
 Sets a base color color multiplier. More...
 
virtual float radius () const
 Returns the radius of the effect. More...
 
virtual void runSort (const osg::Vec3 &localCamPos)
 Sorts particles for the current view. More...
 

Protected Member Functions

virtual void connectSignals ()
 Connects all the signals, Non-virtural, called in the ctor. More...
 
virtual void disconnectSignals ()
 Disconnects all the signals, called in the dtor. More...
 
virtual void slot_simulationUpdate ()
 Signal handler to run a simulation update. More...
 
virtual void computeSortDepth (const osg::Vec3 &reference)
 Computes the sort depth for all cells. More...
 
virtual void fillSortedParticles ()
 Fills the gpu buffer with sorted particle data. More...
 
virtual bool bindMeshGroupData (MeshGroup *meshGroup, osg::RenderInfo &renderInfo) const
 Binds the mesh group data to the vbo's. More...
 
virtual bool bindDynamicMeshGroupData (MeshGroup *meshGroup, osg::RenderInfo &renderInfo) const
 Binds the dynamic mesh group data to the vbo's. More...
 
virtual bool bindVaoToMeshGroup (GLuint vao, MeshGroup *meshGroup, osg::RenderInfo &renderInfo) const
 Binds the given voa to vbo's for a mesh group. More...
 
virtual void simulateParticles (float timeStep, double currentTime)
 Simulates particle life (movements, etc...). More...
 
void wrapPosition (float &posX, float &posY, float &posZ)
 Keeps the given position in the effect radius. More...
 

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
 

Private Member Functions

 DtGroundFogEffect ()
 Default Constructor not implemented. More...
 
 DtGroundFogEffect (const DtGroundFogEffect &other)
 Copy Constructor not implemented - Copy not allowed. More...
 
DtGroundFogEffectoperator= (const DtGroundFogEffect &other)
 Assignment Operator not implemented - Assignment not allowed. More...
 

Static Private Member Functions

static int theSortBackToFront (const void *arg0, const void *arg1)
 sort function used for qsorting particles More...
 
static void theSortJob (void *data)
 sort job function used as a callback for job splitting More...
 

Detailed Description

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.

Constructor & Destructor Documentation

makVrv::DtGroundFogEffect::DtGroundFogEffect ( makVrv::DtDe de)

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::disconnectSignals ( )
protectedvirtual

Disconnects all the signals, called in the dtor.

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

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)