34 #include <matrix/vlVector.h>
41 class DtOsgFogComponent;
43 class DtWeatherFogFroxelGrid;
83 SensorMaterialTypeNone = 0,
89 SensorMaterialTypeCount
126 virtual void releaseGLObjects(osg::State* state = 0)
const override;
133 virtual void deleteGeode();
137 virtual osg::Node* getOrCreateSensorNode(SensorMaterialType matType);
144 virtual bool removeHeightFog(
DtUniqueID uniqueId);
147 virtual void removeCloudLayers();
150 virtual void addGroundFog(
DtCloudLayerId layerId,
const DtVector& position,
151 float orientation,
float cornerRadius,
const DtVector& bounds,
152 double density,
bool infinite,
bool relative,
bool altitudeIsHAT);
156 virtual DtUniqueID addHeightFog(
const DtVector& position,
float orientation,
157 float cornerRadius,
const DtVector& bounds,
double density,
bool relative);
161 const DtVector& position,
float orientation,
float cornerRadius,
162 const DtVector& bounds,
double density,
bool relative);
165 virtual void addSandstorm(
DtCloudLayerId layerId,
const DtVector& position,
166 float orientation,
float cornerRadius,
const DtVector& bounds,
167 double density,
bool infinite,
bool relative,
bool altitudeIsHAT);
171 const DtVector& position,
float orientation,
float cornerRadius,
172 const DtVector& bounds,
bool relative);
176 const DtVector& position,
float orientation,
float cornerRadius,
177 const DtVector& bounds,
bool relative);
181 const DtVector& position,
float orientation,
float cornerRadius,
182 const DtVector& bounds,
bool relative);
191 virtual DtUniqueID addPrecipitationShaft(osg::Vec3d& position,
192 const osg::Matrixd& rotation,
const DtVector& bounds,
193 const float cornerRadius,
const float intensity);
197 virtual void removePrecipitationShaft(
DtUniqueID uniqueId);
203 virtual void setWeatherPrecipitationShaftBounds(
DtUniqueID uniqueId,
204 const DtVector& bounds,
const float cornerRadius);
210 virtual void setWeatherPrecipitationShaftTransform(
DtUniqueID uniqueId,
211 const osg::Vec3d& position,
const osg::Matrixd& rotation);
216 virtual void setWeatherPrecipitationShaftIntensity(
DtUniqueID uniqueId,
217 const float intensity);
222 virtual void setWeatherPrecipitationShaftBaseColor(
DtUniqueID uniqueId,
223 const DtVector& color);
229 virtual void setWeatherPrecipitationShaftWind(
DtUniqueID uniqueId,
230 const float windDirectionRad,
const float windSpeedMps);
235 virtual void setWeatherPrecipitationShaftEnabled(
DtUniqueID uniqueId,
bool enabled);
244 virtual DtUniqueID addLightning(osg::Vec3d& position,
245 const osg::Matrixd& rotation,
const DtVector& bounds,
246 const float cornerRadius,
const float intensity);
250 virtual void removeLightning(
DtUniqueID uniqueId);
256 virtual void setWeatherLightningBounds(
DtUniqueID uniqueId,
257 const DtVector& bounds,
const float cornerRadius);
263 virtual void setWeatherLightningTransform(
DtUniqueID uniqueId,
264 const osg::Vec3d& position,
const osg::Matrixd& rotation);
269 virtual void setWeatherLightningIntensity(
DtUniqueID uniqueId,
270 const float intensity);
275 virtual void setWeatherLightningEnabled(
DtUniqueID uniqueId,
bool enabled);
280 virtual void setCloudLayerDensity(
DtCloudLayerId layerId,
float density);
285 virtual void setHeightFogDensity(
DtUniqueID uniqueId,
float density);
290 virtual void setCloudLayerEnabled(
DtCloudLayerId layerId,
bool enabled);
295 virtual void setHeightFogEnabled(
DtUniqueID uniqueId,
bool enabled);
298 virtual void setCloudLayerPositionAndOrientation(
DtCloudLayerId layerId,
299 const DtVector& position,
float orientation);
302 virtual void setHeightFogPositionAndOrientation(
DtUniqueID uniqueId,
303 const DtVector& position,
float orientation,
bool relative);
311 float red,
float green,
float blue);
318 virtual void setHeightFogBaseColor(
DtUniqueID uniqueId,
319 float red,
float green,
float blue);
325 virtual void setHeightFogBounds(
DtUniqueID uniqueId,
326 const DtVector& bounds,
const float cornerRadius);
331 virtual void setCloudLayerParticleSizeVariation(
DtCloudLayerId layerId,
338 bool patternedEnable);
345 float windDirectionRad,
float windSpeedMps);
350 virtual void setGlobalWind(
float windDirectionRad,
float windSpeedMps);
353 virtual void drawObjects(osg::RenderInfo& renderInfo,
359 virtual void gatherWeatherAreas(
const osg::Vec3d& position,
360 std::vector<DtWeatherArea*>& areas);
367 virtual bool computeLocalPrecipitation(
const DtVector& location,
368 int& precipType,
float& intensity);
375 virtual bool computeLocalGroundRainAccumulation(
const DtVector& location,
376 float& depth,
float& blend);
379 virtual bool shouldActivateRaindrops()
const;
387 virtual bool computeLocalWind(
const DtVector& location,
float& speedMps,
float& directionRad);
395 virtual bool computeLocalVisibility(
const DtVector& location,
396 float& visibilityMeters,
float& blend);
403 virtual bool bindFogFroxelTexture(
const int unit,
const unsigned int renderContextId);
406 virtual float fogFroxelMaxDistance()
const;
417 , myItemType(DrawItemTypeNone)
444 , myCameraBasisDirty(false)
518 virtual void initGroundFogPatchState();
521 virtual void initSandstormState();
524 virtual void initGroundFogEffectState();
527 virtual void initPrecipitationShaftState();
530 virtual void initLightningState();
533 virtual void loadShaders();
536 virtual void loadGroundFogPatchShaders();
539 virtual void loadSandstormShaders();
542 virtual void loadGroundFogEffectShaders();
545 virtual void loadPrecipitationShaftShaders();
548 virtual void loadLightningShaders();
551 virtual void clearDrawBins();
554 virtual void updateImGui();
557 virtual void debugAreaBounds();
560 void flushDrawBin(osg::RenderInfo& renderInfo,
572 virtual void drawPrecipitationShaft(
596 virtual void initSoftnessUniforms(osg::StateSet& ss,
602 virtual void setupSoftness(osg::Camera* camera,
606 void connectSignals();
609 virtual void slot_reloadShaders();
612 virtual void slot_simulationUpdate();
621 virtual void slot_weatherAreaObjectTransformChanged(
DtUniqueID id,
622 const DtVector& position,
const float orientation);
625 virtual void slot_weatherAreaObjectBoundsChanged(
DtUniqueID id,
626 const DtVector& bounds,
const float cornerRadius);
629 virtual void slot_weatherAreaObjectPrecipitationIntensityChanged(
633 virtual void slot_weatherAreaObjectPrecipitationTypeChanged(
637 virtual void slot_weatherAreaObjectGroundRainAccumulationChanged(
641 virtual void slot_weatherAreaObjectFogColorChanged(
DtUniqueID id,
642 const DtVector& color);
645 virtual void slot_weatherAreaObjectVisibilityDistanceChanged(
649 virtual void slot_weatherAreaObjectOvercastChanged(
DtUniqueID id,
653 virtual void slot_weatherAreaObjectLightningEnabledChanged(
657 virtual void slot_weatherAreaObjectWindChanged(
658 DtUniqueID id,
const float direction,
const float speed);
661 virtual void slot_weatherAreaObjectCloudLayerAdded(
665 virtual void slot_weatherAreaObjectCloudLayerRemoved(
669 virtual void traverse(osg::NodeVisitor& nv);
675 virtual void disableCameraHeightFog(osg::Camera* camera);
679 virtual void cullUpdate(osg::Camera* cam);
683 virtual void cullUpdateHeightFog(osg::Camera* cam);
686 virtual void updateHeightFogItemBasis(
HeightFogItem* pItem,
const osg::Vec3d& camPos);
694 virtual void computeHeightFogBlending(
HeightFogItem* pItem,
const osg::Vec3d& camPos,
695 float& totalAltitudeBlend,
float& totalDensityBlend)
const;
698 virtual void updateCameraHeightFog(osg::Camera* camera,
const Vector3_32& hfColor,
699 float hfAltitude,
float hfDensity,
float hfDistance,
bool heightFogEnabled);
702 virtual void releaseGroundFogPatchGLObjects(osg::State* state)
const;
705 virtual void releaseGroundFogEffectGLObjects(osg::State* state)
const;
708 virtual void releaseWeatherPrecipitationShaftGLObjects(osg::State* state)
const;
711 virtual void releaseWeatherLightningGLObjects(osg::State* state)
const;
775 osg::Node* getChildNodeByName(osg::Group* parent,
const char* name);
std::vector< DrawItem > myPreSortBin
Definition: DtWeatherAreaGroup.h:740
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
DtUniqueID myUniqueId
Definition: DtWeatherAreaGroup.h:457
osg::ref_ptr< makVrv::DtWeatherAreaDrawable > mySortTransparentDrawable
Definition: DtWeatherAreaGroup.h:732
DtDe & myDe
Definition: DtWeatherAreaGroup.h:715
Vector3_32 myBaseColor
Definition: DtWeatherAreaGroup.h:469
Contains DtWeatherAreaObjectManager class.
Contains makVrv::DtWeatherLayer class.
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
std::map< DtCloudLayerId, DtUniqueID > DtCloudLayerIdToUniqueIdMap
Definition: DtWeatherAreaGroup.h:755
Definition: DtWeatherAreaGroup.h:88
A structure used to hold data for drawing.
Definition: DtGroundFogEffect.h:53
HeightFogItem()
Definition: DtWeatherAreaGroup.h:440
The weather area object represents a set localized environmental conditions such as local rain and fo...
Definition: DtWeatherAreaObject.h:33
std::map< DtUniqueID, DtWeatherArea * > DtWeatherAreaObjectMap
This is mutable because it's used as part of the const drawImplementation.
Definition: DtWeatherAreaGroup.h:786
Definition: DtWeatherAreaGroup.h:98
osg::ref_ptr< osg::Uniform > myViewMatrixInvUniform
Definition: DtWeatherAreaGroup.h:508
osg::Vec3d myPosition
Definition: DtWeatherAreaGroup.h:459
DtSignalConnectionManager myConnections
Definition: DtWeatherAreaGroup.h:765
Definition: DtWeatherAreaGroup.h:86
DtHeightFogMap myHeightFogMap
Definition: DtWeatherAreaGroup.h:753
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
osg::ref_ptr< osg::Group > mySortPreCloudsGroupNode
Definition: DtWeatherAreaGroup.h:722
double myLastTime
Definition: DtWeatherAreaGroup.h:760
DtWeatherPrecipitationShaftMap myMutableWeatherPrecipitationShaftMap
Definition: DtWeatherAreaGroup.h:791
osg::Vec3d myBasisPos
Definition: DtWeatherAreaGroup.h:460
Creator that is used to create the weather area group.
Definition: DtWeatherAreaGroup.h:801
float myAltitudeBlend
Definition: DtWeatherAreaGroup.h:465
GroundFogPatchState myMutableGroundFogPatchState
Definition: DtWeatherAreaGroup.h:746
osg::ref_ptr< osg::Group > myGroundFogPatchSensorGroup
Definition: DtWeatherAreaGroup.h:734
bool myCameraBasisDirty
Definition: DtWeatherAreaGroup.h:462
A structure to hold draw state information for ground fog effect shaders.
Definition: DtWeatherAreaGroup.h:497
PrecipitationShaftState myMutablePrecipitationShaftState
Definition: DtWeatherAreaGroup.h:749
Contains makVrv::DtGroundFogPatchArea class.
Definition: DtWeatherAreaGroup.h:99
DtWeatherFogFroxelGrid * myWeatherFogFroxelGrid
Definition: DtWeatherAreaGroup.h:767
bool myEnabled
Definition: DtWeatherAreaGroup.h:458
float myWindSpeedMps
Definition: DtWeatherAreaGroup.h:717
osg::ref_ptr< osg::Group > mySortTransparentGroupNode
Definition: DtWeatherAreaGroup.h:730
A structure used to hold data for drawing.
Definition: DtWeatherLightning.h:70
DtCloudLayerIdToUniqueIdMap myCloudLayerIdToUniqueIdMap
Definition: DtWeatherAreaGroup.h:756
Definition: DtWeatherAreaGroup.h:85
this class is used to split work up between threads.
Definition: DtJobSplitter.h:64
DtGroundFogPatchAreaMap myMutableGroundFogPatchAreaMap
Definition: DtWeatherAreaGroup.h:779
A structure to hold data for a height fog object.
Definition: DtWeatherAreaGroup.h:438
This class simulates and renders a precipitation shaft area. The area volume is filled with a density...
Definition: DtWeatherPrecipitationShaft.h:63
A drawable used for drawing items related to weather areas. The class serves as a draw point entry an...
Definition: DtWeatherAreaDrawable.h:30
A group node which serves as a root for weather areas, patchy ground fog areas and effects...
Definition: DtWeatherAreaGroup.h:76
DtJobSplitter * myJobSplitter
Definition: DtWeatherAreaGroup.h:763
virtual osg::Object * clone(const osg::CopyOp ©op) const
required functions for derriving from osg::Group
Definition: DtWeatherAreaGroup.h:129
osg::ref_ptr< makVrv::DtWeatherAreaDrawable > mySortPostCloudsDrawable
Definition: DtWeatherAreaGroup.h:728
GroundFogPatchState()
Definition: DtWeatherAreaGroup.h:486
osg::ref_ptr< osg::Uniform > myViewMatrixInvUniform
Definition: DtWeatherAreaGroup.h:500
DrawItem()
Definition: DtWeatherAreaGroup.h:414
SensorMaterialType
brief Sensor material type enumerations used for sensorfx.
Definition: DtWeatherAreaGroup.h:81
Camera forward declarations.
std::vector< DrawItem > mySortBinTransparent
Definition: DtWeatherAreaGroup.h:743
SoftnessUniforms mySoftnessUniforms
Definition: DtWeatherAreaGroup.h:507
bool myDebugAreaBoundsEnabled
Definition: DtWeatherAreaGroup.h:769
This class simulates and renders a lightning area. The area will randomly create lightning within a s...
Definition: DtWeatherLightning.h:63
A structure to hold draw state information for lightning shaders.
Definition: DtWeatherAreaGroup.h:512
osg::ref_ptr< osg::Group > myWeatherPrecipitationShaftSensorGroup
Definition: DtWeatherAreaGroup.h:737
Contains makVrv::DtOsgCullVisitor class.
std::map< DtCloudLayerId, DtWeatherArea * > DtWeatherAreaMap
This is mutable because it's used as part of the const drawImplementation.
Definition: DtWeatherAreaGroup.h:782
SoftnessUniforms mySoftnessUniforms
Definition: DtWeatherAreaGroup.h:514
float myAltitude
Definition: DtWeatherAreaGroup.h:463
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
osg::ref_ptr< osg::Group > myWeatherLightningSensorGroup
Definition: DtWeatherAreaGroup.h:738
DrawItemType
brief Draw item type enumerations used for sorting bins.
Definition: DtWeatherAreaGroup.h:93
SoftnessUniforms mySoftnessUniforms
Definition: DtWeatherAreaGroup.h:491
osg::ref_ptr< makVrv::DtWeatherAreaDrawable > mySortPreCloudsDrawable
Definition: DtWeatherAreaGroup.h:724
float myPatternTextureWidth
Definition: DtWeatherAreaGroup.h:493
float myDensity
Definition: DtWeatherAreaGroup.h:464
osg::ref_ptr< osg::Group > myGroundFogEffectSensorGroup
Definition: DtWeatherAreaGroup.h:736
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
osg::ref_ptr< osg::Group > mySortPostCloudsGroupNode
Definition: DtWeatherAreaGroup.h:726
State component that injects Fog rendering capabilities into a state set.
Definition: DtOsgFogComponent.h:34
std::vector< DrawItem > mySortBinPostClouds
Definition: DtWeatherAreaGroup.h:742
GroundFogPatchState myMutableSandstormState
Definition: DtWeatherAreaGroup.h:747
DtWeatherAreaObjectMap myMutableWeatherAreaObjectMap
Definition: DtWeatherAreaGroup.h:787
osg::ref_ptr< osg::Geode > mySortPreCloudsGeode
Definition: DtWeatherAreaGroup.h:723
int mySortDistance
Definition: DtWeatherAreaGroup.h:423
Contains vrvCore::DtCloudLayerRecord declaration.
float myTimeStep
Definition: DtWeatherAreaGroup.h:761
DtWeatherFogFroxelGrid uses a frustum voxel grid to compute density/translucency at voxel locations b...
Definition: DtWeatherFogFroxelGrid.h:56
Definition: DtWeatherAreaGroup.h:84
LightningState myMutableLightningState
Definition: DtWeatherAreaGroup.h:750
A structure used to hold data for drawing.
Definition: DtWeatherPrecipitationShaft.h:70
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
DtWeatherLightningMap myMutableWeatherLightningMap
Definition: DtWeatherAreaGroup.h:795
std::map< DtUniqueID, DtWeatherLightning * > DtWeatherLightningMap
This is mutable because it's used as part of the const drawImplementation.
Definition: DtWeatherAreaGroup.h:794
A structure to hold draw state information for precipitation shaft shaders.
Definition: DtWeatherAreaGroup.h:505
std::map< DtUniqueID, DtWeatherPrecipitationShaft * > DtWeatherPrecipitationShaftMap
This is mutable because it's used as part of the const drawImplementation.
Definition: DtWeatherAreaGroup.h:790
An area of ground fog patch items and effects. One ground fog patch area is associated with a non-inf...
Definition: DtGroundFogPatchArea.h:71
Functor for comparing draw items by sorting distance.
Definition: DtWeatherAreaGroup.h:430
std::map< DtUniqueID, HeightFogItem > DtHeightFogMap
Definition: DtWeatherAreaGroup.h:752
Frustum_64 myFrustum
Definition: DtWeatherAreaGroup.h:758
float myDensityBlend
Definition: DtWeatherAreaGroup.h:466
Base class to provide boost signal/slot management.
void * myItem
Definition: DtWeatherAreaGroup.h:426
float myCornerRadius
Definition: DtWeatherAreaGroup.h:467
osg::Matrixd myBasisRot
Definition: DtWeatherAreaGroup.h:461
Contains makVrv::DtWeatherAreaDrawable class.
osg::ref_ptr< osg::Group > mySandstormSensorGroup
Definition: DtWeatherAreaGroup.h:735
Definition: DtWeatherAreaGroup.h:96
long long DtCloudLayerId
Definition: DtCloudLayer.h:26
Contains makVrv::DtGroundFogEffect class.
Definition: DtWeatherAreaGroup.h:97
Contains DLL export macros.
std::map< DtCloudLayerId, DtGroundFogPatchArea * > DtGroundFogPatchAreaMap
This is mutable because it's used as part of the const drawImplementation.
Definition: DtWeatherAreaGroup.h:778
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Contains the makVrv::DtOsgCullVisitorParameters class. Visual mode information is set into the camera...
std::vector< DrawItem > mySortBinPreClouds
Definition: DtWeatherAreaGroup.h:741
GroundFogEffectState myMutableGroundFogEffectState
Definition: DtWeatherAreaGroup.h:748
osg::ref_ptr< osg::Uniform > myViewMatrixInvUniform
Definition: DtWeatherAreaGroup.h:492
Definition: DtWeatherAreaGroup.h:87
A structure to hold data for a draw item. A draw item is placed in a draw item sorting bin...
Definition: DtWeatherAreaGroup.h:412
A structure used to hold data for drawing.
Definition: DtGroundFogPatchArea.h:84
A structure to hold draw state information for ground fog patch (and sandstorm) shaders.
Definition: DtWeatherAreaGroup.h:484
DrawItemType myItemType
Definition: DtWeatherAreaGroup.h:425
osg::ref_ptr< osg::Geode > mySortPostCloudsGeode
Definition: DtWeatherAreaGroup.h:727
Contains makVrv::DtWeatherLightning class.
Contains makVrv::DtWeatherPrecipitationShaft class.
int mySortPriority
Definition: DtWeatherAreaGroup.h:424
osg::ref_ptr< osg::Geode > mySortTransparentGeode
Definition: DtWeatherAreaGroup.h:731
DtWeatherAreaMap myMutableWeatherAreaMap
Definition: DtWeatherAreaGroup.h:783
SoftnessUniforms mySoftnessUniforms
Definition: DtWeatherAreaGroup.h:499
float myWindDirectionRad
Definition: DtWeatherAreaGroup.h:718
virtual osg::Object * cloneType() const
Definition: DtWeatherAreaGroup.h:130
DtVector myBounds
Definition: DtWeatherAreaGroup.h:468