deSkyLayer Class Reference

Sky Layer. More...

#include <deSkyLayer.h>

List of all members.

Public Member Functions

Constructors and Destructors
 deSkyLayer ()
 Creates a new sky layer.
 ~deSkyLayer ()
 Cleans up the sky layer.
Management
const decVectorGetPosition () const
 Retrieves the position.
void SetPosition (const decVector &position)
 Sets the position.
const decQuaternionGetOrientation () const
 Retrieves the orientation.
void SetOrientation (const decQuaternion &orientation)
 Sets the orientation.
const decVectorGetSize () const
 Retrieves the size.
void SetSize (const decVector &size)
 Sets the size.
const decColorGetColor () const
 Retrieves the blending color.
void SetColor (const decColor &color)
 Sets the blending color.
float GetIntensity () const
 Retrieves the intensity.
void SetIntensity (float intensity)
 Sets the intensity.
float GetTransparency () const
 Retrieves the transparency.
void SetTransparency (float transparency)
 Sets the transparency.
deSkinGetSkin () const
 Retrieves the skin or NULL if not set.
void SetSkin (deSkin *skin)
 Sets the skin or NULL if not set.
const decQuaternionGetLightOrientation () const
 Retrieves the orientation of the sky light.
void SetLightOrientation (const decQuaternion &orientation)
 Sets the orientation of the sky light.
const decColorGetLightColor () const
 Retrieves the color of the sky light.
void SetLightColor (const decColor &color)
 Sets the color of the sky light.
float GetLightIntensity () const
 Retrieves the intensity of the direct sky light.
void SetLightIntensity (float intensity)
 Sets the intensity of the direct sky light.
float GetAmbientIntensity () const
 Retrieves the intensity of the diffuse sky light.
void SetAmbientIntensity (float intensity)
 Sets the intensity of the diffuse sky light.
Bodies
int GetBodyCount () const
 Retrieves the number of bodies.
deSkyLayerBodyGetBodyAt (int index) const
 Retrieves the body at the given index.
int IndexOfBody (deSkyLayerBody *body) const
 Retrieves the index of the body or -1 if not found.
bool HasBody (deSkyLayerBody *body) const
 Determines if a body exists.
void AddBody (deSkyLayerBody *body)
 Adds a body.
void RemoveBody (deSkyLayerBody *body)
 Removes a body.
void RemoveBodyAt (int index)
 Removes the body at the given position.
void RemoveAllBodies ()
 Removes all bodies.

Detailed Description

Sky Layer.

Sky layers define the content of the sky using one or more layers drawn ontop of each other. Each layer can be rotated individually. This way rich skies can be modeled using a simple system. The color parameter can be used to tint the content of a layer. The type of the sky is defined by the assigned skin. This way sky rendering can be enhanced without modifying the engine just the graphic module. The following types are recognized ( more can be defined by specific modules in the future ).

Sky Box
The sky layer renders as a sky box. A sky box composes of 6 images for each side of an imaginary cube onto the inside the sky is projected. A sky box layer complete covers the entire sky and is therefore suitable for the first layer in a sky. You can also use this layer ontop of other layers if you use images with transparency or using the alpha value of the blending color. The skin assigned to the layer contains the sky box images. There have to be six textures inside the skin named "sky.box.left", "sky.box.right", "sky.box.top", "sky.box.bottom", "sky.box.back" and "sky.box.front" representing the respective image. The names are defined as constants for the graphic modules.
Sky Sphere
The sky layer renders as a sky sphere. Sky spheres are often called sky domes especially if they cover only 180 degrees of the sky. The sky sphere can cover optionally 180 or 360 of the sky. A sky sphere composes of 2 images one for the top half of the sphere and the other for the bottom half. The top image is mandatory but the bottom one is not required if the player can never see the lower half of the sphere. A sky sphere layer can completely cover the entire sky and is therefore suitable for the first layer in a sky. You can also use this layer ontop of other layers if you use images with transparency or using the alpha value of the blending color. The images for the individual sphere halves have to be in a sphere mapping compatible form. These sky textures usually are of rectangular form with a width to height ratio of 2 to 1. Light probe sky textures are not supported by this layer type. The skin assigned to the layer contains the sky sphere images. There has to be at least the top image and optionall the bottom image. The textures have to be named "sky.sphere.top" and "sky.sphere.bottom" representing the respective image. The names are defined as constants for the graphic modules.
Sky Bodies
The sky layer is rendered as a collection of individual celestrical bodies. All contained bodies can be placed individually but are moved all together with the layer. This kind of layer is useful for either a single celestrical body like the sun or the moon or a collection of individual bodies like clouds moving together. Especially with clouds using 2 or 3 layers can be used to simulate clouds at different altitude moving due to different wind influence. Since this layer type covers only partially the sky it is not suited as the first layer but well suited for drawing bodies ontop of existing layers. The skin assigned to the layer is used as the source of images for the individual bodies. Each body specifies the index of the texture to use from the skin. Therefor all images for all bodies inside the same layer have to be stored in the same skin.
Author:
Plüss Roland
Version:
1.0
Date:
2008

