![]() |
VR-Forces 5.0.2 Developer's Guide
|
A group node which serves as a root for weather areas, patchy ground fog areas and effects, infinite height fog, sandstorms, precipitation shafts, and lightning.
A special note that sandstorms rely heavily on ground fog and ground fog effects. Sandstorms are achieved using various ground fog and effect configurations such as base color modification and local dust eye effects.
This group node is the top level node in the scenegraph for ground fog. The node also serves as the main interface to create and modify ground fog layers. All ground fog areas share a material state and all ground fog effects share a material state. Infinite height fog management is handled directly in this class.
This class manages weather areas (DtWeatherArea) such as blowing dust, blowing sand, and blowing snow.
This class also handles signals from weather area objects. These objects are generally come from DtLocalEnvironmentalsControllerObject which processes data for local weather area entities.
During the cull phase, draw items such as ground fog areas, ground fog area effects, and precipitation shafts, are all placed in draw sort bins (pre-clouds, post clouds, or transparent) depending on the desired sorting for a painters algorithm. Three osg drawables are placed in the scenegraph to hook into (pre-clouds, post clouds, or transparent) drawImplementation callbacks. Each draw implementation callback will flush the appropriate sorting bin.

Classes | |
| struct | DrawItem |
| struct | DrawItemSortDistanceComparator |
| struct | GroundFogEffectState |
| struct | GroundFogPatchState |
| struct | HeightFogItem |
| struct | LightningState |
| struct | PrecipitationShaftState |
| struct | SoftnessUniforms |
Public Member Functions | |
| DtWeatherAreaGroup (DtDe &de) | |
| DtWeatherAreaGroup (const DtWeatherAreaGroup &orig, const osg::CopyOp &opr) | |
| virtual | ~DtWeatherAreaGroup () |
| DtWeatherAreaGroup ()=delete | |
| DtWeatherAreaGroup (const DtWeatherAreaGroup &other)=delete | |
| DtWeatherAreaGroup & | operator= (const DtWeatherAreaGroup &other)=delete |
| virtual void | init () |
| virtual void | releaseGLObjects (osg::State *state=0) const override |
| virtual osg::Object * | clone (const osg::CopyOp ©op) const |
| virtual osg::Object * | cloneType () const |
| virtual void | deleteGeode () |
| virtual osg::Node * | getOrCreateSensorNode (SensorMaterialType matType) |
| virtual void | removeCloudLayer (DtCloudLayerId layerId) |
| virtual bool | removeHeightFog (DtUniqueID uniqueId) |
| virtual void | removeCloudLayers () |
| virtual void | addGroundFog (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, double density, bool infinite, bool relative, bool altitudeIsHAT) |
| virtual DtUniqueID | addHeightFog (const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, double density, bool relative) |
| virtual void | addPatchyGroundFog (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, double density, bool relative) |
| virtual void | addSandstorm (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, double density, bool infinite, bool relative, bool altitudeIsHAT) |
| virtual void | addBlowingDustArea (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, bool relative) |
| virtual void | addBlowingSandArea (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, bool relative) |
| virtual void | addBlowingSnowArea (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, bool relative) |
| virtual DtUniqueID | addPrecipitationShaft (osg::Vec3d &position, const osg::Matrixd &rotation, const DtVector &bounds, const float cornerRadius, const float intensity) |
| virtual void | removePrecipitationShaft (DtUniqueID uniqueId) |
| virtual void | setWeatherPrecipitationShaftBounds (DtUniqueID uniqueId, const DtVector &bounds, const float cornerRadius) |
| virtual void | setWeatherPrecipitationShaftTransform (DtUniqueID uniqueId, const osg::Vec3d &position, const osg::Matrixd &rotation) |
| virtual void | setWeatherPrecipitationShaftIntensity (DtUniqueID uniqueId, const float intensity) |
| virtual void | setWeatherPrecipitationShaftBaseColor (DtUniqueID uniqueId, const DtVector &color) |
| virtual void | setWeatherPrecipitationShaftWind (DtUniqueID uniqueId, const float windDirectionRad, const float windSpeedMps) |
| virtual void | setWeatherPrecipitationShaftEnabled (DtUniqueID uniqueId, bool enabled) |
| virtual DtUniqueID | addLightning (osg::Vec3d &position, const osg::Matrixd &rotation, const DtVector &bounds, const float cornerRadius, const float intensity) |
| virtual void | removeLightning (DtUniqueID uniqueId) |
| virtual void | setWeatherLightningBounds (DtUniqueID uniqueId, const DtVector &bounds, const float cornerRadius) |
| virtual void | setWeatherLightningTransform (DtUniqueID uniqueId, const osg::Vec3d &position, const osg::Matrixd &rotation) |
| virtual void | setWeatherLightningIntensity (DtUniqueID uniqueId, const float intensity) |
| virtual void | setWeatherLightningEnabled (DtUniqueID uniqueId, bool enabled) |
| virtual void | setCloudLayerDensity (DtCloudLayerId layerId, float density) |
| virtual void | setHeightFogDensity (DtUniqueID uniqueId, float density) |
| virtual void | setCloudLayerEnabled (DtCloudLayerId layerId, bool enabled) |
| virtual void | setHeightFogEnabled (DtUniqueID uniqueId, bool enabled) |
| virtual void | setCloudLayerPositionAndOrientation (DtCloudLayerId layerId, const DtVector &position, float orientation) |
| virtual void | setHeightFogPositionAndOrientation (DtUniqueID uniqueId, const DtVector &position, float orientation, bool relative) |
| virtual void | setCloudLayerBaseColor (DtCloudLayerId layerId, float red, float green, float blue) |
| virtual void | setHeightFogBaseColor (DtUniqueID uniqueId, float red, float green, float blue) |
| virtual void | setHeightFogBounds (DtUniqueID uniqueId, const DtVector &bounds, const float cornerRadius) |
| virtual void | setCloudLayerParticleSizeVariation (DtCloudLayerId layerId, float variation) |
| virtual void | setCloudLayerPatternedLook (DtCloudLayerId layerId, bool patternedEnable) |
| virtual void | setCloudLayerWind (DtCloudLayerId layerId, float windDirectionRad, float windSpeedMps) |
| virtual void | setGlobalWind (float windDirectionRad, float windSpeedMps) |
| virtual void | drawObjects (osg::RenderInfo &renderInfo, const DtWeatherAreaDrawable &drawable) |
| virtual void | gatherWeatherAreas (const osg::Vec3d &position, std::vector< DtWeatherArea * > &areas) |
| virtual bool | computeLocalPrecipitation (const DtVector &location, int &precipType, float &intensity) |
| virtual bool | computeLocalGroundRainAccumulation (const DtVector &location, float &depth, float &blend) |
| virtual bool | shouldActivateRaindrops () const |
| virtual bool | bindFogFroxelTexture (const int unit, const unsigned int renderContextId) |
| virtual float | fogFroxelMaxDistance () const |
Protected Types | |
| typedef std::map< DtUniqueID, HeightFogItem > | DtHeightFogMap |
| typedef std::map < DtCloudLayerId, DtUniqueID > | DtCloudLayerIdToUniqueIdMap |
Private Types | |
| typedef std::map < DtCloudLayerId, DtGroundFogPatchArea * > | DtGroundFogPatchAreaMap |
| typedef std::map < DtCloudLayerId, DtWeatherArea * > | DtWeatherAreaMap |
| typedef std::map< DtUniqueID, DtWeatherArea * > | DtWeatherAreaObjectMap |
| typedef std::map< DtUniqueID, DtWeatherPrecipitationShaft * > | DtWeatherPrecipitationShaftMap |
| typedef std::map< DtUniqueID, DtWeatherLightning * > | DtWeatherLightningMap |
Private Member Functions | |
| osg::Node * | getChildNodeByName (osg::Group *parent, const char *name) |
|
protected |
|
protected |
|
private |
This is mutable because it's used as part of the const drawImplementation.
|
private |
This is mutable because it's used as part of the const drawImplementation.
|
private |
This is mutable because it's used as part of the const drawImplementation.
|
private |
This is mutable because it's used as part of the const drawImplementation.
|
private |
This is mutable because it's used as part of the const drawImplementation.
| makVrv::DtWeatherAreaGroup::DtWeatherAreaGroup | ( | DtDe & | de | ) |
CTOR.
| makVrv::DtWeatherAreaGroup::DtWeatherAreaGroup | ( | const DtWeatherAreaGroup & | orig, |
| const osg::CopyOp & | opr | ||
| ) |
Copy constructor needed because it is derived from osg::Group.
|
virtual |
DTOR.
|
delete |
Default Constructor not implemented.
|
delete |
Copy Constructor not implemented - Copy not allowed.
|
delete |
Assignment Operator not implemented - Assignment not allowed.
|
virtual |
Called from the creator to initialize the object.
|
overridevirtual |
release gl for fog patch and fog effect
|
inlinevirtual |
required functions for derriving from osg::Group
|
inlinevirtual |
|
virtual |
Tell the group to delete its specific children.
|
virtual |
|
virtual |
Remove a cloud layer.
|
virtual |
Remove a height fog object. Returns true if the object was found and removed.
|
virtual |
Remove all the cloud decks.
|
virtual |
Adds a ground fog layer.
|
virtual |
Adds a height fog object. Returns a unique id for the added object.
|
virtual |
Adds a patchy ground fog area.
|
virtual |
Adds a sandstorm layer.
|
virtual |
Adds a blowing dust area.
|
virtual |
Adds a blowing sand area.
|
virtual |
Adds a blowing snow area.
|
virtual |
Adds a precipitation shaft. Returns a unique id for the added object.
| position | The object transform position. |
| rotation | The object transform rotation. |
| bounds | The width, length, height of the bounds. |
| cornerRadius | The corner radius of the bounds: must be <= min(width, length) |
| intensity | The intensity (affects visibility). |
|
virtual |
Remove a precipitation shaft.
| uniqueId | The precipitation shaft object id. |
|
virtual |
Sets the bounds for a precipitation shaft object.
| uniqueId | The precipitation shaft object id. |
| bounds | The width, length, height of the bounds. |
| cornerRadius | The corner radius of the bounds: must be <= min(width, length) |
|
virtual |
Sets the position and rotation for a precipitation shaft object.
| uniqueId | The precipitation shaft object id. |
| position | The object transform position. |
| rotation | The object transform rotation. |
|
virtual |
brief Set the intensity for a precipitation shaft object.
| uniqueId | The unique id of the object. |
| intensity | The intensity (affects visibility). |
|
virtual |
brief Set the base color for a precipitation shaft object.
| uniqueId | The unique id of the object. |
| color | The rgb color to use (0.0 - 1.0 scale). |
|
virtual |
Sets the current wind for a precipitation shaft object.
| uniqueId | The unique id of the object. |
| windDirectionRad | The wind direction in radians. |
| windSpeedMps | The wind speed in meters per second. |
|
virtual |
Enables or disables a precipitation shaft object.
| uniqueId | The unique id of the object. |
| enabled | Set to true to enable the object. |
|
virtual |
Adds a lightning object. Returns a unique id for the added object.
| position | The object transform position. |
| rotation | The object transform rotation. |
| bounds | The width, length, height of the bounds. |
| cornerRadius | The corner radius of the bounds: must be <= min(width, length) |
| intensity | The intensity (affects lightning strikes). |
|
virtual |
Remove a lightning object.
| uniqueId | The lightning object id. |
|
virtual |
Sets the bounds for a lightning object.
| uniqueId | The lightning object id. |
| bounds | The width, length, height of the bounds. |
| cornerRadius | The corner radius of the bounds: must be <= min(width, length) |
|
virtual |
Sets the position and rotation for a lightning object.
| uniqueId | Thelightning object id. |
| position | The object transform position. |
| rotation | The object transform rotation. |
|
virtual |
brief Set the intensity for a lightning object.
| uniqueId | The unique id of the object. |
| intensity | The intensity (affects lightning strikes). |
|
virtual |
Enables or disables a lightning object.
| uniqueId | The unique id of the object. |
| enabled | Set to true to enable the object. |
|
virtual |
brief Set the fog density for a layer.
| layerId | The layer to act upon. |
| density | This fog density exp() control. |
|
virtual |
brief Set the density for a height fog object.
| uniqueId | The unique id of the object. |
| density | This fog density exp() control. |
|
virtual |
Enables or disables a layer.
| layerId | The layer to act upon. |
| enabled | Set to true to enable the layer. |
|
virtual |
Enables or disables a height fog object.
| uniqueId | The unique id of the object. |
| enabled | Set to true to enable the object. |
|
virtual |
Sets the transform for the given layer.
|
virtual |
Sets the position and orientation for a height fog object.
|
virtual |
Sets the base material color for a cloud layer.
| layerId | The layer to act upon. |
| red | The red component color to set in the range of (0.0 - 1.0). |
| green | The green component color to set in the range of (0.0 - 1.0). |
| blue | The blue component color to set in the range of (0.0 - 1.0). |
|
virtual |
Sets the base material color for a height fog object.
| uniqueId | The height fog object id. |
| red | The red component color to set in the range of (0.0 - 1.0). |
| green | The green component color to set in the range of (0.0 - 1.0). |
| blue | The blue component color to set in the range of (0.0 - 1.0). |
|
virtual |
Sets the bounds for a height fog object.
| uniqueId | The height fog object id. |
| bounds | The width, length, height if the bounds. |
| cornerRadius | The corner radius of the bounds: must be <= min(width, length) |
|
virtual |
Sets a size variation for particles used to fill voxel space.
| layerId | The layer to act upon. |
| variation | The random variation (typically 0.0 to 0.5). |
|
virtual |
Enables or disables a patterned look (typically true for sandstorms).
| layerId | The layer to act upon. |
| patternedEnable | If true, enables a patterned look. |
|
virtual |
Sets the local wind for a cloud layer.
| layerId | The layer to act upon. |
| windDirectionRad | The wind direction in radians. |
| windSpeedMps | The wind speed in meters per second. |
|
virtual |
Sets the current global wind to use for fog and weather areas.
| windDirectionRad | The wind direction in radians. |
| windSpeedMps | The wind speed in meters per second. |
|
virtual |
Draw all objects.
|
virtual |
Gets a list of active weather areas that intersect the given position.
| position | The position to check. |
| areas | The list to fill in. |
|
virtual |
Computes the precipitation at the given location. Returns true if location is in an active area, otherwise false.
| location | The location to compute the precipitation at. |
| precipType | The computed precipitation type (DtSkyObject::PrecipitationType). |
| intensity | The computed precipitation intensity. |
|
virtual |
Computes the ground rain accumulation at the given location. Returns true if location is in an active area, otherwise false.
| location | The location to compute the ground rain accumulation at. |
| depth | The computed ground rain accumulation depth. |
| blend | (0.0 to 1.0) blend value based on local area perimeter. |
|
virtual |
Check for local precipitation active to see whether to draw the rain post effect.
|
virtual |
Binds the fog froxel texture object to the given texture unit for the given render context. Returns true if the froxel texture is enabled.
| unit | The texture unit to bind to. |
| renderContextId | The current render context used for drawing. |
|
virtual |
Returns the maximum distance used for fog froxel calulations.
|
protectedvirtual |
Initializes the draw state for ground fog patch objects.
|
protectedvirtual |
Initializes the draw state for sandstorm objects.
|
protectedvirtual |
Initializes the draw state for ground fog effect objects.
|
protectedvirtual |
Initializes the draw state for precipitation shaft objects.
|
protectedvirtual |
Initializes the draw state for lightning objects.
|
protectedvirtual |
Loads all shaders used to draw objects.
|
protectedvirtual |
Loads shaders used to draw ground fog objects.
|
protectedvirtual |
Loads shaders used to sandstorm objects.
|
protectedvirtual |
Loads shaders used to draw ground fog effects objects.
|
protectedvirtual |
Loads shaders used to draw precipitation shaft objects.
|
protectedvirtual |
Loads shaders used to draw lightning objects.
|
protectedvirtual |
Clear all draw bins.
|
protected |
Draws all items in the given draw bin.
|
protectedvirtual |
Draw a ground fog patch area (or a sandstorm area).
|
protectedvirtual |
Draw ground fog effects in a ground fog patch area.
|
protectedvirtual |
Draw a precipitation shaft.
|
protectedvirtual |
Draw lightning.
|
protectedvirtual |
Called to apply the ground fog patch (or sandstorm) state for drawing.
| drawData | The data used to draw a ground fog patch. |
| mutableState | The state based on the material (ground fog or sandstorm). |
|
protectedvirtual |
Called to apply the ground fog effect state for drawing.
|
protectedvirtual |
Called to apply the precipitation shaft state for drawing.
|
protectedvirtual |
Called to apply the lightning state for drawing.
|
protectedvirtual |
Initializes the uniforms associated with depth soften.
|
protectedvirtual |
Setup softness parameters used when drawing.
| camera | The current camera being drawn. |
| softnessUniforms | The uniforms associated with softness to be set. |
|
protected |
Connects all the signals, Non-virtural, called in the ctor.
|
protectedvirtual |
Signal handler to reload the shaders.
|
protectedvirtual |
Signal handler to run a simulation update.
|
protectedvirtual |
Slot to handle signal for when a weather area is added.
|
protectedvirtual |
Slot to handle signal for when a weather area is about to be removed.
|
protectedvirtual |
Slot to handle signal for when a weather area transform changes.
|
protectedvirtual |
Slot to handle signal for when a weather area bounds changes.
|
protectedvirtual |
Slot to handle signal for when a weather area precipitation intensity changes.
|
protectedvirtual |
Slot to handle signal for when a weather area precipitation type changes.
|
protectedvirtual |
Slot to handle signal for when a weather area ground rain accumulation changes.
|
protectedvirtual |
Slot to handle signal for when a weather area fog color changes.
|
protectedvirtual |
Slot to handle signal for when a weather area visibility distance changes.
|
protectedvirtual |
Slot to handle signal for when a weather area overcast changes.
|
protectedvirtual |
Slot to handle signal for when a weather area lightning enable changes.
|
protectedvirtual |
Slot to handle signal for when a weather area wind changes.
|
protectedvirtual |
Slot to handle signal for when a weather area adds a cloud layer.
|
protectedvirtual |
Slot to handle signal for when a weather area removes a cloud layer.
|
protectedvirtual |
Traverse.
|
protectedvirtual |
Disables height fog shader calculations.
|
protectedvirtual |
Update draw objects for current camera.
| cam | The current camera. |
|
protectedvirtual |
Updates the height layers for current camera.
| cam | The current camera. |
|
protectedvirtual |
Computes a basis rotation matrix for the given geocentric position.
| inGeocentricPos | The geocentric reference position. |
| rotOut | The computed basis rotation transform. |
|
protectedvirtual |
Release all gl objects used by groundfog patch (and sandstorm) objects.
|
protectedvirtual |
Release all gl objects used by groundfog effect objects.
|
protectedvirtual |
Release all gl objects used by weather precipitation shaft objects.
|
protectedvirtual |
Release all gl objects used by weather lightning objects.
|
private |
This is private and non-virtual because it's used in the constructor. This method returns the first child node that matches the given name.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |