Pyrogenesis trunk
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
CTerrain Class Reference

#include <Terrain.h>

Collaboration diagram for CTerrain:
Collaboration graph
[legend]

Public Member Functions

 CTerrain ()
 
 ~CTerrain ()
 
bool Initialize (ssize_t patchesPerSide, const u16 *ptr)
 
ssize_t GetVerticesPerSide () const
 
ssize_t GetTilesPerSide () const
 
ssize_t GetPatchesPerSide () const
 
float GetMinX () const
 
float GetMinZ () const
 
float GetMaxX () const
 
float GetMaxZ () const
 
bool IsOnMap (float x, float z) const
 
float GetVertexGroundLevel (ssize_t i, ssize_t j) const
 
fixed GetVertexGroundLevelFixed (ssize_t i, ssize_t j) const
 
float GetExactGroundLevel (float x, float z) const
 
fixed GetExactGroundLevelFixed (fixed x, fixed z) const
 
float GetFilteredGroundLevel (float x, float z, float radius) const
 
fixed GetSlopeFixed (ssize_t i, ssize_t j) const
 
fixed GetExactSlopeFixed (fixed x, fixed z) const
 
bool GetTriangulationDir (ssize_t i, ssize_t j) const
 
void ResizeAndOffset (ssize_t size, ssize_t horizontalOffset=0, ssize_t verticalOffset=0)
 
void SetHeightMap (u16 *heightmap)
 
u16GetHeightMap () const
 
CPatchGetPatch (ssize_t i, ssize_t j) const
 
CMiniPatchGetTile (ssize_t i, ssize_t j) const
 
void CalcPosition (ssize_t i, ssize_t j, CVector3D &pos) const
 
void CalcPositionFixed (ssize_t i, ssize_t j, CFixedVector3D &pos) const
 
void CalcNormal (ssize_t i, ssize_t j, CVector3D &normal) const
 
void CalcNormalFixed (ssize_t i, ssize_t j, CFixedVector3D &normal) const
 
CVector3D CalcExactNormal (float x, float z) const
 
void MakeDirty (ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1, int dirtyFlags)
 
void MakeDirty (int dirtyFlags)
 
CBoundingBoxAligned GetVertexesBound (ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1)
 Returns a 3D bounding box encompassing the given vertex range (inclusive) More...
 
SColor4ub GetBaseColor () const
 
void SetBaseColor (SColor4ub color)
 
const CHeightMipmapGetHeightMipmap () const
 

Static Public Member Functions

static void CalcFromPosition (const CVector3D &pos, ssize_t &i, ssize_t &j)
 
static void CalcFromPosition (float x, float z, ssize_t &i, ssize_t &j)
 

Private Member Functions

void ReleaseData ()
 
void InitialisePatches ()
 

Private Attributes

ssize_t m_MapSize
 
ssize_t m_MapSizePatches
 
CPatchm_Patches
 
u16m_Heightmap
 
SColor4ub m_BaseColor
 
CHeightMipmap m_HeightMipmap
 

Constructor & Destructor Documentation

◆ CTerrain()

CTerrain::CTerrain ( )

◆ ~CTerrain()

CTerrain::~CTerrain ( )

Member Function Documentation

◆ CalcExactNormal()

CVector3D CTerrain::CalcExactNormal ( float  x,
float  z 
) const

◆ CalcFromPosition() [1/2]

static void CTerrain::CalcFromPosition ( const CVector3D pos,
ssize_t i,
ssize_t j 
)
inlinestatic

◆ CalcFromPosition() [2/2]

static void CTerrain::CalcFromPosition ( float  x,
float  z,
ssize_t i,
ssize_t j 
)
inlinestatic

◆ CalcNormal()

void CTerrain::CalcNormal ( ssize_t  i,
ssize_t  j,
CVector3D normal 
) const

◆ CalcNormalFixed()

void CTerrain::CalcNormalFixed ( ssize_t  i,
ssize_t  j,
CFixedVector3D normal 
) const

◆ CalcPosition()

void CTerrain::CalcPosition ( ssize_t  i,
ssize_t  j,
CVector3D pos 
) const

◆ CalcPositionFixed()

void CTerrain::CalcPositionFixed ( ssize_t  i,
ssize_t  j,
CFixedVector3D pos 
) const

◆ GetBaseColor()

SColor4ub CTerrain::GetBaseColor ( ) const
inline

◆ GetExactGroundLevel()

float CTerrain::GetExactGroundLevel ( float  x,
float  z 
) const

◆ GetExactGroundLevelFixed()

fixed CTerrain::GetExactGroundLevelFixed ( fixed  x,
fixed  z 
) const

◆ GetExactSlopeFixed()

fixed CTerrain::GetExactSlopeFixed ( fixed  x,
fixed  z 
) const

◆ GetFilteredGroundLevel()

float CTerrain::GetFilteredGroundLevel ( float  x,
float  z,
float  radius 
) const

◆ GetHeightMap()

u16 * CTerrain::GetHeightMap ( ) const
inline

◆ GetHeightMipmap()

const CHeightMipmap & CTerrain::GetHeightMipmap ( ) const
inline

◆ GetMaxX()

float CTerrain::GetMaxX ( ) const
inline

◆ GetMaxZ()

float CTerrain::GetMaxZ ( ) const
inline

◆ GetMinX()

float CTerrain::GetMinX ( ) const
inline

◆ GetMinZ()

float CTerrain::GetMinZ ( ) const
inline

◆ GetPatch()

CPatch * CTerrain::GetPatch ( ssize_t  i,
ssize_t  j 
) const

◆ GetPatchesPerSide()

ssize_t CTerrain::GetPatchesPerSide ( ) const
inline

◆ GetSlopeFixed()

fixed CTerrain::GetSlopeFixed ( ssize_t  i,
ssize_t  j 
) const

◆ GetTile()

CMiniPatch * CTerrain::GetTile ( ssize_t  i,
ssize_t  j 
) const

◆ GetTilesPerSide()

ssize_t CTerrain::GetTilesPerSide ( ) const
inline

◆ GetTriangulationDir()

bool CTerrain::GetTriangulationDir ( ssize_t  i,
ssize_t  j 
) const

◆ GetVertexesBound()

CBoundingBoxAligned CTerrain::GetVertexesBound ( ssize_t  i0,
ssize_t  j0,
ssize_t  i1,
ssize_t  j1 
)

Returns a 3D bounding box encompassing the given vertex range (inclusive)

◆ GetVertexGroundLevel()

float CTerrain::GetVertexGroundLevel ( ssize_t  i,
ssize_t  j 
) const

◆ GetVertexGroundLevelFixed()

fixed CTerrain::GetVertexGroundLevelFixed ( ssize_t  i,
ssize_t  j 
) const

◆ GetVerticesPerSide()

ssize_t CTerrain::GetVerticesPerSide ( ) const
inline

◆ InitialisePatches()

void CTerrain::InitialisePatches ( )
private

◆ Initialize()

bool CTerrain::Initialize ( ssize_t  patchesPerSide,
const u16 ptr 
)

◆ IsOnMap()

bool CTerrain::IsOnMap ( float  x,
float  z 
) const
inline

◆ MakeDirty() [1/2]

void CTerrain::MakeDirty ( int  dirtyFlags)

◆ MakeDirty() [2/2]

void CTerrain::MakeDirty ( ssize_t  i0,
ssize_t  j0,
ssize_t  i1,
ssize_t  j1,
int  dirtyFlags 
)

◆ ReleaseData()

void CTerrain::ReleaseData ( )
private

◆ ResizeAndOffset()

void CTerrain::ResizeAndOffset ( ssize_t  size,
ssize_t  horizontalOffset = 0,
ssize_t  verticalOffset = 0 
)

◆ SetBaseColor()

void CTerrain::SetBaseColor ( SColor4ub  color)
inline

◆ SetHeightMap()

void CTerrain::SetHeightMap ( u16 heightmap)

Member Data Documentation

◆ m_BaseColor

SColor4ub CTerrain::m_BaseColor
private

◆ m_Heightmap

u16* CTerrain::m_Heightmap
private

◆ m_HeightMipmap

CHeightMipmap CTerrain::m_HeightMipmap
private

◆ m_MapSize

ssize_t CTerrain::m_MapSize
private

◆ m_MapSizePatches

ssize_t CTerrain::m_MapSizePatches
private

◆ m_Patches

CPatch* CTerrain::m_Patches
private

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