53 GfxCelestialBody(
const std::string& name,
double radius,
const osg::Vec4& color = osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
62 const std::string& getName()
const;
65 void setPosition(
const osg::Vec3d& position);
68 osg::Vec3d getPosition()
const;
71 void setAttitude(
const osg::Quat& attitude);
74 osg::Quat getAttitude()
const;
77 void setRadius(
double radius);
80 double getRadius()
const;
83 void setColor(
const osg::Vec4& color);
86 osg::Vec4 getColor()
const;
89 void setRotationSpeed(
double speed);
92 double getRotationSpeed()
const;
95 void setOrbitalSpeed(
double speed);
98 double getOrbitalSpeed()
const;
101 void setOrbitalRadius(
double radius);
104 double getOrbitalRadius()
const;
108 bool setTexture(
const std::string& textureFile);
112 void update(
double deltaTime);
115 osg::Node* getNode();
120 osg::Node* createOrbitLine(
const osg::Vec4& color = osg::Vec4(0.5f, 0.5f, 0.5f, 1.0f),
int segments = 100);
133 double m_rotationSpeed;
136 double m_orbitalSpeed;
139 double m_orbitalRadius;
142 double m_currentRotation;
145 double m_currentOrbit;
148 osg::PositionAttitudeTransform* m_pat;
151 osg::ShapeDrawable* m_shapeDrawable;
154 osg::Material* m_material;
157 osg::Texture2D* m_texture;
定义 GfxCelestialBody.hpp:47