Drag[en]gine Game Engine  1.0
deSky Class Reference

Dynamic Sky for scenes. More...

#include <deSky.h>

Inheritance diagram for deSky:
deResource deObject

Public Member Functions

Management
const decColorGetBgColor () const
 
void SetBgColor (const decColor &color)
 
Layers
int GetLayerCount () const
 
deSkyLayerGetLayerAt (int index) const
 
int IndexOfLayer (deSkyLayer *layer) const
 
bool HasLayer (deSkyLayer *layer) const
 
void AddLayer (deSkyLayer *layer)
 
void RemoveLayer (deSkyLayer *layer)
 
void RemoveLayerAt (int index)
 
void RemoveAllLayers ()
 
void NotifyLayerPositionChanged (int layer)
 
void NotifyLayerOrientationChanged (int layer)
 
void NotifyLayerSizeChanged (int layer)
 
void NotifyLayerColorChanged (int layer)
 
void NotifyLayerSkinChanged (int layer)
 
void NotifyLayerBodiesChanged (int layer)
 
void NotifyLayerLightChanged (int layer)
 
void NotifyLayerTransparencyChanged (int layer)
 
Notifications
void Update (float time)
 
System Peers
deBaseGraphicSkyGetGraphicSky () const
 
void SetGraphicSky (deBaseGraphicSky *sky)
 
- Public Member Functions inherited from deResource
deResourceManagerGetResourceManager () const
 Resource manager or NULL if resource is leaking. More...
 
deEngineGetEngine () const
 Game engine object from resource manager. More...
 
deResourceGetLLManagerPrev () const
 Previous resource in the resource manager linked list. More...
 
void SetLLManagerPrev (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
deResourceGetLLManagerNext () const
 Next resource in the resource manager linked list. More...
 
void SetLLManagerNext (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
void MarkLeaking ()
 Marks the resource leaking. More...
 
 deResource (deResourceManager *resourceManager)
 Create resource. More...
 
- Public Member Functions inherited from deObject
int GetRefCount () const
 Reference count. More...
 
void AddReference ()
 Add reference increasing reference count by 1. More...
 
void FreeReference ()
 Decrease reference count by one and delete object if count reaches 0. More...
 
 deObject ()
 Create object with reference count of 1. More...
 

Constructors and Destructors

 deSky (deSkyManager *manager)
 
virtual ~deSky ()
 Clean up sky. More...
 

Additional Inherited Members

- Protected Member Functions inherited from deResource
virtual ~deResource ()
 Clean up resource. More...
 
- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...
 

Detailed Description

Dynamic Sky for scenes.

Provides support for dynamic skies. Supported are various kinds of skies. The most simple is using a 6 sided sky box with static or dynamic images on the sides. Another way is to use the layer system. This system considers the sky to be projected onto a unit sphere at the center you are standing. The sky is rendered behind anything else in the scene. Each layer can be assigned a rotation, and image and a set of sky bodies. All sky bodies in the layer use the same image. Layers are rendered in ascending order that they are created. To provide planetary movement simply modify the view and up vectors of the layers. Try to avoid changing the bodies once you added them to the layers as this could be slow depending on the graphic module.

Todo:
  • Adding Sky-Box support
  • Adding support for dynamic images
  • Adding support for moving layers around
Author
Plüss Roland
Version
1.0
Date
2008

Constructor & Destructor Documentation

◆ deSky()

deSky::deSky ( deSkyManager manager)

Creates a new sky object with the given resource manager.

◆ ~deSky()

virtual deSky::~deSky ( )
protectedvirtual

Clean up sky.

Note
Subclasses should set their destructor protected too to avoid users accidently deleting a reference counted object through the object pointer. Only FreeReference() is allowed to delete the object.

Member Function Documentation

◆ AddLayer()

void deSky::AddLayer ( deSkyLayer layer)

Adds a layer.

Referenced by GetLayerCount().

◆ GetBgColor()

const decColor& deSky::GetBgColor ( ) const
inline

Retrieves the background color of the sky.

References SetBgColor().

◆ GetGraphicSky()

deBaseGraphicSky* deSky::GetGraphicSky ( ) const
inline

Retrieves the graphic system peer object.

References SetGraphicSky().

◆ GetLayerAt()

deSkyLayer* deSky::GetLayerAt ( int  index) const

Retrieves the layer at the given index.

Referenced by GetLayerCount().

◆ GetLayerCount()

◆ HasLayer()

bool deSky::HasLayer ( deSkyLayer layer) const

Determines if the layer exists.

Referenced by GetLayerCount().

◆ IndexOfLayer()

int deSky::IndexOfLayer ( deSkyLayer layer) const

Retrieves the index of the given layer or -1 if not found.

Referenced by GetLayerCount().

◆ NotifyLayerBodiesChanged()

void deSky::NotifyLayerBodiesChanged ( int  layer)

Notifies peers that a layer changed bodies.

Referenced by GetLayerCount().

◆ NotifyLayerColorChanged()

void deSky::NotifyLayerColorChanged ( int  layer)

Notifies peers that a layer changed color or intensity.

Referenced by GetLayerCount().

◆ NotifyLayerLightChanged()

void deSky::NotifyLayerLightChanged ( int  layer)

Notifies peers that a layer changed light properties.

Referenced by GetLayerCount().

◆ NotifyLayerOrientationChanged()

void deSky::NotifyLayerOrientationChanged ( int  layer)

Notifies peers that a layer changed orientation.

Referenced by GetLayerCount().

◆ NotifyLayerPositionChanged()

void deSky::NotifyLayerPositionChanged ( int  layer)

Notifies peers that a layer changed position.

Referenced by GetLayerCount().

◆ NotifyLayerSizeChanged()

void deSky::NotifyLayerSizeChanged ( int  layer)

Notifies peers that a layer changed size.

Referenced by GetLayerCount().

◆ NotifyLayerSkinChanged()

void deSky::NotifyLayerSkinChanged ( int  layer)

Notifies peers that a layer changed skin.

Referenced by GetLayerCount().

◆ NotifyLayerTransparencyChanged()

void deSky::NotifyLayerTransparencyChanged ( int  layer)

Notifies peers that a layer transparency changed.

Referenced by GetLayerCount().

◆ RemoveAllLayers()

void deSky::RemoveAllLayers ( )

Removes all layers.

Referenced by GetLayerCount().

◆ RemoveLayer()

void deSky::RemoveLayer ( deSkyLayer layer)

Removes a layer.

Referenced by GetLayerCount().

◆ RemoveLayerAt()

void deSky::RemoveLayerAt ( int  index)

Removes the layer at the given index.

Referenced by GetLayerCount().

◆ SetBgColor()

void deSky::SetBgColor ( const decColor color)

Sets the background color of the sky.

Referenced by GetBgColor().

◆ SetGraphicSky()

void deSky::SetGraphicSky ( deBaseGraphicSky sky)

Sets the graphic system peer object.

Referenced by GetGraphicSky().

◆ Update()

void deSky::Update ( float  time)

Updates the sky. Is used to give the system peers the chance to update internal data structured.

Parameters
timeSeconds elapsed since the last update

Referenced by GetLayerCount().


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