Gizmo3D

gzEnvironment Class Reference

The gzEnvironment class is used when you want to add environmental effects to a scene. More...

#include <gzEnvironment.h>

Inheritance diagram for gzEnvironment:

gzGroup gzNode gzBoundary gzNodeActionProvider gzNameInterface gzDebugInterface gzIntersectMask gzUpdateIDInterface gzCullMask gzObject gzUserData gzReference gzSerializeData gzSharedMemory gzTypeInterface List of all members.

Public Member Functions

 gzEnvironment (const gzString &name=GZ_EMPTY_STRING)
 Constructor.
virtual ~gzEnvironment ()
 Destructor.
 GZ_DECLARE_TYPE_INTERFACE_EXPORT (1)
virtual gzReferenceclone () const
 Clone interface.
virtual gzVoid preTraverseAction (gzTraverseAction *actionclass, gzContext *context)
 Called in the traversal process.
virtual gzVoid postTraverseAction (gzTraverseAction *actionclass, gzContext *context)
 Called in the traversal process.
gzVoid addLight (gzLight *light)
 Adds a light to the environment.
gzVoid removeLight (gzLight *light)
 Removes the light from the scene graph.
gzULong getNumberOfLights ()
 Returns the number of lights connected to the scene.
gzLightgetLight (gzULong lightIndex)
 Returns a light.
gzVoid addClipPlane (gzClip *clip)
 Adds a clip plane to the environment.
gzVoid removeClipPlane (gzClip *clip)
 Removes the clip plane from the environment.
gzULong getNumberOfClipPlanes ()
 Returns the number of clip planes added to the environment.
gzClipgetClipPlane (gzULong clipIndex)
 Returns a clip plane.
gzVoid useFog (gzBool enable)
 Specifies if fog are used.
gzVoid setFogMode (gzFogMode mode)
 Sets the fog mode.
gzVoid setFogColor (const gzRGBA &color)
 Sets the color for the fog.
gzVoid setFogDensity (gzFloat density)
 Sets the density for the fog.
gzVoid setFogStart (gzFloat start)
 Sets the start for the fog.
gzVoid setFogEnd (gzFloat end)
 Sets the end for the fog.

Static Public Member Functions

static gzVoid resetLightStateIndex (gzContext *context)
static gzVoid invalidateActiveLightState (gzContext *context)
static gzVoid activateLightStateIndex (gzContext *context, gzULong index)
static gzVoid setMainLightState (gzContext *context)
static gzVoid resetClipStateIndex (gzContext *context)
static gzVoid activateClipStateIndex (gzContext *context, gzULong index)
static gzVoid resetFogStateIndex (gzContext *context)
static gzVoid activateFogStateIndex (gzContext *context, gzULong index)
static gzVoid setLightModel (gzContext *context)
 Applies the context lighting model on the environment.
static gzVoid setTwoSideLighting (gzContext *context, gzBool on)
 Activates/ deactivates two side lighting.
static gzVoid setLocalViewer (gzContext *context, gzBool on)
static gzVoid setGlobalAmbientColor (gzContext *context, gzFloat red=0.2f, gzFloat green=0.2f, gzFloat blue=0.2f, gzFloat alpha=1.0f)
 Sets the ambient color for the global environment.

Detailed Description

The gzEnvironment class is used when you want to add environmental effects to a scene.

It is possible to add light or create fog to get a more realistic environment.

Examples:

cube.cpp, dbviewer.cpp, lod.cpp, materialDemo.cpp, mirror.cpp, shaders.cpp, skybox.cpp, and tree.cpp.

Definition at line 97 of file gzEnvironment.h.


Constructor & Destructor Documentation

gzEnvironment::gzEnvironment const gzString name = GZ_EMPTY_STRING  )  [inline]
 

Constructor.

Parameters:
name specifies a name for the gzEnvironment.

Definition at line 104 of file gzEnvironment.h.

virtual gzEnvironment::~gzEnvironment  )  [inline, virtual]
 

Destructor.

Definition at line 107 of file gzEnvironment.h.


Member Function Documentation

static gzVoid gzEnvironment::activateClipStateIndex gzContext context,
gzULong  index
[static]
 

static gzVoid gzEnvironment::activateFogStateIndex gzContext context,
gzULong  index
[static]
 

static gzVoid gzEnvironment::activateLightStateIndex gzContext context,
gzULong  index
[static]
 

gzVoid gzEnvironment::addClipPlane gzClip clip  ) 
 

Adds a clip plane to the environment.

Parameters:
clip is the clip plane that shall be added to the environment.
Examples:
mirror.cpp.

