34 #include <matrix/vlVector.h>
42 class DtWeatherFogFroxelGrid;
82 SensorMaterialTypeNone = 0,
88 SensorMaterialTypeCount
125 virtual void releaseGLObjects(osg::State* state = 0)
const override;
132 virtual void deleteGeode();
136 virtual osg::Node* getOrCreateSensorNode(SensorMaterialType matType);
143 virtual bool removeHeightFog(
DtUniqueID uniqueId);
146 virtual void removeCloudLayers();
149 virtual void addGroundFog(
DtCloudLayerId layerId,
const DtVector& position,
150 float orientation,
float cornerRadius,
const DtVector& bounds,
151 double density,
bool infinite,
bool relative,
bool altitudeIsHAT);
155 virtual DtUniqueID addHeightFog(
const DtVector& position,
float orientation,
156 float cornerRadius,
const DtVector& bounds,
double density,
bool relative);
160 const DtVector& position,
float orientation,
float cornerRadius,
161 const DtVector& bounds,
double density,
bool relative);
164 virtual void addSandstorm(
DtCloudLayerId layerId,
const DtVector& position,
165 float orientation,
float cornerRadius,
const DtVector& bounds,
166 double density,
bool infinite,
bool relative,
bool altitudeIsHAT);
170 const DtVector& position,
float orientation,
float cornerRadius,
171 const DtVector& bounds,
bool relative);
175 const DtVector& position,
float orientation,
float cornerRadius,
176 const DtVector& bounds,
bool relative);
180 const DtVector& position,
float orientation,
float cornerRadius,
181 const DtVector& bounds,
bool relative);
190 virtual DtUniqueID addPrecipitationShaft(osg::Vec3d& position,
191 const osg::Matrixd& rotation,
const DtVector& bounds,
192 const float cornerRadius,
const float intensity);
196 virtual void removePrecipitationShaft(
DtUniqueID uniqueId);
202 virtual void setWeatherPrecipitationShaftBounds(
DtUniqueID uniqueId,
203 const DtVector& bounds,
const float cornerRadius);
209 virtual void setWeatherPrecipitationShaftTransform(
DtUniqueID uniqueId,
210 const osg::Vec3d& position,
const osg::Matrixd& rotation);
215 virtual void setWeatherPrecipitationShaftIntensity(
DtUniqueID uniqueId,
216 const float intensity);
221 virtual void setWeatherPrecipitationShaftBaseColor(
DtUniqueID uniqueId,
222 const DtVector& color);
228 virtual void setWeatherPrecipitationShaftWind(
DtUniqueID uniqueId,
229 const float windDirectionRad,
const float windSpeedMps);
234 virtual void setWeatherPrecipitationShaftEnabled(
DtUniqueID uniqueId,
bool enabled);
243 virtual DtUniqueID addLightning(osg::Vec3d& position,
244 const osg::Matrixd& rotation,
const DtVector& bounds,
245 const float cornerRadius,
const float intensity);
249 virtual void removeLightning(
DtUniqueID uniqueId);
255 virtual void setWeatherLightningBounds(
DtUniqueID uniqueId,
256 const DtVector& bounds,
const float cornerRadius);
262 virtual void setWeatherLightningTransform(
DtUniqueID uniqueId,
263 const osg::Vec3d& position,
const osg::Matrixd& rotation);
268 virtual void setWeatherLightningIntensity(
DtUniqueID uniqueId,
269 const float intensity);
274 virtual void setWeatherLightningEnabled(
DtUniqueID uniqueId,
bool enabled);
279 virtual void setCloudLayerDensity(
DtCloudLayerId layerId,
float density);
284 virtual void setHeightFogDensity(
DtUniqueID uniqueId,
float density);
289 virtual void setCloudLayerEnabled(
DtCloudLayerId layerId,
bool enabled);
294 virtual void setHeightFogEnabled(
DtUniqueID uniqueId,
bool enabled);
297 virtual void setCloudLayerPositionAndOrientation(
DtCloudLayerId layerId,
298 const DtVector& position,
float orientation);
301 virtual void setHeightFogPositionAndOrientation(
DtUniqueID uniqueId,
302 const DtVector& position,
float orientation,
bool relative);
310 float red,
float green,
float blue);
317 virtual void setHeightFogBaseColor(
DtUniqueID uniqueId,
318 float red,
float green,
float blue);
324 virtual void setHeightFogBounds(
DtUniqueID uniqueId,
325 const DtVector& bounds,
const float cornerRadius);
330 virtual void setCloudLayerParticleSizeVariation(
DtCloudLayerId layerId,
337 bool patternedEnable);
344 float windDirectionRad,
float windSpeedMps);
349 virtual void setGlobalWind(
float windDirectionRad,
float windSpeedMps);
352 virtual void drawObjects(osg::RenderInfo& renderInfo,
358 virtual void gatherWeatherAreas(
const osg::Vec3d& position,
359 std::vector<DtWeatherArea*>& areas);
366 virtual bool computeLocalPrecipitation(
const DtVector& location,
367 int& precipType,
float& intensity);
374 virtual bool computeLocalGroundRainAccumulation(
const DtVector& location,
375 float& depth,
float& blend);
378 virtual bool shouldActivateRaindrops()
const;
385 virtual bool bindFogFroxelTexture(
const int unit,
const unsigned int renderContextId);
388 virtual float fogFroxelMaxDistance()
const;
399 , myItemType(DrawItemTypeNone)
426 , myCameraBasisDirty(false)
500 virtual void initGroundFogPatchState();
503 virtual void initSandstormState();
506 virtual void initGroundFogEffectState();
509 virtual void initPrecipitationShaftState();
512 virtual void initLightningState();
515 virtual void loadShaders();
518 virtual void loadGroundFogPatchShaders();
521 virtual void loadSandstormShaders();
524 virtual void loadGroundFogEffectShaders();
527 virtual void loadPrecipitationShaftShaders();
530 virtual void loadLightningShaders();
533 virtual void clearDrawBins();
536 virtual void updateImGui();
539 virtual void debugAreaBounds();
542 void flushDrawBin(osg::RenderInfo& renderInfo,
554 virtual void drawPrecipitationShaft(
578 virtual void initSoftnessUniforms(osg::StateSet& ss,
584 virtual void setupSoftness(osg::Camera* camera,
588 void connectSignals();
591 virtual void slot_reloadShaders();
594 virtual void slot_simulationUpdate();
603 virtual void slot_weatherAreaObjectTransformChanged(
DtUniqueID id,
604 const DtVector& position,
const float orientation);
607 virtual void slot_weatherAreaObjectBoundsChanged(
DtUniqueID id,
608 const DtVector& bounds,
const float cornerRadius);
611 virtual void slot_weatherAreaObjectPrecipitationIntensityChanged(
615 virtual void slot_weatherAreaObjectPrecipitationTypeChanged(
619 virtual void slot_weatherAreaObjectGroundRainAccumulationChanged(
623 virtual void slot_weatherAreaObjectFogColorChanged(
DtUniqueID id,
624 const DtVector& color);
627 virtual void slot_weatherAreaObjectVisibilityDistanceChanged(
631 virtual void slot_weatherAreaObjectOvercastChanged(
DtUniqueID id,
635 virtual void slot_weatherAreaObjectLightningEnabledChanged(
639 virtual void slot_weatherAreaObjectWindChanged(
640 DtUniqueID id,
const float direction,
const float speed);
643 virtual void slot_weatherAreaObjectCloudLayerAdded(
647 virtual void slot_weatherAreaObjectCloudLayerRemoved(
651 virtual void traverse(osg::NodeVisitor& nv);
654 virtual void disableHeightFog();
658 virtual void cullUpdate(osg::Camera* cam);
662 virtual void cullUpdateHeightFog(osg::Camera* cam);
667 virtual void computeBasis(
const osg::Vec3d& inGeocentricPos, osg::Matrixd& rotOut);
670 virtual void releaseGroundFogPatchGLObjects(osg::State* state)
const;
673 virtual void releaseGroundFogEffectGLObjects(osg::State* state)
const;
676 virtual void releaseWeatherPrecipitationShaftGLObjects(osg::State* state)
const;
679 virtual void releaseWeatherLightningGLObjects(osg::State* state)
const;
743 osg::Node* getChildNodeByName(osg::Group* parent,
const char* name);
765 bool myHeightFogDisabled =
false;
std::vector< DrawItem > myPreSortBin
Definition: DtWeatherAreaGroup.h:708
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
DtUniqueID myUniqueId
Definition: DtWeatherAreaGroup.h:439
osg::ref_ptr< makVrv::DtWeatherAreaDrawable > mySortTransparentDrawable
Definition: DtWeatherAreaGroup.h:700
DtDe & myDe
Definition: DtWeatherAreaGroup.h:683
Vector3_32 myBaseColor
Definition: DtWeatherAreaGroup.h:451
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:723
Definition: DtWeatherAreaGroup.h:87
A structure used to hold data for drawing.
Definition: DtGroundFogEffect.h:53
HeightFogItem()
Definition: DtWeatherAreaGroup.h:422
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:754
Definition: DtWeatherAreaGroup.h:97
osg::ref_ptr< osg::Uniform > myViewMatrixInvUniform
Definition: DtWeatherAreaGroup.h:490
osg::Vec3d myPosition
Definition: DtWeatherAreaGroup.h:441
DtSignalConnectionManager myConnections
Definition: DtWeatherAreaGroup.h:733
Definition: DtWeatherAreaGroup.h:85
DtHeightFogMap myHeightFogMap
Definition: DtWeatherAreaGroup.h:721
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
osg::ref_ptr< osg::Group > mySortPreCloudsGroupNode
Definition: DtWeatherAreaGroup.h:690
double myLastTime
Definition: DtWeatherAreaGroup.h:728
DtWeatherPrecipitationShaftMap myMutableWeatherPrecipitationShaftMap
Definition: DtWeatherAreaGroup.h:759
osg::Vec3d myBasisPos
Definition: DtWeatherAreaGroup.h:442
Creator that is used to create the weather area group.
Definition: DtWeatherAreaGroup.h:771
float myAltitudeBlend
Definition: DtWeatherAreaGroup.h:447
GroundFogPatchState myMutableGroundFogPatchState
Definition: DtWeatherAreaGroup.h:714
osg::ref_ptr< osg::Group > myGroundFogPatchSensorGroup
Definition: DtWeatherAreaGroup.h:702
bool myCameraBasisDirty
Definition: DtWeatherAreaGroup.h:444
A structure to hold draw state information for ground fog effect shaders.
Definition: DtWeatherAreaGroup.h:479
PrecipitationShaftState myMutablePrecipitationShaftState
Definition: DtWeatherAreaGroup.h:717
Contains makVrv::DtGroundFogPatchArea class.
Definition: DtWeatherAreaGroup.h:98
DtWeatherFogFroxelGrid * myWeatherFogFroxelGrid
Definition: DtWeatherAreaGroup.h:735
bool myEnabled
Definition: DtWeatherAreaGroup.h:440
float myWindSpeedMps
Definition: DtWeatherAreaGroup.h:685
osg::ref_ptr< osg::Group > mySortTransparentGroupNode
Definition: DtWeatherAreaGroup.h:698
A structure used to hold data for drawing.
Definition: DtWeatherLightning.h:70
DtCloudLayerIdToUniqueIdMap myCloudLayerIdToUniqueIdMap
Definition: DtWeatherAreaGroup.h:724
Definition: DtWeatherAreaGroup.h:84
this class is used to split work up between threads.
Definition: DtJobSplitter.h:64
DtGroundFogPatchAreaMap myMutableGroundFogPatchAreaMap
Definition: DtWeatherAreaGroup.h:747
A structure to hold data for a height fog object.
Definition: DtWeatherAreaGroup.h:420
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:75
DtJobSplitter * myJobSplitter
Definition: DtWeatherAreaGroup.h:731
virtual osg::Object * clone(const osg::CopyOp ©op) const
required functions for derriving from osg::Group
Definition: DtWeatherAreaGroup.h:128
osg::ref_ptr< makVrv::DtWeatherAreaDrawable > mySortPostCloudsDrawable
Definition: DtWeatherAreaGroup.h:696
GroundFogPatchState()
Definition: DtWeatherAreaGroup.h:468
osg::ref_ptr< osg::Uniform > myViewMatrixInvUniform
Definition: DtWeatherAreaGroup.h:482
DrawItem()
Definition: DtWeatherAreaGroup.h:396
SensorMaterialType
brief Sensor material type enumerations used for sensorfx.
Definition: DtWeatherAreaGroup.h:80
Camera forward declarations.
std::vector< DrawItem > mySortBinTransparent
Definition: DtWeatherAreaGroup.h:711
SoftnessUniforms mySoftnessUniforms
Definition: DtWeatherAreaGroup.h:489
bool myDebugAreaBoundsEnabled
Definition: DtWeatherAreaGroup.h:737
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:494
osg::ref_ptr< osg::Group > myWeatherPrecipitationShaftSensorGroup
Definition: DtWeatherAreaGroup.h:705
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:750
SoftnessUniforms mySoftnessUniforms
Definition: DtWeatherAreaGroup.h:496
float myAltitude
Definition: DtWeatherAreaGroup.h:445
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:706
DrawItemType
brief Draw item type enumerations used for sorting bins.
Definition: DtWeatherAreaGroup.h:92
SoftnessUniforms mySoftnessUniforms
Definition: DtWeatherAreaGroup.h:473
osg::ref_ptr< makVrv::DtWeatherAreaDrawable > mySortPreCloudsDrawable
Definition: DtWeatherAreaGroup.h:692
float myPatternTextureWidth
Definition: DtWeatherAreaGroup.h:475
float myDensity
Definition: DtWeatherAreaGroup.h:446
osg::ref_ptr< osg::Group > myGroundFogEffectSensorGroup
Definition: DtWeatherAreaGroup.h:704
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
osg::ref_ptr< osg::Group > mySortPostCloudsGroupNode
Definition: DtWeatherAreaGroup.h:694
std::vector< DrawItem > mySortBinPostClouds
Definition: DtWeatherAreaGroup.h:710
GroundFogPatchState myMutableSandstormState
Definition: DtWeatherAreaGroup.h:715
DtWeatherAreaObjectMap myMutableWeatherAreaObjectMap
Definition: DtWeatherAreaGroup.h:755
osg::ref_ptr< osg::Geode > mySortPreCloudsGeode
Definition: DtWeatherAreaGroup.h:691
int mySortDistance
Definition: DtWeatherAreaGroup.h:405
Contains vrvCore::DtCloudLayerRecord declaration.
float myTimeStep
Definition: DtWeatherAreaGroup.h:729
DtWeatherFogFroxelGrid uses a frustum voxel grid to compute density/translucency at voxel locations b...
Definition: DtWeatherFogFroxelGrid.h:56
Definition: DtWeatherAreaGroup.h:83
LightningState myMutableLightningState
Definition: DtWeatherAreaGroup.h:718
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:763
std::map< DtUniqueID, DtWeatherLightning * > DtWeatherLightningMap
This is mutable because it's used as part of the const drawImplementation.
Definition: DtWeatherAreaGroup.h:762
A structure to hold draw state information for precipitation shaft shaders.
Definition: DtWeatherAreaGroup.h:487
std::map< DtUniqueID, DtWeatherPrecipitationShaft * > DtWeatherPrecipitationShaftMap
This is mutable because it's used as part of the const drawImplementation.
Definition: DtWeatherAreaGroup.h:758
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:412
std::map< DtUniqueID, HeightFogItem > DtHeightFogMap
Definition: DtWeatherAreaGroup.h:720
Frustum_64 myFrustum
Definition: DtWeatherAreaGroup.h:726
float myDensityBlend
Definition: DtWeatherAreaGroup.h:448
Base class to provide boost signal/slot management.
void * myItem
Definition: DtWeatherAreaGroup.h:408
float myCornerRadius
Definition: DtWeatherAreaGroup.h:449
osg::Matrixd myBasisRot
Definition: DtWeatherAreaGroup.h:443
Contains makVrv::DtWeatherAreaDrawable class.
osg::ref_ptr< osg::Group > mySandstormSensorGroup
Definition: DtWeatherAreaGroup.h:703
Definition: DtWeatherAreaGroup.h:95
long long DtCloudLayerId
Definition: DtCloudLayer.h:26
Contains makVrv::DtGroundFogEffect class.
Definition: DtWeatherAreaGroup.h:96
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:746
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:709
GroundFogEffectState myMutableGroundFogEffectState
Definition: DtWeatherAreaGroup.h:716
osg::ref_ptr< osg::Uniform > myViewMatrixInvUniform
Definition: DtWeatherAreaGroup.h:474
Definition: DtWeatherAreaGroup.h:86
A structure to hold data for a draw item. A draw item is placed in a draw item sorting bin...
Definition: DtWeatherAreaGroup.h:394
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:466
DrawItemType myItemType
Definition: DtWeatherAreaGroup.h:407
osg::ref_ptr< osg::Geode > mySortPostCloudsGeode
Definition: DtWeatherAreaGroup.h:695
Contains makVrv::DtWeatherLightning class.
Contains makVrv::DtWeatherPrecipitationShaft class.
int mySortPriority
Definition: DtWeatherAreaGroup.h:406
osg::ref_ptr< osg::Geode > mySortTransparentGeode
Definition: DtWeatherAreaGroup.h:699
DtWeatherAreaMap myMutableWeatherAreaMap
Definition: DtWeatherAreaGroup.h:751
SoftnessUniforms mySoftnessUniforms
Definition: DtWeatherAreaGroup.h:481
float myWindDirectionRad
Definition: DtWeatherAreaGroup.h:686
virtual osg::Object * cloneType() const
Definition: DtWeatherAreaGroup.h:129
DtVector myBounds
Definition: DtWeatherAreaGroup.h:450