Drag[en]gine Game Engine  1.0
deHeightTerrainSector Class Reference

Height Terrain Sector. More...

#include <deHeightTerrainSector.h>

Public Member Functions

Constructors and Destructors
 deHeightTerrainSector (const decPoint &sector, const decPoint &pointCount)
 Create sector. More...
 ~deHeightTerrainSector ()
 Clean up sector. More...
const decPointGetSector () const
 Sector coordinates. More...
const decPointGetPointCount () const
 Point count along X and Y direction. More...
float GetBaseHeight () const
 Base height in meters. More...
void SetBaseHeight (float height)
 Set base height in meters. More...
float GetHeightScaling () const
 Height scaling. More...
void SetHeightScaling (float scaling)
 Set height scaling. More...
deImageGetHeightImage () const
 Height image or NULL if not set. More...
void SetHeightImage (deImage *heightImage)
 Set height image or NULL if not set. More...
void CalculateHeightExtends (float &minHeight, float &maxHeight)
 Calculate height extends. More...
Face Visibility
bool GetFaceVisibleAt (int x, int y) const
 Face at coordinate is visible. More...
void SetFaceVisibleAt (int x, int y, bool visible)
 Set if face at coordinate is visible. More...
void SetAllFacesVisible (bool visible)
 Set visibility of all faces. More...
int GetTextureCount () const
 Number of textures. More...
deHeightTerrainTextureGetTextureAt (int index) const
 Texture at index. More...
int IndexOfTexture (deHeightTerrainTexture *texture) const
 Index of texture or -1 if absent. More...
bool HasTexture (deHeightTerrainTexture *texture) const
 Texture is present. More...
void AddTexture (deHeightTerrainTexture *texture)
 Add texture. More...
void RemoveTexture (deHeightTerrainTexture *texture)
 Remove texture. More...
void RemoveAllTextures ()
 Remove all textures. More...

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.

Constructor & Destructor Documentation

◆ deHeightTerrainSector()

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

Create sector.

◆ ~deHeightTerrainSector()

deHeightTerrainSector::~deHeightTerrainSector ( )

Clean up sector.

Member Function Documentation

◆ AddTexture()

void deHeightTerrainSector::AddTexture ( deHeightTerrainTexture texture)

Add texture.

Referenced by GetHeightImage().

◆ CalculateHeightExtends()

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

Calculate height extends.

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

Referenced by GetHeightImage().

◆ GetBaseHeight()

float deHeightTerrainSector::GetBaseHeight ( ) const

Base height in meters.

References SetBaseHeight().

◆ GetFaceVisibleAt()

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

Face at coordinate is visible.

Referenced by GetHeightImage().

◆ GetHeightImage()

◆ GetHeightScaling()

float deHeightTerrainSector::GetHeightScaling ( ) const

Height scaling.

References SetHeightScaling().

◆ GetPointCount()

const decPoint& deHeightTerrainSector::GetPointCount ( ) const

Point count along X and Y direction.

◆ GetSector()

const decPoint& deHeightTerrainSector::GetSector ( ) const

Sector coordinates.

◆ GetTextureAt()

deHeightTerrainTexture* deHeightTerrainSector::GetTextureAt ( int  index) const

Texture at index.

Referenced by GetHeightImage().

◆ GetTextureCount()

int deHeightTerrainSector::GetTextureCount ( ) const

Number of textures.

Referenced by GetHeightImage().

◆ HasTexture()

bool deHeightTerrainSector::HasTexture ( deHeightTerrainTexture texture) const

Texture is present.

Referenced by GetHeightImage().

◆ IndexOfTexture()

int deHeightTerrainSector::IndexOfTexture ( deHeightTerrainTexture texture) const

Index of texture or -1 if absent.

Referenced by GetHeightImage().

◆ RemoveAllTextures()

void deHeightTerrainSector::RemoveAllTextures ( )

Remove all textures.

Referenced by GetHeightImage().

◆ RemoveTexture()

void deHeightTerrainSector::RemoveTexture ( deHeightTerrainTexture texture)

Remove texture.

Referenced by GetHeightImage().

◆ SetAllFacesVisible()

void deHeightTerrainSector::SetAllFacesVisible ( bool  visible)

Set visibility of all faces.

Referenced by GetHeightImage().

◆ SetBaseHeight()

void deHeightTerrainSector::SetBaseHeight ( float  height)

Set base height in meters.

Referenced by GetBaseHeight().

◆ SetFaceVisibleAt()

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

Set if face at coordinate is visible.

Referenced by GetHeightImage().

◆ SetHeightImage()

void deHeightTerrainSector::SetHeightImage ( deImage heightImage)

Set height image or NULL if not set.

Referenced by GetHeightImage().

◆ SetHeightScaling()

void deHeightTerrainSector::SetHeightScaling ( float  scaling)

Set height scaling.

Referenced by GetHeightScaling().

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