gzVoid gzEnvironment::addLight gzLight light  ) 
 

Adds a light to the environment.

It is possible to add several light sources to the same environment. These light sources will light all nodes which are below the environment node in the scene graph.

Parameters:
light specifies the light that shall be added to the environment.
Examples:
cube.cpp, dbviewer.cpp, mirror.cpp, shaders.cpp, and tree.cpp.

virtual gzReference* gzEnvironment::clone  )  const [virtual]
 

Clone interface.

Reimplemented from gzGroup.

gzClip* gzEnvironment::getClipPlane gzULong  clipIndex  ) 
 

Returns a clip plane.

Parameters:
clipIndex is the index for the clip plane that shall be returned.

gzLight* gzEnvironment::getLight gzULong  lightIndex  ) 
 

Returns a light.

Parameters:
lightIndex specifies the index of the light that shall be returned.

gzULong gzEnvironment::getNumberOfClipPlanes  ) 
 

Returns the number of clip planes added to the environment.

gzULong gzEnvironment::getNumberOfLights  ) 
 

Returns the number of lights connected to the scene.

gzEnvironment::GZ_DECLARE_TYPE_INTERFACE_EXPORT  ) 
 

Reimplemented from gzGroup.

static gzVoid gzEnvironment::invalidateActiveLightState gzContext context  )  [static]
 

virtual gzVoid gzEnvironment::postTraverseAction gzTraverseAction actionclass,
gzContext context
[virtual]
 

Called in the traversal process.

Reimplemented from gzNode.

virtual gzVoid gzEnvironment::preTraverseAction gzTraverseAction actionclass,
gzContext context
[virtual]
 

Called in the traversal process.

Reimplemented from gzNode.

gzVoid gzEnvironment::removeClipPlane gzClip clip  ) 
 

Removes the clip plane from the environment.

Parameters:
clip is the clip plane that shall be removed from the environment.

gzVoid gzEnvironment::removeLight gzLight light  ) 
 

Removes the light from the scene graph.

Parameters:
light is the light that shall be removed from the environment.

static gzVoid gzEnvironment::resetClipStateIndex gzContext context  )  [static]
 

static gzVoid gzEnvironment::resetFogStateIndex gzContext context  )  [static]
 

static gzVoid gzEnvironment::resetLightStateIndex gzContext context  )  [static]
 

gzVoid gzEnvironment::setFogColor const gzRGBA color  ) 
 

Sets the color for the fog.

Examples:
dbviewer.cpp, and skybox.cpp.

gzVoid gzEnvironment::setFogDensity gzFloat  density  ) 
 

Sets the density for the fog.

Examples:
dbviewer.cpp, and skybox.cpp.

gzVoid gzEnvironment::setFogEnd gzFloat  end  ) 
 

Sets the end for the fog.

Examples:
dbviewer.cpp, and skybox.cpp.

gzVoid gzEnvironment::setFogMode gzFogMode  mode  ) 
 

Sets the fog mode.

Parameters:
mode specifies the fog mode that shall be used.
See also:
gzFogMode
Examples:
dbviewer.cpp, and skybox.cpp.

gzVoid gzEnvironment::setFogStart gzFloat  start  ) 
 

Sets the start for the fog.

Examples:
dbviewer.cpp, and skybox.cpp.

static gzVoid gzEnvironment::setGlobalAmbientColor gzContext context,
gzFloat  red = 0.2f,
gzFloat  green = 0.2f,
gzFloat  blue = 0.2f,
gzFloat  alpha = 1.0f
[static]
 

Sets the ambient color for the global environment.

static gzVoid gzEnvironment::setLightModel gzContext context  )  [static]
 

Applies the context lighting model on the environment.

static gzVoid gzEnvironment::setLocalViewer gzContext context,
gzBool  on
[static]
 

Examples:
dbviewer.cpp, and shaders.cpp.

static gzVoid gzEnvironment::setMainLightState gzContext context  )  [static]
 

static gzVoid gzEnvironment::setTwoSideLighting gzContext context,
gzBool  on
[static]
 

Activates/ deactivates two side lighting.

Examples:
cube.cpp, dbviewer.cpp, shaders.cpp, and tree.cpp.

gzVoid gzEnvironment::useFog gzBool  enable  ) 
 

Specifies if fog are used.

Parameters:
enable is true if fog shall be used and false if no fog shall be used.
Initially fog is disabled
Examples:
dbviewer.cpp.


The documentation for this class was generated from the following file:
Documentation for Gizmo3D generated at Wed Feb 20 11:54:17 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond