Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | Namespace Members | Class Members

Terrain Class Reference

#include <src/Terrain.h>

Inheritance diagram for Terrain:

Inheritance graph
[legend]
Collaboration diagram for Terrain:

Collaboration graph
[legend]
List of all members.

Detailed Description

A Terrain that uses wavelet noise for height field generation.

Author:
Nicolas Brodu


Public Member Functions

 Terrain (double worldSize, double maxHeight, int level, double persistance=0.5, double power=1.0)
virtual double getFloorZ (const double x, const double y)
 Returns the Z coordinate of the floor at the given (x,y) world coordinate.
virtual osg::Vec3d getFloorNormal (const double x, const double y)
 Returns the normal of the floor at the given (x,y) world coordinate.
osg::Group * drawNormals (osg::Group *normalGroup=0)
 Draw the terrain normals.
double getWorldSize () const
double getHalfWorldSize () const
double getMaxHeight () const
const double * getData () const
const osg::Vec3Array * getNormals () const
double getDataArraySize () const
double getNormalsArraySize () const

Protected Member Functions

double wrapDataEdge (int x, int y)

Protected Attributes

double worldSize
double halfWorldSize
double invWorldSize_dsize
double maxHeight
double persistance
double power
int dsize
int dsizep1
int level
int dsizeMask
double * data
osg::Vec3Array * normals
osg::Vec4Array * colorArray


Member Function Documentation

osg::Group * Terrain::drawNormals osg::Group *  normalGroup = 0  ) 
 

Draw the terrain normals.

Parameters:
normalGroup The osg group that will contain the normals representation as lines. Null by default, in which case a new group is created to contain all the normals.
Returns:
The osg group that contains the normals representation as lines

osg::Vec3d Terrain::getFloorNormal const double  x,
const double  y
[virtual]
 

Returns the normal of the floor at the given (x,y) world coordinate.

If outside, propagate the border value

Implements TerrainInterface.

double Terrain::getFloorZ const double  x,
const double  y
[virtual]
 

Returns the Z coordinate of the floor at the given (x,y) world coordinate.

If outside, propagate the border value

Implements TerrainInterface.


The documentation for this class was generated from the following files:
Generated on Mon Mar 28 11:28:04 2005 for Crogai by  doxygen 1.4.1