VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgSkyObject.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
15 #include <vrvCore/DtSkyObject.h>
17 #include <osg/TextureCubeMap>
18 
19 #include <unordered_map>
20 
21 namespace makVrv
22 {
23  class DtDe;
24  class DtWaterOnScreen;
25 
29  {
30  public:
31 
34 
36  virtual ~DtOsgSkyObject();
37 
41  virtual void setLocation(const DtVector& location);
42 
45  virtual const DtVector& location() const;
46 
57 
58  virtual void addCloudLayer(DtCloudLayerId layerId);
59  virtual void setCloudLayerDeckType(DtCloudLayerId layerId, int deckType);
60  virtual void setCloudLayerCornerRadius(DtCloudLayerId layerId, float corner);
61  virtual void setCloudLayerBounds(DtCloudLayerId layerId, const DtVector& bounds);
62  virtual void setCloudLayerDensity(DtCloudLayerId layerId, double density);
63  virtual void setCloudLayerInfiniteFlag(DtCloudLayerId layerId, bool infinite);
64  virtual void setCloudLayerRelativeFlag(DtCloudLayerId layerId, bool relative);
65  virtual void setCloudLayerFadeAtAltitudeFlag(DtCloudLayerId layerId, bool fadeAtAltitude);
66  virtual void setCloudLayerAltitudeIsHATFlag(DtCloudLayerId layerId, bool altitudeIsHAT);
67 
68 
79  virtual CloudLayer* findCloudLayer(DtCloudLayerId layerId);
80 
82  //virtual int cloudLayerCount() const;
83 
85  virtual void removeCloudLayer(DtCloudLayerId layerId);
86 
88  virtual void removeCloudLayers();
89 
92  virtual void sendCloudLayers();
93 
95  virtual void sendCloudLayer(DtCloudLayerId layerId);
96 
98  virtual void setCloudLayerEnabled(DtCloudLayerId layerId, bool enabled);
99 
102  virtual float getSunAlpha() const;
103 
105  virtual void setDrawSunAndMoonIntoEnvMap(bool draw);
106 
109  virtual void setAirTurbidity(float turbidity);
110  virtual float airTurbidity() const;
112 
115  virtual void setAmbientAirTemperature(float temperature);
116  virtual float ambientAirTemperature() const;
118 
121  virtual void setVisibleDistance(float distance);
122  virtual float visibleDistance() const;
124 
127  virtual void setFogHeight(float meters);
128  virtual float fogHeight() const;
130 
136  virtual void setFogColor(const DtVector& color);
137  virtual const osg::Vec4& fogColor() const;
141  virtual void setGroundFogColor(const DtVector& color) override;
142  virtual const osg::Vec3& groundFogColor() const;
144 
150  virtual void setFogThresholdDistance(float distance);
151  virtual float fogThresholdDistance() const;
153 
156  virtual void setPrecipitationEnabled(bool enabled);
157  virtual bool precipitationEnabled() const;
159 
162  virtual void setPrecipitationVisibilityEffectsEnabled(bool enabled);
163  virtual bool precipitationVisibilityEffectsEnabled() const;
165 
169  virtual void setPrecipitationType(int type);
170  virtual int precipitationType() const;
172 
175  virtual void setPrecipitationIntensity(float intensity);
176  virtual float precipitationIntensity() const;
178 
186  virtual bool computeLocalPrecipitation(const DtVector& location, int& type, float& intensity) const;
188 
196  virtual bool computeLocalGroundRainAccumulation(const DtVector& location,
197  float& depth, float& blend) const;
199 
201  virtual void setCloudLayerPositionAndOrientation(DtCloudLayerId layerId, const DtVector& position, float orientation);
202 
205  virtual void setWindSpeed(float metersPerSecond);
206  virtual float windSpeed() const;
208 
209 
211  virtual void setWindDirection(float radians);
213  virtual float windDirection() const;
216  virtual float windDirectionInDegrees() const;
217 
218 
221  virtual void setMinimumWindAltitude(float alt);
222  virtual float minimumWindAltitude() const;
224 
227  virtual void setMaximumWindAltitude(float alt);
228  virtual float maximumWindAltitude() const;
230 
233  virtual void setLensFlare(bool enabled);
234  virtual bool lensFlare() const;
236 
239  virtual void setCrepuscularRays(bool enabled);
240  virtual bool crepuscularRays() const;
242 
245  virtual void setRainSplashEffect();
247 
249  void setGenerateCubeMaps(bool enabled);
250 
253  GLuint getCubeMap(const osg::ref_ptr<const osg::Camera> camera, const osg::State &state) const;
254 
256  void setFogOverride(osg::ref_ptr<const osg::Camera> camera, const osg::Vec4f& fogColor, float fogDensity);
257 
259  void clearFogOverride(osg::ref_ptr<const osg::Camera> camera);
260 
261  void clearFogOverrideForAllCameras(void);
262 
264  void setHorizonColor(const osg::Vec4f& horizonColor);
265 
267  void clearHorizonColor();
268 
270  void updatePrecipitation();
271 
273  DtSilverliningGroup *getDtSilverlining();
274 
278  DtWeatherAreaGroup* findWeatherAreaGroup();
279 
283  DtWeatherLayerGroup* findWeatherLayerGroup();
284 
285  // !\brief Checks to see if weather layer types can be disabled if no matching weather area types exist.
286  virtual void disableInactiveWeatherLayers();
287 
288  // !\brief Checks to see if weather layer types should be enabled if matching weather area types exist.
289  virtual void enableActiveWeatherLayers();
290 
291  void enableLighting(osg::ref_ptr<osg::Camera> camera, bool enable);
292 
295  bool shouldActivateRaindrops() const;
296 
298  void setAboveWater(bool value) { myAboveWater = value; }
299  bool aboveWater() { return myAboveWater; }
300 
306  virtual bool bindFogFroxelTexture(const int unit, const unsigned int renderContextId);
307 
309  virtual float fogFroxelMaxDistance() const;
310 
311  protected:
312  void updatePrecipitationSilverLining();
313 
314  void on_coordinateSystemChanged(const std::string& type);
315 
316  void applyCurrentSettings();
317 
318  protected:
319 
320  virtual void sendCloudLayer(const CloudLayer& layer);
321 
322 protected:
323 
324  typedef std::unordered_map<DtCloudLayerId, CloudLayer> CloudLayerMap;
325 
343  float myFogHeight;
344  osg::Vec4f myFogColor;
345  osg::Vec3f myGroundFogColor;
347  float myWindSpeed;
357 
358  //default cube map for when the sky is turned off.
360 
361  };
362 }
363 
float myWindDirection
Definition: DtOsgSkyObject.h:348
float mySavedVisibility
Definition: DtOsgSkyObject.h:354
bool myPrecipitationEnabled
Definition: DtOsgSkyObject.h:337
Contains makVrv::DtWeatherAreaGroup class.
float myAirTemperature
Definition: DtOsgSkyObject.h:341
osg::ref_ptr< osg::TextureCubeMap > myDefaultCubeMap
Definition: DtOsgSkyObject.h:359
bool aboveWater()
Definition: DtOsgSkyObject.h:299
int myPrecipitationEffectType
Definition: DtOsgSkyObject.h:338
float myAirTurbidity
Definition: DtOsgSkyObject.h:340
A group node which serves as a root for weather layers.
Definition: DtWeatherLayerGroup.h:48
The base sky object.
Definition: DtSkyObject.h:29
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:37
osg::ref_ptr< DtWeatherLayerGroup > myWeatherLayerGroup
Definition: DtOsgSkyObject.h:330
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:17
An OSG implementation of the sky.
Definition: DtOsgSkyObject.h:28
A group node which serves as a root for weather areas, patchy ground fog areas and effects...
Definition: DtWeatherAreaGroup.h:72
DtVector myLocation
Definition: DtOsgSkyObject.h:335
A group node which adds a silver-lining sky and will light all Children with the proper lighting para...
Definition: DtSilverliningGroup.h:79
Definition: DtSkyObject.h:36
Contains makVrv::DtSkyObject class.
float myVisibleDistance
Definition: DtOsgSkyObject.h:342
float myWindAltMinimum
Definition: DtOsgSkyObject.h:349
bool myLensFlareEnabled
Definition: DtOsgSkyObject.h:351
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points.
float myFogHeight
Definition: DtOsgSkyObject.h:343
float myWindSpeed
Definition: DtOsgSkyObject.h:347
Contains makVrv::DtWeatherLayerGroup class.
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
osg::ref_ptr< DtWeatherAreaGroup > myWeatherAreaGroup
Definition: DtOsgSkyObject.h:329
DtUniqueID myBlowingDustWeatherLayerId
Definition: DtOsgSkyObject.h:331
bool myCrepuscularRaysEnabled
Definition: DtOsgSkyObject.h:352
bool myPrecipitationVisibilityEffects
Definition: DtOsgSkyObject.h:356
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
bool myVisibilitySaved
Definition: DtOsgSkyObject.h:353
DtUniqueID myBlowingSandWeatherLayerId
Definition: DtOsgSkyObject.h:332
float myFogThreshold
Definition: DtOsgSkyObject.h:346
osg::ref_ptr< DtSilverliningGroup > mySilverliningGroup
Definition: DtOsgSkyObject.h:328
Base class to provide boost signal/slot management.
bool myAboveWater
Definition: DtOsgSkyObject.h:355
DtUniqueID myHailLayerId
Definition: DtOsgSkyObject.h:334
std::unordered_map< DtCloudLayerId, CloudLayer > CloudLayerMap
Definition: DtOsgSkyObject.h:324
long long DtCloudLayerId
Definition: DtCloudLayer.h:26
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
void setAboveWater(bool value)
needed for god ray generation
Definition: DtOsgSkyObject.h:298
float myWindAltMaximum
Definition: DtOsgSkyObject.h:350
DtUniqueID myBlowingSnowWeatherLayerId
Definition: DtOsgSkyObject.h:333
DtSignalConnectionManager mySignals
Definition: DtOsgSkyObject.h:327
DtDe & myDe
Definition: DtOsgSkyObject.h:326
float myPrecipitationIntensity
Definition: DtOsgSkyObject.h:339
Contains makVrv::DtSilverliningGroup class.
CloudLayerMap myCloudLayerMap
Definition: DtOsgSkyObject.h:336
osg::Vec3f myGroundFogColor
Definition: DtOsgSkyObject.h:345
osg::Vec4f myFogColor
Definition: DtOsgSkyObject.h:344
Definition: vrfObjectManipulationHandlerBaseClass.h:65

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)