31 #include <matrix/vlVector.h>
39 class DtWeatherFogFroxelGrid;
79 SensorMaterialTypeNone = 0,
85 SensorMaterialTypeCount
122 virtual void releaseGLObjects(osg::State* state = 0)
const override;
129 virtual void deleteGeode();
133 virtual osg::Node* getOrCreateSensorNode(SensorMaterialType matType);
144 virtual bool removeHeightFog(
DtUniqueID uniqueId);
147 virtual void removeCloudLayers();
151 float orientation,
float cornerRadius,
const DtVector& bounds,
152 double density,
bool infinite,
bool relative,
bool altitudeIsHAT);
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);
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 addRainShaft(osg::Vec3d& position,
const osg::Matrixd& rotation,
192 const DtVector& bounds,
const float cornerRadius,
const float intensity);
196 virtual void removeRainShaft(
DtUniqueID uniqueId);
202 virtual void setWeatherRainShaftBounds(
DtUniqueID uniqueId,
203 const DtVector& bounds,
const float cornerRadius);
209 virtual void setWeatherRainShaftTransform(
DtUniqueID uniqueId,
210 const osg::Vec3d& position,
const osg::Matrixd& rotation);
215 virtual void setWeatherRainShaftIntensity(
DtUniqueID uniqueId,
216 const float intensity);
221 virtual void setWeatherRainShaftBaseColor(
DtUniqueID uniqueId,
228 virtual void setWeatherRainShaftWind(
DtUniqueID uniqueId,
229 const float windDirectionRad,
const float windSpeedMps);
234 virtual void setWeatherRainShaftEnabled(
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);
342 virtual void setWind(
float windDirectionRad,
float windSpeedMps);
345 virtual void drawObjects(osg::RenderInfo& renderInfo,
351 virtual void gatherWeatherAreas(
const osg::Vec3d& position,
352 std::vector<DtWeatherArea*>& areas);
359 virtual bool computeLocalPrecipitation(
const DtVector& location,
360 int& precipType,
float& intensity);
367 virtual bool computeLocalGroundRainAccumulation(
const DtVector& location,
368 float& depth,
float& blend);
371 virtual bool shouldActivateRaindrops()
const;
378 virtual bool bindFogFroxelTexture(
const int unit,
const unsigned int renderContextId);
381 virtual float fogFroxelMaxDistance()
const;
392 , myItemType(DrawItemTypeNone)
419 , myCameraBasisDirty(false)
492 virtual void initGroundFogPatchState();
495 virtual void initSandstormState();
498 virtual void initGroundFogEffectState();
501 virtual void initRainShaftState();
504 virtual void initLightningState();
507 virtual void loadShaders();
510 virtual void loadGroundFogPatchShaders();
513 virtual void loadSandstormShaders();
516 virtual void loadGroundFogEffectShaders();
519 virtual void loadRainShaftShaders();
522 virtual void loadLightningShaders();
525 virtual void clearDrawBins();
528 void flushDrawBin(osg::RenderInfo& renderInfo,
563 virtual void initSoftnessUniforms(osg::StateSet& ss,
569 virtual void setupSoftness(osg::Camera* camera,
573 void connectSignals();
576 virtual void slot_reloadShaders();
579 virtual void slot_simulationUpdate();
588 virtual void slot_weatherAreaObjectTransformChanged(
DtUniqueID id,
589 const DtVector& position,
const float orientation);
592 virtual void slot_weatherAreaObjectBoundsChanged(
DtUniqueID id,
593 const DtVector& bounds,
const float cornerRadius);
596 virtual void slot_weatherAreaObjectPrecipitationIntensityChanged(
600 virtual void slot_weatherAreaObjectPrecipitationTypeChanged(
604 virtual void slot_weatherAreaObjectGroundRainAccumulationChanged(
608 virtual void slot_weatherAreaObjectFogColorChanged(
DtUniqueID id,
612 virtual void slot_weatherAreaObjectVisibilityDistanceChanged(
616 virtual void slot_weatherAreaObjectOvercastChanged(
DtUniqueID id,
620 virtual void slot_weatherAreaObjectLightningEnabledChanged(
624 virtual void traverse(osg::NodeVisitor& nv);
627 virtual void disableHeightFog();
631 virtual void cullUpdate(osg::Camera* cam);
635 virtual void cullUpdateHeightFog(osg::Camera* cam);
640 virtual void computeBasis(
const osg::Vec3d& inGeocentricPos, osg::Matrixd& rotOut);
643 virtual void releaseGroundFogPatchGLObjects(osg::State* state)
const;
646 virtual void releaseGroundFogEffectGLObjects(osg::State* state)
const;
649 virtual void releaseWeatherRainShaftGLObjects(osg::State* state)
const;
652 virtual void releaseWeatherLightningGLObjects(osg::State* state)
const;
714 osg::Node* getChildNodeByName(osg::Group* parent,
const char* name);
osg::Vec3 myBaseColor
Definition: DtWeatherAreaGroup.h:444
std::vector< DrawItem > myPreSortBin
Definition: DtWeatherAreaGroup.h:681
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
This class simulates and renders a rain shaft area.
Definition: DtWeatherRainShaft.h:39
DtUniqueID myUniqueId
Definition: DtWeatherAreaGroup.h:432
osg::ref_ptr< makVrv::DtWeatherAreaDrawable > mySortTransparentDrawable
Definition: DtWeatherAreaGroup.h:673
osg::ref_ptr< osg::Uniform > myViewMatrixInvUniform
Definition: DtWeatherAreaGroup.h:482
DtDe & myDe
Definition: DtWeatherAreaGroup.h:656
Contains DtWeatherAreaObjectManager class.
Contains makVrv::DtWeatherLayer class.
Virtual base class.
Definition: DtVirtualBaseClass.h:19
std::map< DtCloudLayerId, DtUniqueID > DtCloudLayerIdToUniqueIdMap
Definition: DtWeatherAreaGroup.h:696
Definition: DtWeatherAreaGroup.h:84
A structure used to hold data for drawing.
Definition: DtGroundFogEffect.h:41
HeightFogItem()
Definition: DtWeatherAreaGroup.h:415
The weather area object represents a set localized environmental conditions such as local rain and fo...
Definition: DtWeatherAreaObject.h:32
std::map< DtUniqueID, DtWeatherArea * > DtWeatherAreaObjectMap
This is mutable because it's used as part of the const drawImplementation.
Definition: DtWeatherAreaGroup.h:725
osg::Vec3d myPosition
Definition: DtWeatherAreaGroup.h:434
DtSignalConnectionManager myConnections
Definition: DtWeatherAreaGroup.h:706
A structure to hold draw state information for rainshaft shaders.
Definition: DtWeatherAreaGroup.h:479
Definition: DtWeatherAreaGroup.h:82
DtHeightFogMap myHeightFogMap
Definition: DtWeatherAreaGroup.h:694
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
osg::ref_ptr< osg::Group > mySortPreCloudsGroupNode
Definition: DtWeatherAreaGroup.h:663
double myLastTime
Definition: DtWeatherAreaGroup.h:701
osg::Vec3d myBasisPos
Definition: DtWeatherAreaGroup.h:435
Creator that is used to create the weather area group.
Definition: DtWeatherAreaGroup.h:740
float myAltitudeBlend
Definition: DtWeatherAreaGroup.h:440
GroundFogPatchState myMutableGroundFogPatchState
Definition: DtWeatherAreaGroup.h:687
osg::ref_ptr< osg::Group > myGroundFogPatchSensorGroup
Definition: DtWeatherAreaGroup.h:675
bool myCameraBasisDirty
Definition: DtWeatherAreaGroup.h:437
A structure to hold draw state information for ground fog effect shaders.
Definition: DtWeatherAreaGroup.h:472
Contains makVrv::DtGroundFogPatchArea class.
Definition: DtWeatherAreaGroup.h:95
DtWeatherFogFroxelGrid * myWeatherFogFroxelGrid
Definition: DtWeatherAreaGroup.h:708
bool myEnabled
Definition: DtWeatherAreaGroup.h:433
float myWindSpeedMps
Definition: DtWeatherAreaGroup.h:658
osg::ref_ptr< osg::Group > mySortTransparentGroupNode
Definition: DtWeatherAreaGroup.h:671
A structure used to hold data for drawing.
Definition: DtWeatherLightning.h:46
DtCloudLayerIdToUniqueIdMap myCloudLayerIdToUniqueIdMap
Definition: DtWeatherAreaGroup.h:697
Definition: DtWeatherAreaGroup.h:81
this class is used to split work up between threads.
Definition: DtJobSplitter.h:64
DtGroundFogPatchAreaMap myMutableGroundFogPatchAreaMap
Definition: DtWeatherAreaGroup.h:718
A structure to hold data for a height fog object.
Definition: DtWeatherAreaGroup.h:413
A drawable used for drawing items related to weather areas.
Definition: DtWeatherAreaDrawable.h:30
A group node which serves as a root for weather areas, patchy ground fog areas and effects...
Definition: DtWeatherAreaGroup.h:72
DtJobSplitter * myJobSplitter
Definition: DtWeatherAreaGroup.h:704
virtual osg::Object * clone(const osg::CopyOp ©op) const
required functions for derriving from osg::Group
Definition: DtWeatherAreaGroup.h:125
osg::ref_ptr< makVrv::DtWeatherAreaDrawable > mySortPostCloudsDrawable
Definition: DtWeatherAreaGroup.h:669
GroundFogPatchState()
Definition: DtWeatherAreaGroup.h:461
osg::ref_ptr< osg::Uniform > myViewMatrixInvUniform
Definition: DtWeatherAreaGroup.h:475
DrawItem()
Definition: DtWeatherAreaGroup.h:389
SensorMaterialType
brief Sensor material type enumerations used for sensorfx.
Definition: DtWeatherAreaGroup.h:77
std::vector< DrawItem > mySortBinTransparent
Definition: DtWeatherAreaGroup.h:684
Contains makVrv::DtWeatherRainShaft class.
This class simulates and renders a lightning area.
Definition: DtWeatherLightning.h:39
A structure to hold draw state information for lightning shaders.
Definition: DtWeatherAreaGroup.h:486
A structure used to hold data for drawing.
Definition: DtWeatherRainShaft.h:46
RainShaftState myMutableRainShaftState
Definition: DtWeatherAreaGroup.h:690
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:721
SoftnessUniforms mySoftnessUniforms
Definition: DtWeatherAreaGroup.h:488
std::map< DtUniqueID, DtWeatherRainShaft * > DtWeatherRainShaftMap
This is mutable because it's used as part of the const drawImplementation.
Definition: DtWeatherAreaGroup.h:729
float myAltitude
Definition: DtWeatherAreaGroup.h:438
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points.
osg::ref_ptr< osg::Group > myWeatherLightningSensorGroup
Definition: DtWeatherAreaGroup.h:679
DrawItemType
brief Draw item type enumerations used for sorting bins.
Definition: DtWeatherAreaGroup.h:89
SoftnessUniforms mySoftnessUniforms
Definition: DtWeatherAreaGroup.h:466
Definition: DtWeatherAreaGroup.h:83
osg::ref_ptr< makVrv::DtWeatherAreaDrawable > mySortPreCloudsDrawable
Definition: DtWeatherAreaGroup.h:665
float myPatternTextureWidth
Definition: DtWeatherAreaGroup.h:468
float myDensity
Definition: DtWeatherAreaGroup.h:439
osg::ref_ptr< osg::Group > myGroundFogEffectSensorGroup
Definition: DtWeatherAreaGroup.h:677
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
osg::ref_ptr< osg::Group > mySortPostCloudsGroupNode
Definition: DtWeatherAreaGroup.h:667
std::vector< DrawItem > mySortBinPostClouds
Definition: DtWeatherAreaGroup.h:683
GroundFogPatchState myMutableSandstormState
Definition: DtWeatherAreaGroup.h:688
DtWeatherAreaObjectMap myMutableWeatherAreaObjectMap
Definition: DtWeatherAreaGroup.h:726
osg::ref_ptr< osg::Geode > mySortPreCloudsGeode
Definition: DtWeatherAreaGroup.h:664
int mySortDistance
Definition: DtWeatherAreaGroup.h:398
Contains vrvCore::DtCloudLayerRecord declaration.
float myTimeStep
Definition: DtWeatherAreaGroup.h:702
DtWeatherFogFroxelGrid uses a frustum voxel grid to compute density/translucency at voxel locations b...
Definition: DtWeatherFogFroxelGrid.h:46
Definition: DtWeatherAreaGroup.h:80
LightningState myMutableLightningState
Definition: DtWeatherAreaGroup.h:691
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
DtWeatherLightningMap myMutableWeatherLightningMap
Definition: DtWeatherAreaGroup.h:734
std::map< DtUniqueID, DtWeatherLightning * > DtWeatherLightningMap
This is mutable because it's used as part of the const drawImplementation.
Definition: DtWeatherAreaGroup.h:733
An area of ground fog patch items and effects.
Definition: DtGroundFogPatchArea.h:56
Functor for comparing draw items by sorting distance.
Definition: DtWeatherAreaGroup.h:405
std::map< DtUniqueID, HeightFogItem > DtHeightFogMap
Definition: DtWeatherAreaGroup.h:693
DtWeatherRainShaftMap myMutableWeatherRainShaftMap
Definition: DtWeatherAreaGroup.h:730
float myDensityBlend
Definition: DtWeatherAreaGroup.h:441
Base class to provide boost signal/slot management.
void * myItem
Definition: DtWeatherAreaGroup.h:401
float myCornerRadius
Definition: DtWeatherAreaGroup.h:442
osg::Matrixd myBasisRot
Definition: DtWeatherAreaGroup.h:436
Contains makVrv::DtWeatherAreaDrawable class.
osg::ref_ptr< osg::Group > mySandstormSensorGroup
Definition: DtWeatherAreaGroup.h:676
SoftnessUniforms mySoftnessUniforms
Definition: DtWeatherAreaGroup.h:481
Definition: DtWeatherAreaGroup.h:92
long long DtCloudLayerId
Definition: DtCloudLayer.h:26
Contains makVrv::DtGroundFogEffect class.
Definition: DtWeatherAreaGroup.h:93
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:717
Definition: DtWeatherAreaGroup.h:94
std::vector< osg::Vec4d > myCullingPlanes
Definition: DtWeatherAreaGroup.h:699
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Contains the makVrv::DtOsgCullVisitorParameters class.
std::vector< DrawItem > mySortBinPreClouds
Definition: DtWeatherAreaGroup.h:682
GroundFogEffectState myMutableGroundFogEffectState
Definition: DtWeatherAreaGroup.h:689
osg::ref_ptr< osg::Uniform > myViewMatrixInvUniform
Definition: DtWeatherAreaGroup.h:467
A structure to hold data for a draw item.
Definition: DtWeatherAreaGroup.h:387
A structure used to hold data for drawing.
Definition: DtGroundFogPatchArea.h:69
A structure to hold draw state information for ground fog patch (and sandstorm) shaders.
Definition: DtWeatherAreaGroup.h:459
DrawItemType myItemType
Definition: DtWeatherAreaGroup.h:400
osg::ref_ptr< osg::Geode > mySortPostCloudsGeode
Definition: DtWeatherAreaGroup.h:668
Contains makVrv::DtWeatherLightning class.
int mySortPriority
Definition: DtWeatherAreaGroup.h:399
LayerType
brief Layer type enumerations.
Definition: DtWeatherLayer.h:49
osg::ref_ptr< osg::Geode > mySortTransparentGeode
Definition: DtWeatherAreaGroup.h:672
DtWeatherAreaMap myMutableWeatherAreaMap
Definition: DtWeatherAreaGroup.h:722
SoftnessUniforms mySoftnessUniforms
Definition: DtWeatherAreaGroup.h:474
float myWindDirectionRad
Definition: DtWeatherAreaGroup.h:659
virtual osg::Object * cloneType() const
Definition: DtWeatherAreaGroup.h:126
DtVector myBounds
Definition: DtWeatherAreaGroup.h:443
osg::ref_ptr< osg::Group > myWeatherRainShaftSensorGroup
Definition: DtWeatherAreaGroup.h:678