#pragma once #include #include #include #include #include #include //#include "scene/SkyDome.h" class OsgView; class OEScene : public osg::Referenced { public: OEScene(); void InitEventHandle(OsgView* view); void AttachView(OsgView* view); void DetachView(OsgView* view); osg::ref_ptr LoadCubeMapTextures(const std::string& dir); inline osg::Vec4f IntColor(unsigned r, unsigned g, unsigned b, unsigned a = 255) { float div = 1.f / 255.f; return osg::Vec4f(div * (float)r, div * (float)g, div * float(b), div * (float)a); } osg::Group* GetData(); inline osg::Group* GetScene(void) { return earthMapNode_.get(); } void AddToScene(osg::Node* node); private: osg::ref_ptr earthRootNode_; osg::ref_ptr earthMapNode_; osg::ref_ptr entityRoot_; osg::ref_ptr skyDome_; std::unique_ptr logarithmicDepthBuffer_; };