![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtOsgSkyObject.h,v $ $Revision: 1.14 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #ifndef DtOsgSkyObject_H_ 00014 #define DtOsgSkyObject_H_ 00015 00016 #include <vrvOsg/vrvOsg.h> 00017 #include <vrvCore/DtSkyObject.h> 00018 #include <vrvOsg/DtSilverliningGroup.h> 00019 00020 #include <vrvOsg/DtOsgCullVisitorParameters.h> 00021 #include <osg/Camera> 00022 #include <osgUtil/CullVisitor> 00023 #include <osgParticle/PrecipitationEffect> 00024 00025 namespace makVrv 00026 { 00027 class DtDe; 00028 00032 class DT_DLL_VRVOSG DtPrecipitationEffect : public osgParticle::PrecipitationEffect 00033 { 00034 public: 00035 DtPrecipitationEffect(); 00036 DtPrecipitationEffect(const DtPrecipitationEffect& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); 00037 ~DtPrecipitationEffect(); 00038 00039 virtual const char* libraryName() const { return "vrvOsg"; } 00040 virtual const char* className() const { return "DtPrecipitationEffect"; } 00041 virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const DtPrecipitationEffect*>(obj) != 0; } 00042 00043 virtual void traverse(osg::NodeVisitor& nv); 00044 }; 00045 00048 class DT_DLL_VRVOSG DtOsgSkyObject : public DtSkyObject 00049 { 00050 public: 00051 00053 DtOsgSkyObject(DtDe&, DtUniqueID id); 00054 00056 virtual ~DtOsgSkyObject(); 00057 00062 virtual void setLocation(const DtVector& location); 00063 00068 virtual void addCloudLayer(int deckType, const DtVector& location, 00069 const DtVector& bounds, double density); 00070 00072 virtual void removeCloudLayer(int index); 00073 00075 virtual void setCloudLayerEnabled(int index,bool enabled); 00076 00078 virtual int cloudLayerCount() const; 00079 00081 virtual void setAirTurbidity(float turbidity); 00082 00084 virtual void setVisibleDistance(float distance); 00085 00087 virtual void setPrecipitationEnabled(bool enabled); 00088 00091 virtual void setPrecipitationType(int type); 00092 00094 virtual void setPrecipitationIntensity(float intensity); 00095 00097 virtual void setCloudLayerPosition(int index, double xCoord, 00098 double yCoord); 00099 00100 protected: 00101 00102 void updatePrecipitation(); 00103 00105 void on_coordinateSystemChanged(const std::string& type); 00106 00107 protected: 00108 DtDe& myDe; 00109 osg::ref_ptr<DtSilverliningGroup> mySilverliningNode; 00110 osg::ref_ptr<osgParticle::PrecipitationEffect> myPrecipitationEffect; 00111 bool myPrecipitationEnabled; 00112 int myPrecipitationEffectType; 00113 float myPrecipitationIntensity; 00114 00115 }; 00116 } 00117 00118 #endif 00119