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 | Static Protected Member Functions | Protected Attributes | Private Attributes
makVrv::DtWeatherPrecipitationShaft Class Reference

This class simulates and renders a precipitation shaft area. The area volume is filled with a density of particles that are as tall as the bounds. The particles use a shader to give the illusion of falling rain. The particles bend in the wind direction depending on wind strength. An intensity value can be set to increase or decrease the visibility of the effect.

Inheritance diagram for makVrv::DtWeatherPrecipitationShaft:
Inheritance graph
[legend]

Classes

struct  DrawData
 
struct  MeshGroup
 
struct  Particle
 
struct  SortJobData
 

Public Member Functions

virtual ~DtWeatherPrecipitationShaft ()
 
 DtWeatherPrecipitationShaft ()=delete
 
 DtWeatherPrecipitationShaft (const DtWeatherPrecipitationShaft &other)=delete
 
DtWeatherPrecipitationShaftoperator= (const DtWeatherPrecipitationShaft &other)=delete
 
virtual void init ()
 
virtual void releaseGLObjects (osg::State *state) const
 
virtual bool cullUpdate (const osg::Vec3d &camPos, const osg::Matrixd &viewMatrixI, const Frustum_64 &frustum, DtJobSplitter *jobSplitter)
 
virtual bool isPositionAboveArea (const osg::Vec3d &position)
 
virtual void draw (DtWeatherPrecipitationShaft::DrawData &drawData)
 
virtual void setBounds (const DtVector &bounds, float cornerRadius)
 
virtual void setTransform (const osg::Vec3d &position, const osg::Matrixd &rotation)
 
virtual void setIntensity (const float intensity)
 
virtual void setBaseColor (const DtVector &color)
 
virtual void setWind (const float windDirectionRad, const float windSpeedMps)
 
virtual void runSort (const osg::Vec3f &localCamPos)
 
virtual void setEnabled (bool enabled)
 
virtual bool enabled () const
 
virtual bool culled () const
 
virtual void computeBounds (osg::Vec4f &bounds, osg::Vec3d &position, osg::Matrixd &rotation) const
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Protected Member Functions

 DtWeatherPrecipitationShaft (makVrv::DtDe &de)
 
virtual bool positionInBounds2D (const float x, const float y, const osg::Vec3f &bounds)
 
virtual float computeRandomMinMax (float fMin, float fMax)
 
