SGCloudLayer Class Reference

A class layer to model a single cloud layer. More...

#include <cloud.hxx>

List of all members.

Public Types

enum  Coverage
 This is the list of available cloud coverages/textures.

Public Member Functions

 SGCloudLayer (const string &tex_path)
 Constructor.
 ~SGCloudLayer (void)
 Destructor.
float getSpan_m () const
 get the cloud span (in meters)
void setSpan_m (float span_m)
 set the cloud span
float getElevation_m () const
 get the layer elevation (in meters)
void setElevation_m (float elevation_m, bool set_span=true)
 set the layer elevation.
float getThickness_m () const
 get the layer thickness
void setThickness_m (float thickness_m)
 set the layer thickness.
float getTransition_m () const
 get the transition/boundary layer depth in meters.
void setTransition_m (float transition_m)
 set the transition layer size in meters
Coverage getCoverage () const
 get coverage type
void setCoverage (Coverage coverage)
 set coverage type
void setDirection (float dir)
 set the cloud movement direction
float getDirection ()
 get the cloud movement direction
void setSpeed (float sp)
 set the cloud movement speed
float getSpeed ()
 get the cloud movement speed
void setAlpha (float alpha)
 set the alpha component of the cloud base color.
void rebuild ()
 build the cloud object
bool repaint (sgVec3 fog_color)
 repaint the cloud colors based on the specified fog_color
bool reposition (sgVec3 p, sgVec3 up, double lon, double lat, double alt, double dt=0.0)
 reposition the cloud layer at the specified origin and orientation.
void draw (bool top, float *sun_color)
 draw the cloud layer
SGCloudFieldget_layer3D (void)
 return the 3D layer cloud associated with this 2D layer

Static Public Attributes

static bool enable_bump_mapping


Detailed Description

A class layer to model a single cloud layer.

Definition at line 47 of file cloud.hxx.


Constructor & Destructor Documentation

SGCloudLayer::SGCloudLayer ( const string &  tex_path  ) 

Constructor.

Parameters:
tex_path the path to the set of cloud textures

Definition at line 205 of file cloud.cxx.

References ssgBranch::addKid(), and rebuild().


Member Function Documentation

void SGCloudLayer::setSpan_m ( float  span_m  ) 

set the cloud span

Parameters:
span_m the cloud span in meters

Definition at line 251 of file cloud.cxx.

References rebuild().

Referenced by setElevation_m().

void SGCloudLayer::setElevation_m ( float  elevation_m,
bool  set_span = true 
)

set the layer elevation.

Note that this specifies the bottom of the cloud layer. The elevation of the top of the layer is elevation_m + thickness_m.

Parameters:
elevation_m the layer elevation in meters
set_span defines whether it is allowed to adjust the span

Definition at line 266 of file cloud.cxx.

References setSpan_m().

void SGCloudLayer::setThickness_m ( float  thickness_m  ) 

set the layer thickness.

Parameters:
thickness_m the layer thickness in meters.

Definition at line 285 of file cloud.cxx.

float SGCloudLayer::getTransition_m (  )  const

get the transition/boundary layer depth in meters.

This allows gradual entry/exit from the cloud layer via adjusting visibility.

Definition at line 291 of file cloud.cxx.

void SGCloudLayer::setTransition_m ( float  transition_m  ) 

set the transition layer size in meters

Parameters:
transition_m the transition layer size in meters

Definition at line 297 of file cloud.cxx.

void SGCloudLayer::setCoverage ( Coverage  coverage  ) 

set coverage type

Parameters:
coverage the coverage type

Definition at line 309 of file cloud.cxx.

References rebuild().

void SGCloudLayer::setDirection ( float  dir  )  [inline]

set the cloud movement direction

Parameters:
dir the cloud movement direction

Definition at line 127 of file cloud.hxx.

void SGCloudLayer::setSpeed ( float  sp  )  [inline]

set the cloud movement speed

Parameters:
sp the cloud movement speed

Definition at line 139 of file cloud.hxx.

void SGCloudLayer::setAlpha ( float  alpha  )  [inline]

set the alpha component of the cloud base color.

Normally this should be 1.0, but you can set it anywhere in the range of 0.0 to 1.0 to fade a cloud layer in or out.

Parameters:
alpha cloud alpha value (0.0 to 1.0)

Definition at line 153 of file cloud.hxx.

bool SGCloudLayer::repaint ( sgVec3  fog_color  ) 

repaint the cloud colors based on the specified fog_color

Parameters:
fog_color the fog color

Definition at line 610 of file cloud.cxx.

References enable_bump_mapping, and ssgColourArray::get().

Referenced by rebuild().

bool SGCloudLayer::reposition ( sgVec3  p,
sgVec3  up,
double  lon,
double  lat,
double  alt,
double  dt = 0.0 
)

reposition the cloud layer at the specified origin and orientation.

Parameters:
p position vector
up the local up vector
lon specifies a rotation about the Z axis
lat specifies a rotation about the new Y axis
spin specifies a rotation about the new Z axis (and orients the sunrise/set effects)
dt the time elapsed since the last call

Definition at line 654 of file cloud.cxx.

References enable_bump_mapping, ssgTexCoordArray::get(), SGCloudField::reposition(), ssgTransform::setTransform(), and SG_LOG.


The documentation for this class was generated from the following files:
Generated on Mon Dec 17 09:30:57 2007 for SimGear by  doxygen 1.5.1