DYT/Source/src/scene/OEScene.h

40 lines
945 B
C
Raw Normal View History

2024-12-26 00:28:25 +00:00
#pragma once
#include <osg/Switch>
#include <osg/TextureCubeMap>
#include <osgText/Text>
#include <osgEarth/ModelNode>
#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<osg::TextureCubeMap> 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<osg::Node> earthRootNode_;
osg::ref_ptr<osgEarth::MapNode> earthMapNode_;
osg::ref_ptr<osg::Group> entityRoot_;
};