virtual void computeSortDepth (const osg::Vec3f &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
 

Static Protected Member Functions

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

Protected Attributes

DtDemyDe
 
bool myEnabled
 
bool myCulled
 
MeshGroupmyMeshGroup
 
DtGlVaoManagermyVaoManager
 
osg::Vec3d myPosition
 
osg::Matrixd myRotation
 
float myBoundsX
 
float myBoundsY
 
float myBoundsZ
 
float myBoundsCornerRadius
 
float myParticleWidth
 
float myIntensity
 
osg::Vec3f myBaseColor
 
ParticlemyParticles
 
int myParticlePoolCount
 
int myParticleActiveCount
 
SortJobData mySortJobData
 
DtJobSplitterJob mySortJob
 
DtRandomNumberGenerator myRandomNumberGen
 
unsigned int myRandomSeed
 
float myWindDirectionRad
 
float myWindSpeedMps
 

Private Attributes

friend DtWeatherPrecipitationShaftCreator
 

Constructor & Destructor Documentation

virtual makVrv::DtWeatherPrecipitationShaft::~DtWeatherPrecipitationShaft ( )
virtual

DTOR.

makVrv::DtWeatherPrecipitationShaft::DtWeatherPrecipitationShaft ( )
delete

Default Constructor not implemented.

makVrv::DtWeatherPrecipitationShaft::DtWeatherPrecipitationShaft ( const DtWeatherPrecipitationShaft other)
delete

Copy Constructor not implemented - Copy not allowed.

makVrv::DtWeatherPrecipitationShaft::DtWeatherPrecipitationShaft ( makVrv::DtDe de)
protected

CTOR.

Member Function Documentation

DtWeatherPrecipitationShaft& makVrv::DtWeatherPrecipitationShaft::operator= ( const DtWeatherPrecipitationShaft other)
delete

Assignment Operator not implemented - Assignment not allowed.

virtual void makVrv::DtWeatherPrecipitationShaft::init ( )
virtual

Called after creation to initialize effects.

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

Release all gl objects used by items in this layer.

virtual bool makVrv::DtWeatherPrecipitationShaft::cullUpdate ( const osg::Vec3d &  camPos,
const osg::Matrixd &  viewMatrixI,
const Frustum_64 frustum,
DtJobSplitter jobSplitter 
)
virtual

Culls the area based on the current camera.

Parameters
camPosThe current camera position.
frustumThe frustum used for culling.
jobSplitterA job splitter to add predraw jobs to. Returns true if visible.
virtual bool makVrv::DtWeatherPrecipitationShaft::isPositionAboveArea ( const osg::Vec3d &  position)
virtual

Returns true if the given position is above the precipitation shaft.

Parameters
positionThe position to test.
virtual void makVrv::DtWeatherPrecipitationShaft::draw ( DtWeatherPrecipitationShaft::DrawData drawData)
virtual

Draw precipitation shafts.

virtual void makVrv::DtWeatherPrecipitationShaft::setBounds ( const DtVector &  bounds,
float  cornerRadius 
)
virtual

Sets the bounds of the object.

Parameters
boundsThe (x,y,z) of the bounds.
cornerRadiusThe radius at each corner of the bounds.
virtual void makVrv::DtWeatherPrecipitationShaft::setTransform ( const osg::Vec3d &  position,
const osg::Matrixd &  rotation 
)
virtual

Sets the object transform.

Parameters
positionThe transform position in world space.
orientationThe yaw orientation in degrees (0 = north).
virtual void makVrv::DtWeatherPrecipitationShaft::setIntensity ( const float  intensity)
virtual

Sets the intensity.

Parameters
intensityThe intensity (affects visibility).
virtual void makVrv::DtWeatherPrecipitationShaft::setBaseColor ( const DtVector &  color)
virtual

Sets a base color for the precipitation shaft lighting.

Parameters
colorThe rgb color values (0.0 - 1.0 scale).
virtual void makVrv::DtWeatherPrecipitationShaft::setWind ( const float  windDirectionRad,
const float  windSpeedMps 
)
virtual

Sets the current wind.

Parameters
windDirectionRadThe wind direction in radians.
windSpeedMpsThe wind speed in meters per second.
virtual void makVrv::DtWeatherPrecipitationShaft::runSort ( const osg::Vec3f &  localCamPos)
virtual

Sorts particles for the current view. Fills indice buffer.

Parameters
localCamPosThe local camera position.
virtual void makVrv::DtWeatherPrecipitationShaft::setEnabled ( bool  enabled)
virtual

Enables or disables the precipitation shaft.

Parameters
enabledSet to true to enable the precipitation shaft.
virtual bool makVrv::DtWeatherPrecipitationShaft::enabled ( ) const
virtual

Returns the enabled state.

virtual bool makVrv::DtWeatherPrecipitationShaft::culled ( ) const
virtual

Returns the culled state. This will indicate if the precipitation shaft was culled during the last scenegraph culling pass.

virtual void makVrv::DtWeatherPrecipitationShaft::computeBounds ( osg::Vec4f &  bounds,
osg::Vec3d &  position,
osg::Matrixd &  rotation 
) const
virtual

Computes the bounds of the area.

Parameters
boundsThe output (width, length, height, corner radius).
positionThe output world postition.
rotationThe output world rotation.
virtual bool makVrv::DtWeatherPrecipitationShaft::positionInBounds2D ( const float  x,
const float  y,
const osg::Vec3f &  bounds 
)
protectedvirtual

Checks to see if the local 2D position is within the bounds. Uses the current bound corner radius.

Parameters
xThe local x position
yThe local y position.
boundsThe (x, y, corner radius) bounds.
virtual float makVrv::DtWeatherPrecipitationShaft::computeRandomMinMax ( float  fMin,
float  fMax 
)
protectedvirtual

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

Parameters
minThe minimum value.
maxThe maximum value.
virtual void makVrv::DtWeatherPrecipitationShaft::computeSortDepth ( const osg::Vec3f &  reference)
protectedvirtual

Computes the sort depth for all cells.

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

Fills the gpu buffer with sorted particle data.

virtual bool makVrv::DtWeatherPrecipitationShaft::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::DtWeatherPrecipitationShaft::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::DtWeatherPrecipitationShaft::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.
static int makVrv::DtWeatherPrecipitationShaft::theSortBackToFront ( const void *  arg0,
const void *  arg1 
)
staticprotected

sort function used for qsorting particles

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

sort job function used as a callback for job splitting

Member Data Documentation

friend makVrv::DtWeatherPrecipitationShaft::DtWeatherPrecipitationShaftCreator
private
DtDe& makVrv::DtWeatherPrecipitationShaft::myDe
protected
bool makVrv::DtWeatherPrecipitationShaft::myEnabled
protected
bool makVrv::DtWeatherPrecipitationShaft::myCulled
protected
MeshGroup* makVrv::DtWeatherPrecipitationShaft::myMeshGroup
protected
DtGlVaoManager* makVrv::DtWeatherPrecipitationShaft::myVaoManager
protected
osg::Vec3d makVrv::DtWeatherPrecipitationShaft::myPosition
protected
osg::Matrixd makVrv::DtWeatherPrecipitationShaft::myRotation
protected
float makVrv::DtWeatherPrecipitationShaft::myBoundsX
protected
float makVrv::DtWeatherPrecipitationShaft::myBoundsY
protected
float makVrv::DtWeatherPrecipitationShaft::myBoundsZ
protected
float makVrv::DtWeatherPrecipitationShaft::myBoundsCornerRadius
protected
float makVrv::DtWeatherPrecipitationShaft::myParticleWidth
protected
float makVrv::DtWeatherPrecipitationShaft::myIntensity
protected
osg::Vec3f makVrv::DtWeatherPrecipitationShaft::myBaseColor
protected
Particle* makVrv::DtWeatherPrecipitationShaft::myParticles
protected
int makVrv::DtWeatherPrecipitationShaft::myParticlePoolCount
protected
int makVrv::DtWeatherPrecipitationShaft::myParticleActiveCount
protected
SortJobData makVrv::DtWeatherPrecipitationShaft::mySortJobData
protected
DtJobSplitterJob makVrv::DtWeatherPrecipitationShaft::mySortJob
protected
DtRandomNumberGenerator makVrv::DtWeatherPrecipitationShaft::myRandomNumberGen
protected
unsigned int makVrv::DtWeatherPrecipitationShaft::myRandomSeed
protected
float makVrv::DtWeatherPrecipitationShaft::myWindDirectionRad
protected
float makVrv::DtWeatherPrecipitationShaft::myWindSpeedMps
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)