caelum::PointStarfield Class Reference

#include <PointStarfield.h>

Inheritance diagram for caelum::PointStarfield:

caelum::CameraBoundElement

List of all members.

Public Types

typedef std::vector< StarStarVector

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...


Detailed Description

Point starfield class. An Ogre::BillboardSet is used internally; but it doesn't do much. The data is not kept inside the billboardset; but externally. Custom hardware buffers would probably work better.

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.


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

References addBrightStarCatalogue(), and BILLBOARD_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 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  ) 

void caelum::PointStarfield::addStar ( const BrightStarCatalogueEntry entry  ) 

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 146 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 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.


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

Generated on Fri Jul 11 09:24:53 2008 for Caelum by  doxygen 1.5.6