CloudyDay
 All Classes Functions Variables Enumerations
Public Member Functions | Protected Member Functions
osgCloudyDay::PerlinNoiseCloud Class Reference

#include <PerlinNoiseCloud.h>

Inheritance diagram for osgCloudyDay::PerlinNoiseCloud:
osgCloudyDay::Cloud2D

List of all members.

Public Member Functions

 PerlinNoiseCloud (void)
 ~PerlinNoiseCloud (void)
void Initialize ()
virtual void SetupGeometry (osg::Vec3 position, osg::Vec2 size, osg::Vec3Array *vertices, osg::Vec2Array *tcoords, osg::UIntArray *indices)
- Public Member Functions inherited from osgCloudyDay::Cloud2D
 Cloud2D ()
 ~Cloud2D ()
void Cloud2D::SetGeometry ()
void Cloud2D::SetGeometry (osg::Vec3 position, osg::Vec2 size)
void Cloud2D::Create (osg::Geode *geode, osg::Image *perlinImg)
void Create (osg::Geode *geode, osg::Image *perlinImg, osg::Image *perlinNormalImg)
void Create (osg::Geode *geode, osg::Image *perlinImg, osg::Image *perlinNormalImg, osg::Image *perlinHeightImg)
osg::Image * CreateNormalMap (osg::Image *img)

Protected Member Functions

void CreatePerlinTexture2D (int width, int height, osg::Image *color, osg::Image *normal)
void SetNoise (float *map)
float Noise (int x, int y)
float SmoothedNoise (float x, float y)
float Cosine_Interpolate (float a, float b, float x)
float InterpolatedNoise (float x, float y)
float PerlinNoise (float x, float y)

Additional Inherited Members

- Public Attributes inherited from osgCloudyDay::Cloud2D
osg::Geometry * geom
osg::Geode * geode
osg::Node * terrain_obj
bool m_tesselation
- Protected Attributes inherited from osgCloudyDay::Cloud2D
osg::Vec3Array * coords
osg::Vec2Array * tcoords
osg::UIntArray * indices

Detailed Description

Class to create a 2D cloud with a Perlin noise cloud Results in a altcumolus cloud


Constructor & Destructor Documentation

osgCloudyDay::PerlinNoiseCloud::PerlinNoiseCloud ( void  )

Constructor

osgCloudyDay::PerlinNoiseCloud::~PerlinNoiseCloud ( void  )

Deconstructor


Member Function Documentation

float osgCloudyDay::PerlinNoiseCloud::Cosine_Interpolate ( float  a,
float  b,
float  x 
)
protected

Returns the cosine interpolated noise value at a specific coordinate

Parameters:
xx-coordinate
yy-coordinate
xvalue
Returns:
smoothed noise value
void osgCloudyDay::PerlinNoiseCloud::CreatePerlinTexture2D ( int  width,
int  height,
osg::Image *  color,
osg::Image *  normal 
)
protected

Method to create a 2D Perlin noise texture

Parameters:
widthwidth of the texture
heightheight of the texture
colorcolor texture
normalnormal texture
void osgCloudyDay::PerlinNoiseCloud::Initialize ( )

Initialize method

float osgCloudyDay::PerlinNoiseCloud::InterpolatedNoise ( float  x,
float  y 
)
protected

Returns the interpolated noise value at a specific coordinate

Parameters:
xx-coordinate
yy-coordinate
Returns:
interpolated noise value
float osgCloudyDay::PerlinNoiseCloud::Noise ( int  x,
int  y 
)
protected

Returns noise value at a specific coordinate

Parameters:
xx-coordinate
yy-coordinate
Returns:
noise value
float osgCloudyDay::PerlinNoiseCloud::PerlinNoise ( float  x,
float  y 
)
protected

Returns the perlin noise value at a specific coordinate

Parameters:
xx-coordinate
yy-coordinate
Returns:
Perlin noise value
void osgCloudyDay::PerlinNoiseCloud::SetNoise ( float *  map)
protected

Sets the noise values

Parameters:
mapnoise values
void osgCloudyDay::PerlinNoiseCloud::SetupGeometry ( osg::Vec3  position,
osg::Vec2  size,
osg::Vec3Array *  vertices,
osg::Vec2Array *  tcoords,
osg::UIntArray *  indices 
)
virtual

Creates the Perlin noise cloud for rendering

Parameters:
positionposition of the 2d cloud
sizesize of the 2d cloud
verticesvertices of the 2D cloud
tcoordstexture coordinates of the 2D cloud
indicesindices of the 2D cloud

Implements osgCloudyDay::Cloud2D.

float osgCloudyDay::PerlinNoiseCloud::SmoothedNoise ( float  x,
float  y 
)
protected

Returns smoothed noise value at a specific coordinate

Parameters:
xx-coordinate
yy-coordinate
Returns:
smoothed noise value

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