53 GfxCelestialBody(
const std::string& name,
double radius,
const osg::Vec4& color = osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
64 const std::string& getName()
const;
67 void setPosition(
const osg::Vec3d& position);
70 osg::Vec3d getPosition()
const;
73 void setAttitude(
const osg::Quat& attitude);
76 osg::Quat getAttitude()
const;
79 void setRadius(
double radius);
82 double getRadius()
const;
85 void setColor(
const osg::Vec4& color);
88 osg::Vec4 getColor()
const;
91 void setRotationSpeed(
double speed);
94 double getRotationSpeed()
const;
97 void setOrbitalSpeed(
double speed);
100 double getOrbitalSpeed()
const;
103 void setOrbitalRadius(
double radius);
106 double getOrbitalRadius()
const;
110 bool setTexture(
const std::string& textureFile);
114 void update(
double deltaTime);
117 osg::Node* getNode();
122 osg::Node* createOrbitLine(
const osg::Vec4& color = osg::Vec4(0.5f, 0.5f, 0.5f, 1.0f),
int segments = 100);
135 double m_rotationSpeed;
138 double m_orbitalSpeed;
141 double m_orbitalRadius;
144 double m_currentRotation;
147 double m_currentOrbit;
150 osg::PositionAttitudeTransform* m_pat{};
153 osg::ShapeDrawable* m_shapeDrawable{};
156 osg::Material* m_material{};
159 osg::Texture2D* m_texture{};
定义 GfxCelestialBody.hpp:47