Caelum  0.6.4
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Caelum::PointStarfield Class Reference

Point starfield class. More...

#include <PointStarfield.h>

Inheritance diagram for Caelum::PointStarfield:
[legend]

Classes

struct  Star
 Struct representing one star inside PointStarfield. More...
 

Public Types

typedef std::vector< StarStarVector
 A vector of Star.
 

Public Member Functions

 PointStarfield (Ogre::SceneManager *sceneMgr, Ogre::SceneNode *caelumRootNode, bool initWithCatalogue=true)
 Constructor. More...
 
virtual ~PointStarfield ()
 Destructor.
 
StarVectorgetStarVector ()
 Get a reference to the vector of stars. More...
 
void notifyStarVectorChanged ()
 You must call this if you change the star vector by hand.
 
void clearAllStars ()
 Clear any and all stars.
 
void addRandomStars (int count)
 Add a bunch of random stars.
 
void addStar (const BrightStarCatalogueEntry &entry)
 Add one star from the bright star catalogue.
 
void addBrightStarCatalogue (int count=BrightStarCatalogueSize)
 Add stars from the bright star catalogue. More...
 
void update (LongReal julDay)
 Update function; called from CaelumSystem::updateSubcomponents. More...
 
void setMagnitudeScale (Ogre::Real value)
 Magnitude power scale. More...
 
Ogre::Real getMagnitudeScale () const
 
void setMag0PixelSize (Ogre::Real value)
 
Ogre::Real getMag0PixelSize () const
 
void setMinPixelSize (Ogre::Real value)
 
Ogre::Real getMinPixelSize () const
 
void setMaxPixelSize (Ogre::Real value)
 
Ogre::Real getMaxPixelSize () const
 
void setObserverLatitude (Ogre::Degree value)
 
Ogre::Degree getObserverLatitude () const
 
void setObserverLongitude (Ogre::Degree value)
 
Ogre::Degree getObserverLongitude () const
 
virtual void notifyCameraChanged (Ogre::Camera *cam)
 Handle camera change.
 
void setQueryFlags (uint flags)
 
uint getQueryFlags () const
 
void setVisibilityFlags (uint flags)
 
uint getVisibilityFlags () const
 
- Public Member Functions inherited from Caelum::CameraBoundElement
 CameraBoundElement ()
 Constructor. More...
 
virtual ~CameraBoundElement ()
 Virtual Destructor.
 
void forceFarRadius (Ogre::Real radius)
 Forces the "far" size of the element to a specific radius. More...
 
bool getAutoRadius () const
 Checks if this element is in auto-radius mode. More...
 
void setAutoRadius ()
 Re-enable auto-radius; if disabled. More...
 

Static Public Attributes

static const Ogre::String STARFIELD_MATERIAL_NAME
 Material used to draw all the points.
 
- Static Public Attributes inherited from Caelum::CameraBoundElement
static const Ogre::Real CAMERA_FAR_DISTANCE_MULTIPLIER
 Camera distances multiplier for the far clipping distance. More...
 
static const Ogre::Real CAMERA_NEAR_DISTANCE_MULTIPLIER
 Camera distances multiplier for the near clipping distance. More...
 

Protected Member Functions

virtual void setFarRadius (Ogre::Real radius)
 Handle far radius.
 

Detailed Description

Point starfield class.

An Ogre::ManualObject is used for drawing because billboards are too slow.

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.

Constructor & Destructor Documentation

◆ PointStarfield()

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.

Member Function Documentation

◆ getStarVector()

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.

◆ addBrightStarCatalogue()

void Caelum::PointStarfield::addBrightStarCatalogue ( int  count = BrightStarCatalogueSize)

Add stars from the bright star catalogue.

Parameters
countNumber of stars to add (in order of brightness).

◆ update()

void Caelum::PointStarfield::update ( LongReal  julDay)

Update function; called from CaelumSystem::updateSubcomponents.

Parameters
julDayJulian day and time.

◆ setMagnitudeScale()

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.