22#ifndef INCLUDED_TERRAIN
23#define INCLUDED_TERRAIN
const float HEIGHT_SCALE
metres per u16 height unit
Definition: Terrain.h:46
const ssize_t HEIGHT_UNITS_PER_METRE
number of u16 height units per metre
Definition: Terrain.h:43
const ssize_t TERRAIN_TILE_SIZE
metres [world space units] per tile in x and z
Definition: Terrain.h:40
Definition: BoundingBoxAligned.h:34
Definition: FixedVector3D.h:25
A simple fixed-point number class.
Definition: Fixed.h:120
Definition: HeightMipmap.h:42
Definition: MiniPatch.h:29
ssize_t GetPatchesPerSide() const
Definition: Terrain.h:69
fixed GetExactSlopeFixed(fixed x, fixed z) const
Definition: Terrain.cpp:326
float GetMinX() const
Definition: Terrain.h:71
static void CalcFromPosition(const CVector3D &pos, ssize_t &i, ssize_t &j)
Definition: Terrain.h:119
void SetHeightMap(u16 *heightmap)
Definition: Terrain.cpp:734
void CalcNormal(ssize_t i, ssize_t j, CVector3D &normal) const
Definition: Terrain.cpp:128
SColor4ub m_BaseColor
Definition: Terrain.h:176
CPatch * m_Patches
Definition: Terrain.h:172
float GetMaxZ() const
Definition: Terrain.h:74
void SetBaseColor(SColor4ub color)
Definition: Terrain.h:157
ssize_t GetTilesPerSide() const
Definition: Terrain.h:67
void CalcPosition(ssize_t i, ssize_t j, CVector3D &pos) const
Definition: Terrain.cpp:102
float GetMinZ() const
Definition: Terrain.h:72
CMiniPatch * GetTile(ssize_t i, ssize_t j) const
Definition: Terrain.cpp:282
static void CalcFromPosition(float x, float z, ssize_t &i, ssize_t &j)
Definition: Terrain.h:125
ssize_t GetVerticesPerSide() const
Definition: Terrain.h:65
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)
Definition: Terrain.cpp:804
ssize_t m_MapSizePatches
Definition: Terrain.h:170
bool GetTriangulationDir(ssize_t i, ssize_t j) const
Definition: Terrain.cpp:463
CHeightMipmap m_HeightMipmap
Definition: Terrain.h:178
~CTerrain()
Definition: Terrain.cpp:45
fixed GetSlopeFixed(ssize_t i, ssize_t j) const
Definition: Terrain.cpp:307
u16 * GetHeightMap() const
Definition: Terrain.h:106
u16 * m_Heightmap
Definition: Terrain.h:174
ssize_t m_MapSize
Definition: Terrain.h:168
void InitialisePatches()
Definition: Terrain.cpp:719
void CalcNormalFixed(ssize_t i, ssize_t j, CFixedVector3D &normal) const
Definition: Terrain.cpp:175
void ResizeAndOffset(ssize_t size, ssize_t horizontalOffset=0, ssize_t verticalOffset=0)
Definition: Terrain.cpp:482
CTerrain()
Definition: Terrain.cpp:37
fixed GetVertexGroundLevelFixed(ssize_t i, ssize_t j) const
Definition: Terrain.cpp:299
SColor4ub GetBaseColor() const
Definition: Terrain.h:155
bool IsOnMap(float x, float z) const
Definition: Terrain.h:76
void MakeDirty(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1, int dirtyFlags)
Definition: Terrain.cpp:757
void CalcPositionFixed(ssize_t i, ssize_t j, CFixedVector3D &pos) const
Definition: Terrain.cpp:114
float GetVertexGroundLevel(ssize_t i, ssize_t j) const
Definition: Terrain.cpp:292
float GetMaxX() const
Definition: Terrain.h:73
CVector3D CalcExactNormal(float x, float z) const
Definition: Terrain.cpp:219
CPatch * GetPatch(ssize_t i, ssize_t j) const
Definition: Terrain.cpp:267
bool Initialize(ssize_t patchesPerSide, const u16 *ptr)
Definition: Terrain.cpp:65
void ReleaseData()
Definition: Terrain.cpp:53
const CHeightMipmap & GetHeightMipmap() const
Definition: Terrain.h:159
float GetExactGroundLevel(float x, float z) const
Definition: Terrain.cpp:389
fixed GetExactGroundLevelFixed(fixed x, fixed z) const
Definition: Terrain.cpp:434
float GetFilteredGroundLevel(float x, float z, float radius) const
Definition: Terrain.cpp:378
Definition: Vector3D.h:31
float Z
Definition: Vector3D.h:33
float X
Definition: Vector3D.h:33
uint16_t u16
Definition: types.h:38
intptr_t ssize_t
Definition: wposix_types.h:82