Caelum
0.6.4
|
Base class for sky lights (sun and moon). More...
#include <SkyLight.h>
Public Member Functions | |
BaseSkyLight (Ogre::SceneManager *sceneMgr, Ogre::SceneNode *caelumRootNode) | |
Constructor. More... | |
virtual | ~BaseSkyLight ()=0 |
Destructor. | |
virtual void | update (const Ogre::Vector3 &direction, const Ogre::ColourValue &lightColour, const Ogre::ColourValue &bodyColour) |
Updates skylight parameters. More... | |
const Ogre::Vector3 | getLightDirection () const |
Retrieves the latest light direction. | |
virtual void | setLightDirection (const Ogre::Vector3 &dir) |
Set the sun direction. | |
const 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. | |
const 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. | |
const Ogre::ColourValue | getDiffuseMultiplier () const |
Set diffuse multiplier for light colour. | |
void | setSpecularMultiplier (const Ogre::ColourValue &specular) |
Set specular multiplier for light colour. | |
const Ogre::ColourValue | getSpecularMultiplier () const |
Set specular multiplier for light colour. | |
void | 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. | |
const 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) |
Turn on and off auto-disabling of the light when too dim. More... | |
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 |
virtual void | setQueryFlags (uint flags)=0 |
virtual uint | getQueryFlags () const =0 |
virtual void | setVisibilityFlags (uint flags)=0 |
virtual uint | getVisibilityFlags () const =0 |
Public Member Functions inherited from Caelum::CameraBoundElement | |
CameraBoundElement () | |
Constructor. More... | |
virtual | ~CameraBoundElement () |
Virtual Destructor. | |
virtual void | notifyCameraChanged (Ogre::Camera *cam)=0 |
Notify new camera conditions. More... | |
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::Real | DEFAULT_AUTO_DISABLE_THRESHOLD |
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. | |
void | setMainLightColour (const Ogre::ColourValue &colour) |
Temporary change main light color. | |
bool | shouldEnableLight (const Ogre::ColourValue &colour) |
If the light should be enabled for a certain value. More... | |
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 |
Colour multiplier for ambient light colour. More... | |
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. | |
Base class for sky lights (sun and moon).
Contains a directional light which can be automatically disabled when too dim.
Caelum::BaseSkyLight::BaseSkyLight | ( | Ogre::SceneManager * | sceneMgr, |
Ogre::SceneNode * | caelumRootNode | ||
) |
Constructor.
sceneMgr | The scene manager where the lights will be created. |
caelumRootNode | Root node to attach to. Should be bound to the camera. |
|
virtual |
Updates skylight parameters.
direction | Light direction. |
lightColour | Color for the light source |
bodyColour | Color to draw the body of the light (whatever that is). |
|
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.
|
protected |
If the light should be enabled for a certain value.
This functions takes AutoDisable and such into account.
|
protected |
Colour multiplier for ambient light colour.
No effect, this value is only stored here.