#include <PointStarfield.h>
Public Types | |
typedef std::vector< Star > | StarVector |
Public Member Functions | |
PointStarfield (Ogre::SceneManager *sceneMgr, Ogre::SceneNode *caelumRootNode, bool initWithCatalogue=true) | |
virtual | ~PointStarfield () |
Destructor. | |
StarVector & | getStarVector () |
void | notifyStarVectorChanged () |
void | clearAllStars () |
Clear any and all stars. | |
void | addRandomStars (int count) |
void | addStar (const BrightStarCatalogueEntry &entry) |
void | addBrightStarCatalogue (int count=BrightStarCatalogueSize) |
void | _update (float time) |
void | setMagnitudeScale (Ogre::Real value) |
Ogre::Real | getMagnitudeScale () |
void | setMag0PixelSize (Ogre::Real value) |
Ogre::Real | getMag0PixelSize () |
void | setMinPixelSize (Ogre::Real value) |
Ogre::Real | getMinPixelSize () |
void | setMaxPixelSize (Ogre::Real value) |
Ogre::Real | getMaxPixelSize () |
void | setObserverLatitude (Ogre::Degree value) |
Ogre::Degree | getObserverLatitude () |
void | setObserverLongitude (Ogre::Degree value) |
Ogre::Degree | getObserverLongitude () |
virtual void | notifyCameraChanged (Ogre::Camera *cam) |
Handle camera change. | |
Static Public Attributes | |
static const Ogre::String | BILLBOARD_MATERIAL_NAME = "Caelum/StarPoint" |
Material used on billboards. | |
Protected Member Functions | |
virtual void | setFarRadius (Ogre::Real radius) |
Handle far radius. | |
Classes | |
struct | Star |
Struct representing one star. More... |
Stars are sized in pixels; this seems to work a lot better than relative sizes. Stars could be made even smaller but it would require hinting (nudging pixel coordinates to match actual screen pixels). Points are hard.
Loading a bright-star catalogue is supported but star positions are likely only correct relative to each other. External rotation is probably wrong.
Definition at line 61 of file PointStarfield.h.
caelum::PointStarfield::PointStarfield | ( | Ogre::SceneManager * | sceneMgr, | |
Ogre::SceneNode * | caelumRootNode, | |||
bool | initWithCatalogue = true | |||
) |
Constructor. By default this loads some reasonable defaults and the bright star catalogue.
Definition at line 33 of file PointStarfield.cpp.
References addBrightStarCatalogue(), and BILLBOARD_MATERIAL_NAME.
StarVector& caelum::PointStarfield::getStarVector | ( | ) | [inline] |
Get a reference to the vector of stars. You can freely modify this; but you need to updateStars when you're done.
Definition at line 88 of file PointStarfield.h.
void caelum::PointStarfield::notifyStarVectorChanged | ( | ) |
You must call this if you change the star vector by hand.
Definition at line 85 of file PointStarfield.cpp.
Referenced by addBrightStarCatalogue(), addRandomStars(), addStar(), and clearAllStars().
void caelum::PointStarfield::addRandomStars | ( | int | count | ) |
Add a bunch of random stars.
Definition at line 103 of file PointStarfield.cpp.
References caelum::PointStarfield::Star::Declination, caelum::PointStarfield::Star::Magnitude, notifyStarVectorChanged(), and caelum::PointStarfield::Star::RightAscension.
void caelum::PointStarfield::addStar | ( | const BrightStarCatalogueEntry & | entry | ) |
Add one star from the bright star catalogue.
Definition at line 130 of file PointStarfield.cpp.
References caelum::BrightStarCatalogueEntry::decl_deg, caelum::BrightStarCatalogueEntry::decl_min, caelum::BrightStarCatalogueEntry::decl_sec, caelum::PointStarfield::Star::Declination, caelum::BrightStarCatalogueEntry::magn, caelum::PointStarfield::Star::Magnitude, notifyStarVectorChanged(), caelum::BrightStarCatalogueEntry::rasc_hour, caelum::BrightStarCatalogueEntry::rasc_min, caelum::BrightStarCatalogueEntry::rasc_sec, and caelum::PointStarfield::Star::RightAscension.
Referenced by addBrightStarCatalogue().
void caelum::PointStarfield::addBrightStarCatalogue | ( | int | count = BrightStarCatalogueSize |
) |
Add stars from the bright star catalogue.
count | Number of stars to add (in order of brightness). |
Definition at line 146 of file PointStarfield.cpp.
References addStar(), and notifyStarVectorChanged().
Referenced by PointStarfield().
void caelum::PointStarfield::_update | ( | float | time | ) |
Update function; called from CaelumSystem::updateSubcomponents
time | Time of the day. |
Definition at line 255 of file PointStarfield.cpp.
Referenced by caelum::CaelumSystem::updateSubcomponents().
void caelum::PointStarfield::setMagnitudeScale | ( | Ogre::Real | value | ) | [inline] |
Magnitude power scale. Star magnitudes are logarithming; one magnitude difference means a star is 2.512 times brighter. This property allows tweaking that value.
Definition at line 143 of file PointStarfield.h.