🛰️航天仿真算法库 SpaceAST
0.0.1
载入中...
搜索中...
未找到
GfxSolarSystem.hpp
浏览该文件的文档.
1
20
21
#pragma once
22
23
#include "AstGlobal.h"
24
#include "
GfxCelestialBody.hpp
"
25
26
// OSG头文件
27
#include <osg/Group>
28
#include <osg/Node>
29
#include <vector>
30
#include <string>
31
32
namespace
osg {
33
class
Node;
34
class
Group;
35
}
36
37
AST_NAMESPACE_BEGIN
38
39
class
AST_GFX_API
GfxSolarSystem
{
40
public
:
42
GfxSolarSystem
();
43
GfxSolarSystem
(
const
GfxSolarSystem
&) =
delete
;
44
GfxSolarSystem
& operator=(
const
GfxSolarSystem
&) =
delete
;
45
47
~GfxSolarSystem
();
48
50
bool
initialize();
51
54
void
update(
double
deltaTime);
55
57
osg::Node* getNode();
58
60
void
addCelestialBody(
GfxCelestialBody
* body);
61
63
void
removeCelestialBody(
GfxCelestialBody
* body);
64
67
GfxCelestialBody
* getCelestialBody(
const
std::string& name);
68
70
bool
createSun();
71
79
bool
createPlanet(
const
std::string& name,
double
radius,
double
orbitalRadius,
80
double
orbitalSpeed,
double
rotationSpeed,
const
osg::Vec4& color);
81
83
bool
createCompleteSolarSystem();
84
85
private
:
87
osg::Group* m_root{};
88
90
std::vector<GfxCelestialBody*> m_celestialBodies{};
91
93
std::vector<osg::Node*> m_orbitLines{};
94
};
95
96
AST_NAMESPACE_END
GfxCelestialBody.hpp
天体可视化类
ast::GfxCelestialBody
定义
GfxCelestialBody.hpp:47
ast::GfxSolarSystem
定义
GfxSolarSystem.hpp:39
src
AstGfx
GfxSolarSystem.hpp
制作者
1.12.0