Constructor & Destructor Documentation

deSkyLayer::deSkyLayer (  )

Creates a new sky layer.

deSkyLayer::~deSkyLayer (  )

Cleans up the sky layer.


Member Function Documentation

void deSkyLayer::AddBody ( deSkyLayerBody body )

Adds a body.

float deSkyLayer::GetAmbientIntensity (  ) const [inline]

Retrieves the intensity of the diffuse sky light.

deSkyLayerBody* deSkyLayer::GetBodyAt ( int  index ) const

Retrieves the body at the given index.

int deSkyLayer::GetBodyCount (  ) const [inline]

Retrieves the number of bodies.

const decColor& deSkyLayer::GetColor (  ) const [inline]

Retrieves the blending color.

float deSkyLayer::GetIntensity (  ) const [inline]

Retrieves the intensity.

const decColor& deSkyLayer::GetLightColor (  ) const [inline]

Retrieves the color of the sky light.

float deSkyLayer::GetLightIntensity (  ) const [inline]

Retrieves the intensity of the direct sky light.

const decQuaternion& deSkyLayer::GetLightOrientation (  ) const [inline]

Retrieves the orientation of the sky light.

const decQuaternion& deSkyLayer::GetOrientation (  ) const [inline]

Retrieves the orientation.

const decVector& deSkyLayer::GetPosition (  ) const [inline]

Retrieves the position.

const decVector& deSkyLayer::GetSize (  ) const [inline]

Retrieves the size.

deSkin* deSkyLayer::GetSkin (  ) const [inline]

Retrieves the skin or NULL if not set.

float deSkyLayer::GetTransparency (  ) const [inline]

Retrieves the transparency.

bool deSkyLayer::HasBody ( deSkyLayerBody body ) const

Determines if a body exists.

int deSkyLayer::IndexOfBody ( deSkyLayerBody body ) const

Retrieves the index of the body or -1 if not found.

void deSkyLayer::RemoveAllBodies (  )

Removes all bodies.

void deSkyLayer::RemoveBody ( deSkyLayerBody body )

Removes a body.

void deSkyLayer::RemoveBodyAt ( int  index )

Removes the body at the given position.

void deSkyLayer::SetAmbientIntensity ( float  intensity )

Sets the intensity of the diffuse sky light.

void deSkyLayer::SetColor ( const decColor color )

Sets the blending color.

void deSkyLayer::SetIntensity ( float  intensity )

Sets the intensity.

void deSkyLayer::SetLightColor ( const decColor color )

Sets the color of the sky light.

void deSkyLayer::SetLightIntensity ( float  intensity )

Sets the intensity of the direct sky light.

void deSkyLayer::SetLightOrientation ( const decQuaternion orientation )

Sets the orientation of the sky light.

void deSkyLayer::SetOrientation ( const decQuaternion orientation )

Sets the orientation.

void deSkyLayer::SetPosition ( const decVector position )

Sets the position.

void deSkyLayer::SetSize ( const decVector size )

Sets the size.

void deSkyLayer::SetSkin ( deSkin skin )

Sets the skin or NULL if not set.

void deSkyLayer::SetTransparency ( float  transparency )

Sets the transparency.


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