TerrainFile
Engine/source/terrain/terrFile.h
Public Types
Constants { FILE_VERSION = 7 }
Public Friends
class
Protected Attributes
The full path and name of the TerrainFile.
The file version.
Vector< TerrainSquare * >
The grid map layers used to accelerate collision queries for the height map data.
The memory pool used by the grid map layers.
The fixed point height map.
MaterialList used to map terrain materials to material instances for the sake of collision (physics, etc.).
Vector< TerrainMaterial * >
The materials used to render the terrain.
bool
The dirty flag.
Protected Functions
_load(FileStream & stream)
The internal loading function.
_loadLegacy(FileStream & stream)
The legacy file loading code.
_resolveMaterials(const Vector< String > & materials)
Used to populate the materail vector by finding the TerrainMaterial objects by name.
Public Functions
findSquare(U32 level, U32 x, U32 y)
getHeightAddress(U32 x, U32 y)
Returns the constant heightmap vector.
getLayerIndex(U32 x, U32 y)
getMaterialMapping(U32 index)
bool
isPointInTerrain(U32 x, U32 y)
Check if the given point is valid within the (non-tiled) terrain file.
setHeightMap(const Vector< U16 > & heightmap, bool updateCollision)
Sets a new heightmap state.
setLayerIndex(U32 x, U32 y, U8 index)
Public Static Functions
Detailed Description
Public Types
Constants
Enumerator
- FILE_VERSION = 7
Public Friends
Protected Attributes
Torque::Path mFilePath
The full path and name of the TerrainFile.
U32 mFileVersion
The file version.
U32 mGridLevels
Vector< TerrainSquare * > mGridMap
The grid map layers used to accelerate collision queries for the height map data.
Vector< TerrainSquare > mGridMapPool
The memory pool used by the grid map layers.
Vector< U16 > mHeightMap
The fixed point height map.
Vector< U8 > mLayerMap
The layer index at each height map sample.
MaterialList mMaterialInstMapping
MaterialList used to map terrain materials to material instances for the sake of collision (physics, etc.).
Vector< TerrainMaterial * > mMaterials
The materials used to render the terrain.
bool mNeedsResaving
The dirty flag.
U32 mSize
The dimensions of the layer and height maps.
Protected Functions
_buildGridMap()
_initMaterialInstMapping()
_load(FileStream & stream)
The internal loading function.
_loadLegacy(FileStream & stream)
The legacy file loading code.
_resolveMaterials(const Vector< String > & materials)
Used to populate the materail vector by finding the TerrainMaterial objects by name.
Public Functions
TerrainFile()
~TerrainFile()
findSquare(U32 level, U32 x, U32 y)
getHeight(U32 x, U32 y)
getHeightAddress(U32 x, U32 y)
getHeightMap()
Returns the constant heightmap vector.
getLayerIndex(U32 x, U32 y)
getMaterialMapping(U32 index)
getMaterialName(U32 x, U32 y)
getMaxHeight()
import(const GBitmap & heightMap, F32 heightScale, const Vector< U8 > & layerMap, const Vector< String > & materials, bool flipYAxis)
isEmptyAt(U32 x, U32 y)
isPointInTerrain(U32 x, U32 y)
Check if the given point is valid within the (non-tiled) terrain file.
save(const char * filename)
setHeight(U32 x, U32 y, U16 height)
setHeightMap(const Vector< U16 > & heightmap, bool updateCollision)
Sets a new heightmap state.
setLayerIndex(U32 x, U32 y, U8 index)
setSize(U32 newResolution, bool clear)
smooth(F32 factor, U32 steps, bool updateCollision)
Performs multiple smoothing steps on the heightmap.
updateGrid(const Point2I & minPt, const Point2I & maxPt)
Updates the terrain grid for the specified area.