![]() |
VR-Forces Developer's Guide
|
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.

Classes | |
| struct | DrawData |
| struct | MeshGroup |
| struct | Particle |
| struct | SortJobData |
Public Member Functions | |
| virtual | ~DtWeatherPrecipitationShaft () |
| DtWeatherPrecipitationShaft ()=delete | |
| DtWeatherPrecipitationShaft (const DtWeatherPrecipitationShaft &other)=delete | |
| DtWeatherPrecipitationShaft & | operator= (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 | |
| DtDe & | myDe |
| bool | myEnabled |
| bool | myCulled |
| MeshGroup * | myMeshGroup |
| DtGlVaoManager * | myVaoManager |
| osg::Vec3d | myPosition |
| osg::Matrixd | myRotation |
| float | myBoundsX |
| float | myBoundsY |
| float | myBoundsZ |
| float | myBoundsCornerRadius |
| float | myParticleWidth |
| float | myIntensity |
| osg::Vec3f | myBaseColor |
| Particle * | myParticles |
| int | myParticlePoolCount |
| int | myParticleActiveCount |
| SortJobData | mySortJobData |
| DtJobSplitterJob | mySortJob |
| DtRandomNumberGenerator | myRandomNumberGen |
| unsigned int | myRandomSeed |
| float | myWindDirectionRad |
| float | myWindSpeedMps |
Private Attributes | |
| friend | DtWeatherPrecipitationShaftCreator |
|
virtual |
DTOR.
|
delete |
Default Constructor not implemented.
|
delete |
Copy Constructor not implemented - Copy not allowed.
|
protected |
CTOR.
|
delete |
Assignment Operator not implemented - Assignment not allowed.
|
virtual |
Called after creation to initialize effects.
|
virtual |
Release all gl objects used by items in this layer.
|
virtual |
Culls the area based on the current camera.
| camPos | The current camera position. |
| frustum | The frustum used for culling. |
| jobSplitter | A job splitter to add predraw jobs to. Returns true if visible. |
|
virtual |
Returns true if the given position is above the precipitation shaft.
| position | The position to test. |
|
virtual |
Draw precipitation shafts.
|
virtual |
Sets the bounds of the object.
| bounds | The (x,y,z) of the bounds. |
| cornerRadius | The radius at each corner of the bounds. |
|
virtual |
Sets the object transform.
| position | The transform position in world space. |
| orientation | The yaw orientation in degrees (0 = north). |
|
virtual |
Sets the intensity.
| intensity | The intensity (affects visibility). |
|
virtual |
Sets a base color for the precipitation shaft lighting.
| color | The rgb color values (0.0 - 1.0 scale). |
|
virtual |
Sets the current wind.
| windDirectionRad | The wind direction in radians. |
| windSpeedMps | The wind speed in meters per second. |
|
virtual |
Sorts particles for the current view. Fills indice buffer.
| localCamPos | The local camera position. |
|
virtual |
Enables or disables the precipitation shaft.
| enabled | Set to true to enable the precipitation shaft. |
|
virtual |
Returns the enabled state.
|
virtual |
Returns the culled state. This will indicate if the precipitation shaft was culled during the last scenegraph culling pass.
|
virtual |
Computes the bounds of the area.
| bounds | The output (width, length, height, corner radius). |
| position | The output world postition. |
| rotation | The output world rotation. |
|
protectedvirtual |
Checks to see if the local 2D position is within the bounds. Uses the current bound corner radius.
| x | The local x position |
| y | The local y position. |
| bounds | The (x, y, corner radius) bounds. |
|
protectedvirtual |
Computes a random floating point value in the min max range.
| min | The minimum value. |
| max | The maximum value. |
|
protectedvirtual |
Computes the sort depth for all cells.
| reference | The reference position to compute sort depth from. |
|
protectedvirtual |
Fills the gpu buffer with sorted particle data.
|
protectedvirtual |
Binds the mesh group data to the vbo's.
| meshGroup | The mesh group object to bind. |
| renderInfo | The current rendering info. |
|
protectedvirtual |
Binds the dynamic mesh group data to the vbo's.
| meshGroup | The mesh group object to bind. |
| renderInfo | The current rendering info. |
|
protectedvirtual |
Binds the given voa to vbo's for a mesh group.
| vao | The GL VAO handle. |
| meshGroup | The mesh group to bind. |
| renderInfo | The current rendering info. |
|
staticprotected |
sort function used for qsorting particles
|
staticprotected |
sort job function used as a callback for job splitting
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |