deHeightTerrainSector Class Reference

Height Terrain Sector. More...

#include <deHeightTerrainSector.h>

List of all members.

Public Member Functions

Constructors and Destructors
 deHeightTerrainSector (const decPoint &sector, const decPoint &pointCount)
 Creates a new sector.
 ~deHeightTerrainSector ()
 Cleans up the sector.
Management
const decPointGetSector () const
 Retrieves the sector coordinates.
float GetBaseHeight () const
 Retrieves the base height.
void SetBaseHeight (float height)
 Sets the base height.
float GetHeightScaling () const
 Retrieves the height scaling.
void SetHeightScaling (float scaling)
 Sets the height scaling.
deImageGetHeightImage () const
 Retrieves the height image or NULL if not set.
void SetHeightImage (deImage *heightImage)
 Sets the height image or NULL if not set.
void CalculateHeightExtends (float &minHeight, float &maxHeight)
 Calculates the height extends.
Face Visibility
bool GetFaceVisibleAt (int x, int y)
 Determines if the face with the given upper left coordinate is visible.
void SetFaceVisibleAt (int x, int y, bool visible)
 Sets if the face at the given upper left coordinate is visible.
void SetAllFacesVisible (bool visible)
 Sets the visibility for all faces.
Textures
int GetTextureCount () const
 Retrieves the count of textures.
deHeightTerrainTextureGetTextureAt (int index) const
 Retrieves the texture at the given index.
int IndexOfTexture (deHeightTerrainTexture *texture) const
 Retrieves the index of the texture or -1 if not found.
bool HasTexture (deHeightTerrainTexture *texture) const
 Determines if the texture exists.
void AddTexture (deHeightTerrainTexture *texture)
 Adds a texture.
void RemoveTexture (deHeightTerrainTexture *texture)
 Removes a texture.
void RemoveAllTextures ()
 Removes all textures.

Detailed Description

Height Terrain Sector.

Defines a sector of a height terrain. The height of grid points in each sector are defined using a height image and an offset and scaling. In addition a prop field can be maintained. As height image only 1-component images can be used. Any bit depth is possible allowing for fine grained resolution if required. The optional scaling and offset parameter alter the height retrieved from the height map before being applied to grid points. Individual grid faces can be hidden. If the height image is missing all grid points take on the height of the offset parameter.

Author:
Plüss Roland
Version:
1.0
Date:
2009

Constructor & Destructor Documentation

deHeightTerrainSector::deHeightTerrainSector ( const decPoint sector,
const decPoint pointCount 
)

Creates a new sector.

deHeightTerrainSector::~deHeightTerrainSector (  )

Cleans up the sector.


Member Function Documentation

void deHeightTerrainSector::AddTexture ( deHeightTerrainTexture texture )

Adds a texture.

void deHeightTerrainSector::CalculateHeightExtends ( float &  minHeight,
float &  maxHeight 
)

Calculates the height extends.

The extends contain the base height and scaling has been taken into account.

float deHeightTerrainSector::GetBaseHeight (  ) const [inline]

Retrieves the base height.

bool deHeightTerrainSector::GetFaceVisibleAt ( int  x,
int  y 
)

Determines if the face with the given upper left coordinate is visible.

deImage* deHeightTerrainSector::GetHeightImage (  ) const [inline]

Retrieves the height image or NULL if not set.

float deHeightTerrainSector::GetHeightScaling (  ) const [inline]

Retrieves the height scaling.

const decPoint& deHeightTerrainSector::GetSector (  ) const [inline]

Retrieves the sector coordinates.

deHeightTerrainTexture* deHeightTerrainSector::GetTextureAt ( int  index ) const

Retrieves the texture at the given index.

int deHeightTerrainSector::GetTextureCount (  ) const [inline]

Retrieves the count of textures.

bool deHeightTerrainSector::HasTexture ( deHeightTerrainTexture texture ) const

Determines if the texture exists.

int deHeightTerrainSector::IndexOfTexture ( deHeightTerrainTexture texture ) const

Retrieves the index of the texture or -1 if not found.

void deHeightTerrainSector::RemoveAllTextures (  )

Removes all textures.

void deHeightTerrainSector::RemoveTexture ( deHeightTerrainTexture texture )

Removes a texture.

void deHeightTerrainSector::SetAllFacesVisible ( bool  visible )

Sets the visibility for all faces.

void deHeightTerrainSector::SetBaseHeight ( float  height )

Sets the base height.

void deHeightTerrainSector::SetFaceVisibleAt ( int  x,
int  y,
bool  visible 
)

Sets if the face at the given upper left coordinate is visible.

void deHeightTerrainSector::SetHeightImage ( deImage heightImage )

Sets the height image or NULL if not set.

void deHeightTerrainSector::SetHeightScaling ( float  scaling )

Sets the height scaling.


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