Drag[en]gine Game Engine  1.0
deSkyLayer Class Reference

Sky Layer. More...

#include <deSkyLayer.h>

Public Member Functions

Constructors and Destructors
 deSkyLayer ()
 
 ~deSkyLayer ()
 
Management
const decVectorGetPosition () const
 
void SetPosition (const decVector &position)
 
const decQuaternionGetOrientation () const
 
void SetOrientation (const decQuaternion &orientation)
 
const decVectorGetSize () const
 
void SetSize (const decVector &size)
 
const decColorGetColor () const
 
void SetColor (const decColor &color)
 
float GetIntensity () const
 
void SetIntensity (float intensity)
 
float GetTransparency () const
 
void SetTransparency (float transparency)
 
deSkinGetSkin () const
 
void SetSkin (deSkin *skin)
 
const decQuaternionGetLightOrientation () const
 
void SetLightOrientation (const decQuaternion &orientation)
 
const decColorGetLightColor () const
 
void SetLightColor (const decColor &color)
 
float GetLightIntensity () const
 
void SetLightIntensity (float intensity)
 
float GetAmbientIntensity () const
 
void SetAmbientIntensity (float intensity)
 
Bodies
int GetBodyCount () const
 
deSkyLayerBodyGetBodyAt (int index) const
 
int IndexOfBody (deSkyLayerBody *body) const
 
bool HasBody (deSkyLayerBody *body) const
 
void AddBody (deSkyLayerBody *body)
 
void RemoveBody (deSkyLayerBody *body)
 
void RemoveBodyAt (int index)
 
void RemoveAllBodies ()
 

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::deSkyLayer ( )

Creates a new sky layer.

◆ ~deSkyLayer()

deSkyLayer::~deSkyLayer ( )

Cleans up the sky layer.

Member Function Documentation

◆ AddBody()

void deSkyLayer::AddBody ( deSkyLayerBody body)

Adds a body.

Referenced by GetBodyCount().

◆ GetAmbientIntensity()

float deSkyLayer::GetAmbientIntensity ( ) const
inline

Retrieves the intensity of the diffuse sky light.

References SetAmbientIntensity().

◆ GetBodyAt()

deSkyLayerBody* deSkyLayer::GetBodyAt ( int  index) const

Retrieves the body at the given index.

Referenced by GetBodyCount().

◆ GetBodyCount()

int deSkyLayer::GetBodyCount ( ) const
inline

Retrieves the number of bodies.

References AddBody(), GetBodyAt(), HasBody(), IndexOfBody(), RemoveAllBodies(), RemoveBody(), and RemoveBodyAt().

◆ GetColor()

const decColor& deSkyLayer::GetColor ( ) const
inline

Retrieves the blending color.

References SetColor().

◆ GetIntensity()

float deSkyLayer::GetIntensity ( ) const
inline

Retrieves the intensity.

References SetIntensity().

◆ GetLightColor()

const decColor& deSkyLayer::GetLightColor ( ) const
inline

Retrieves the color of the sky light.

References SetLightColor().

◆ GetLightIntensity()

float deSkyLayer::GetLightIntensity ( ) const
inline

Retrieves the intensity of the direct sky light.

References SetLightIntensity().

◆ GetLightOrientation()

const decQuaternion& deSkyLayer::GetLightOrientation ( ) const
inline

Retrieves the orientation of the sky light.

References SetLightOrientation().

◆ GetOrientation()

const decQuaternion& deSkyLayer::GetOrientation ( ) const
inline

Retrieves the orientation.

References SetOrientation().

◆ GetPosition()

const decVector& deSkyLayer::GetPosition ( ) const
inline

Retrieves the position.

References SetPosition().

◆ GetSize()

const decVector& deSkyLayer::GetSize ( ) const
inline

Retrieves the size.

References SetSize().

◆ GetSkin()

deSkin* deSkyLayer::GetSkin ( ) const
inline

Retrieves the skin or NULL if not set.

References SetSkin().

◆ GetTransparency()

float deSkyLayer::GetTransparency ( ) const
inline

Retrieves the transparency.

References SetTransparency().

◆ HasBody()

bool deSkyLayer::HasBody ( deSkyLayerBody body) const

Determines if a body exists.

Referenced by GetBodyCount().

◆ IndexOfBody()

int deSkyLayer::IndexOfBody ( deSkyLayerBody body) const

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

Referenced by GetBodyCount().

◆ RemoveAllBodies()

void deSkyLayer::RemoveAllBodies ( )

Removes all bodies.

Referenced by GetBodyCount().

◆ RemoveBody()

void deSkyLayer::RemoveBody ( deSkyLayerBody body)

Removes a body.

Referenced by GetBodyCount().

◆ RemoveBodyAt()

void deSkyLayer::RemoveBodyAt ( int  index)

Removes the body at the given position.

Referenced by GetBodyCount().

◆ SetAmbientIntensity()

void deSkyLayer::SetAmbientIntensity ( float  intensity)

Sets the intensity of the diffuse sky light.

Referenced by GetAmbientIntensity().

◆ SetColor()

void deSkyLayer::SetColor ( const decColor color)

Sets the blending color.

Referenced by GetColor().

◆ SetIntensity()

void deSkyLayer::SetIntensity ( float  intensity)

Sets the intensity.

Referenced by GetIntensity().

◆ SetLightColor()

void deSkyLayer::SetLightColor ( const decColor color)

Sets the color of the sky light.

Referenced by GetLightColor().

◆ SetLightIntensity()

void deSkyLayer::SetLightIntensity ( float  intensity)

Sets the intensity of the direct sky light.

Referenced by GetLightIntensity().

◆ SetLightOrientation()

void deSkyLayer::SetLightOrientation ( const decQuaternion orientation)

Sets the orientation of the sky light.

Referenced by GetLightOrientation().

◆ SetOrientation()

void deSkyLayer::SetOrientation ( const decQuaternion orientation)

Sets the orientation.

Referenced by GetOrientation().

◆ SetPosition()

void deSkyLayer::SetPosition ( const decVector position)

Sets the position.

Referenced by GetPosition().

◆ SetSize()

void deSkyLayer::SetSize ( const decVector size)

Sets the size.

Referenced by GetSize().

◆ SetSkin()

void deSkyLayer::SetSkin ( deSkin skin)

Sets the skin or NULL if not set.

Referenced by GetSkin().

◆ SetTransparency()

void deSkyLayer::SetTransparency ( float  transparency)

Sets the transparency.

Referenced by GetTransparency().


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