🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
ast::GfxCelestialBody类 参考

Public 成员函数

 GfxCelestialBody (const std::string &name, double radius, const osg::Vec4 &color=osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f))
 
 ~GfxCelestialBody ()
 
bool initialize ()
 
const std::string & getName () const
 
void setPosition (const osg::Vec3d &position)
 
osg::Vec3d getPosition () const
 
void setAttitude (const osg::Quat &attitude)
 
osg::Quat getAttitude () const
 
void setRadius (double radius)
 
double getRadius () const
 
void setColor (const osg::Vec4 &color)
 
osg::Vec4 getColor () const
 
void setRotationSpeed (double speed)
 
double getRotationSpeed () const
 
void setOrbitalSpeed (double speed)
 
double getOrbitalSpeed () const
 
void setOrbitalRadius (double radius)
 
double getOrbitalRadius () const
 
bool setTexture (const std::string &textureFile)
 
void update (double deltaTime)
 
osg::Node * getNode ()
 
osg::Node * createOrbitLine (const osg::Vec4 &color=osg::Vec4(0.5f, 0.5f, 0.5f, 1.0f), int segments=100)
 

构造及析构函数说明

◆ GfxCelestialBody()

ast::GfxCelestialBody::GfxCelestialBody ( const std::string & name,
double radius,
const osg::Vec4 & color = osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f) )

构造函数

参数
name天体名称
radius天体半径
color天体颜色

成员函数说明

◆ createOrbitLine()

osg::Node * ast::GfxCelestialBody::createOrbitLine ( const osg::Vec4 & color = osg::Vec4(0.5f, 0.5f, 0.5f, 1.0f),
int segments = 100 )

创建轨道线

参数
color轨道颜色
segments轨道线段数

◆ setTexture()

bool ast::GfxCelestialBody::setTexture ( const std::string & textureFile)

设置天体纹理

参数
textureFile纹理文件路径

◆ update()

void ast::GfxCelestialBody::update ( double deltaTime)

更新天体状态

参数
deltaTime时间增量(秒)

该类的文档由以下文件生成: