|
0 A.D. | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Field Summary | |
private SColor4ub |
m_BaseColour
|
private u16* |
m_Heightmap
|
private u32 |
m_MapSize
|
private u32 |
m_MapSizePatches
|
private CPatch* |
m_Patches
|
Constructor Summary | |
CTerrain()
CTerrain constructor |
|
~CTerrain()
ReleaseData: delete any data allocated by this terrain |
Method Summary | |
static void |
CalcFromPosition( const CVector3D& pos, i32& i, i32& j )
|
static void |
CalcFromPosition( float x, float z, i32& i, i32& j )
|
void |
CalcNormal( u32 i, u32 j, CVector3D& normal ) const
GetPatch: return the patch at (i,j) in patch space, or null if the patch is out of bounds |
void |
CalcPosition( i32 i, i32 j, CVector3D& pos ) const
CalcNormal: calculate the world space normal of the vertex at (i,j) |
void |
ClampCoordToMap( int& index ) const
|
float |
FlattenArea( float x0, float x1, float z0, float z1 )
|
SColor4ub |
GetBaseColour() const
|
float |
GetExactGroundLevel( float x, float z ) const
Resize: resize this terrain to the given size (in patches per side) |
float |
GetExactGroundLevel( const CVector2D& v ) const
|
u16* |
GetHeightMap() const
|
CPatch* |
GetPatch( i32 i, i32 j ) const
GetPatch: return the tile at (i,j) in tile space, or null if the tile is out of bounds |
u32 |
GetPatchesPerSide() const
|
float |
GetSlope( float x, float z ) const
|
CVector2D |
GetSlopeAngleFace( CEntity* entity ) const
|
CMiniPatch* |
GetTile( i32 i, i32 j ) const
|
u32 |
GetTilesPerSide() const
|
float |
GetVertexGroundLevel( int i, int j ) const
|
u32 |
GetVerticesPerSide() const
|
private void |
InitialisePatches()
SetHeightMap: set up a new heightmap from 16-bit source data; assumes heightmap matches current terrain size |
bool |
Initialize( u32 size, const u16* data )
|
bool |
IsOnMap( float x, float z ) const
|
bool |
IsOnMap( const CVector2D& v ) const
|
bool |
IsPassable( const CVector2D& tileSpaceLoc, HEntity entity ) const
CalcPosition: calculate the world space position of the vertex at (i,j) |
void |
MakeDirty( int dirtyFlags )
|
void |
MakeDirty( int i0, int j0, int i1, int j1, int dirtyFlags )
|
private void |
ReleaseData()
Initialise: initialise this terrain to the given size (in patches per side); using given heightmap to setup elevation data |
void |
Resize( u32 size )
InitialisePatches: initialise patch data |
void |
SetBaseColour( SColor4ub colour )
|
void |
SetHeightMap( u16* heightmap )
FlattenArea: flatten out an area of terrain (specified in world space coords); return the average height of the flattened area |
Field Detail |
private SColor4ub m_BaseColour;
private u16* m_Heightmap;
private u32 m_MapSize;
private u32 m_MapSizePatches;
private CPatch* m_Patches;
Constructor Detail |
public CTerrain();
public ~CTerrain();
Method Detail |
public static void CalcFromPosition( const CVector3D& pos, i32& i, i32& j );
public static void CalcFromPosition( float x, float z, i32& i, i32& j );
public void CalcNormal( u32 i, u32 j, CVector3D& normal ) const;
public void CalcPosition( i32 i, i32 j, CVector3D& pos ) const;
public void ClampCoordToMap( int& index ) const;
public float FlattenArea( float x0, float x1, float z0, float z1 );
public SColor4ub GetBaseColour() const;
public float GetExactGroundLevel( float x, float z ) const;
public float GetExactGroundLevel( const CVector2D& v ) const;
public u16* GetHeightMap() const;
public CPatch* GetPatch( i32 i, i32 j ) const;
public u32 GetPatchesPerSide() const;
public float GetSlope( float x, float z ) const;
public CVector2D GetSlopeAngleFace( CEntity* entity ) const;
public CMiniPatch* GetTile( i32 i, i32 j ) const;
public u32 GetTilesPerSide() const;
public float GetVertexGroundLevel( int i, int j ) const;
public u32 GetVerticesPerSide() const;
private void InitialisePatches();
public bool Initialize( u32 size, const u16* data );
public bool IsOnMap( float x, float z ) const;
public bool IsOnMap( const CVector2D& v ) const;
public bool IsPassable( const CVector2D& tileSpaceLoc, HEntity entity ) const;
public void MakeDirty( int dirtyFlags );
public void MakeDirty( int i0, int j0, int i1, int j1, int dirtyFlags );
private void ReleaseData();
public void Resize( u32 size );
public void SetBaseColour( SColor4ub colour );
public void SetHeightMap( u16* heightmap );
|
0 A.D.
Generated on September 04, 2007 at 18:13 CppDoc v2.4.0 |
|||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |