Caelum::PointStarfield Class Reference

Point starfield class. More...

#include <PointStarfield.h>

Inheritance diagram for Caelum::PointStarfield:

Caelum::CameraBoundElement

List of all members.

Classes

struct  Params
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.
virtual ~PointStarfield ()
 Destructor.
StarVectorgetStarVector ()
 Get a reference to the vector of stars.
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.
void _update (float time)
 Update function; called from CaelumSystem::updateSubcomponents.
void setMagnitudeScale (Ogre::Real value)
 Magnitude power scale.
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
Ogre::Degree getObserverPositionRebuildDelta () const
 Moving the observer position around causes a starfield rebuild.
void setObserverPositionRebuildDelta (Ogre::Degree value)
virtual void notifyCameraChanged (Ogre::Camera *cam)
 Handle camera change.
void setQueryFlags (uint flags)
uint getQueryFlags () const
void setVisibilityFlags (uint flags)
uint getVisibilityFlags () const

Static Public Attributes

static const Ogre::Degree DEFAULT_OBSERVER_POSITION_REBUILD_DELTA = Ogre::Degree(0.1)
static const Ogre::String STARFIELD_MATERIAL_NAME = "Caelum/StarPoint"
 Material used to draw all the points.

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.

Definition at line 60 of file PointStarfield.h.


Constructor & Destructor Documentation

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 34 of file PointStarfield.cpp.

References addBrightStarCatalogue(), Caelum::InternalUtilities::checkLoadMaterialClone(), Caelum::InternalUtilities::pointerToString(), Caelum::PrivatePtr< PointedT, TraitsT >::reset(), and STARFIELD_MATERIAL_NAME.


Member Function Documentation

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 89 of file PointStarfield.h.

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

Add stars from the bright star catalogue.

Parameters:
count Number of stars to add (in order of brightness).

Definition at line 137 of file PointStarfield.cpp.

References addStar(), and notifyStarVectorChanged().

Referenced by PointStarfield().

void Caelum::PointStarfield::_update ( float  time  ) 

Update function; called from CaelumSystem::updateSubcomponents.

Parameters:
time Time of the day.

Definition at line 260 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 144 of file PointStarfield.h.

Ogre::Degree Caelum::PointStarfield::getObserverPositionRebuildDelta (  )  const [inline]

Moving the observer position around causes a starfield rebuild.

Default value (DEFAULT_OBSERVER_POSITION_REBUILD_DELTA) is 0.1 degrees which is equivalent to around 170 meters on the earth.

This only matters if you compute the observer position every frame. Caelum doesn't contain code for that.

Definition at line 173 of file PointStarfield.h.


The documentation for this class was generated from the following files:

Generated on Sun Aug 9 10:24:22 2009 for Caelum by  doxygen 1.5.9