caelum::BaseSkyLight Class Reference

#include <SkyLight.h>

Inheritance diagram for caelum::BaseSkyLight:

caelum::CameraBoundElement caelum::Moon caelum::SphereSun caelum::SpriteSun

List of all members.

Public Member Functions

 BaseSkyLight (Ogre::SceneManager *sceneMgr, Ogre::SceneNode *caelumRootNode)
virtual ~BaseSkyLight ()=0
 Destructor.
virtual void update (const Ogre::Vector3 &direction, const Ogre::ColourValue &lightColour, const Ogre::ColourValue &bodyColour)
const Ogre::Vector3 & getLightDirection () const
 Retrieves the latest light direction.
virtual void setLightDirection (const Ogre::Vector3 &dir)
 Set the sun direction.
Ogre::ColourValue getBodyColour () const
 Get current body colour, as set in setBodyColour.
virtual void setBodyColour (const Ogre::ColourValue &colour)
 Sets the colour to draw the light's body with.
Ogre::ColourValue getLightColour () const
 Get current light colour, as set in setLightColour.
virtual void setLightColour (const Ogre::ColourValue &colour)
 Sets the skylight colour.
void setDiffuseMultiplier (const Ogre::ColourValue &diffuse)
 Set diffuse multiplier for light colour.
Ogre::ColourValue getDiffuseMultiplier () const
 Set diffuse multiplier for light colour.
void setSpecularMultiplier (const Ogre::ColourValue &specular)
 Set specular multiplier for light colour.
Ogre::ColourValue getSpecularMultiplier () const
 Set specular multiplier for light colour.
void setAmbientMultiplier (const Ogre::ColourValue &ambient)
Ogre::ColourValue getAmbientMultiplier () const
 Set ambient multiplier for light colour.
Ogre::Light * getMainLight () const
 Direct access to the Ogre::Light.
bool getAutoDisable () const
 Check if the light is automatically disabled.
void setAutoDisable (bool value)
Ogre::Real getAutoDisableThreshold () const
 Get the auto-disable threshold.
void setAutoDisableThreshold (Ogre::Real value)
 Set the auto-disable threshold.
void setForceDisable (bool value)
 Disable the light by force; without taking intensity into account.
bool getForceDisable () const

Static Public Attributes

static const Ogre::Real DEFAULT_AUTO_DISABLE_THRESHOLD = 0.1

Protected Member Functions

virtual void setFarRadius (Ogre::Real radius)
 Handle far radius.
void setMainLightColour (const Ogre::ColourValue &colour)
 Temporary change main light color.
bool shouldEnableLight (const Ogre::ColourValue &colour)

Protected Attributes

Ogre::Light * mMainLight
 The main directional light.
Ogre::SceneNode * mNode
 The sun scene node.
float mRadius
 Base distance of the light.
Ogre::Vector3 mDirection
 The latest normalised sun direction.
Ogre::ColourValue mBodyColour
 Body sphere colour, as set by setBodyColour.
Ogre::ColourValue mLightColour
 Sun light colour, as set by setLightColour.
Ogre::ColourValue mDiffuseMultiplier
 Colour multiplier for light diffuse colour.
Ogre::ColourValue mSpecularMultiplier
 Colour multiplier for light specular colour.
Ogre::ColourValue mAmbientMultiplier
bool mAutoDisableLight
 If the light is automatically disabled beneath mAutoDisableThreshold.
Ogre::Real mAutoDisableThreshold
 Threshold beneath which the light is automatically disabled.
bool mForceDisableLight
 If the light is always disabled. Separate from the mAutoDisable mechanism.


Detailed Description

Base class for sky lights (sun and moon). Contains a directional light which can be automatically disabled when too dim.

Definition at line 9 of file SkyLight.h.


Constructor & Destructor Documentation

caelum::BaseSkyLight::BaseSkyLight ( Ogre::SceneManager *  sceneMgr,
Ogre::SceneNode *  caelumRootNode 
)

Constructor.

Parameters:
sceneMgr The scene manager where the lights will be created.
caelumRootNode Root node to attach to. Should be bound to the camera.

Definition at line 8 of file SkyLight.cpp.

References mMainLight, and mNode.


Member Function Documentation

void caelum::BaseSkyLight::update ( const Ogre::Vector3 &  direction,
const Ogre::ColourValue &  lightColour,
const Ogre::ColourValue &  bodyColour 
) [virtual]

Updates skylight parameters.

Parameters:
direction Light direction.
lightColour Color for the light source
bodyColour Color to draw the body of the light (whatever that is).

Definition at line 50 of file SkyLight.cpp.

References setBodyColour(), setLightColour(), and setLightDirection().

void caelum::BaseSkyLight::setAmbientMultiplier ( const Ogre::ColourValue &  ambient  ) 

Set ambient multiplier for light colour This value is only stored here; the SceneManager is not touched However, CaelumSystem does use this value.

Definition at line 119 of file SkyLight.cpp.

References mAmbientMultiplier.

void caelum::BaseSkyLight::setAutoDisable ( bool  value  )  [inline]

Turn on and off auto-disabling of the light when too dim. This is off by default. If you set it to true you probably also want to set the autoDisableThreshold. The "intensity" of the light for the threshold is calculated as the plain sum of r, g and b.

Definition at line 121 of file SkyLight.h.

bool caelum::BaseSkyLight::shouldEnableLight ( const Ogre::ColourValue &  colour  )  [protected]

If the light should be enabled for a certain value. This functions takes AutoDisable and such into account.

Definition at line 131 of file SkyLight.cpp.

References mAutoDisableLight, mAutoDisableThreshold, and mForceDisableLight.

Referenced by setMainLightColour().


Member Data Documentation

Ogre::ColourValue caelum::BaseSkyLight::mAmbientMultiplier [protected]

Colour multiplier for ambient light colour. No effect, this value is only stored here.

Definition at line 39 of file SkyLight.h.

Referenced by getAmbientMultiplier(), and setAmbientMultiplier().


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