Class MapChunk
A terrain chunk (MCNK), abstract over the client version. Usually obtained from ADT.chunks rather than constructed; the per-version MapChunk* classes are subclasses. Construct a concrete version with MapChunk.for_version(expansion). See https://wowdev.wiki/ADT/v18#MCNK_chunk.
public class MapChunk : IDisposable
- Inheritance
-
MapChunk
- Implements
- Derived
- Inherited Members
Constructors
MapChunk()
public MapChunk()
MapChunk(MapChunk)
Copy-construct: a deep copy of other (the C++ copy constructor).
public MapChunk(MapChunk other)
Parameters
otherMapChunk
Properties
AlphaMaps
One decoded 64x64 (4096-byte) alpha map per layer, aligned with layers (layer 0's is empty); 0 = base texture, 255 = this layer.
public Vector<Vector<byte>> AlphaMaps { get; }
Property Value
DoodadRefs
Doodad references (MCRF doodad part pre-Cata, MCRD Cata+): indices into the tile's MDDF placements drawn in this chunk.
public Vector<uint> DoodadRefs { get; }
Property Value
Header
The chunk header (flags, grid position, area, holes, origin).
public SMChunk Header { get; set; }
Property Value
Heights
The 9x9 + 8x8 = 145 terrain heights (MCVT), relative to the chunk origin, in the interleaved outer/inner row order.
public Vector<float> Heights { get; }
Property Value
Layers
The texture layers (MCLY); layer 0 is opaque, later layers blend through their alpha map.
public Vector<SMLayer> Layers { get; }
Property Value
Normals
The 145 terrain normals (MCNR), X Z Y signed bytes.
public Vector<McnrEntry> Normals { get; }
Property Value
ObjectRefs
Object references (MCRF object part pre-Cata, MCRW Cata+): indices into the tile's MODF placements drawn in this chunk.
public Vector<uint> ObjectRefs { get; }
Property Value
ShadowMap
The decoded 64x64 (4096-byte) shadow map (MCSH), 0/1 per texel; empty when the chunk casts no baked shadow.
public Vector<byte> ShadowMap { get; }
Property Value
Methods
Dispose()
Release the native object now. Optional: the finalizer releases it on
collection anyway - dispose (or using) when you want native memory back
promptly.
public virtual void Dispose()
ForVersion(ClientVersion)
A fresh MapChunk for an exact client version — the only axis that can name a Classic client, whose files follow the engine its build was cut on rather than its 1.15 / 4.4 version number.
public static MapChunk ForVersion(ClientVersion version)
Parameters
versionClientVersion
Returns
ForVersion(Expansion)
A fresh MapChunk for the given era, as the family base — the dynamic twin of the typed Era factories.
public static MapChunk ForVersion(Expansion era)
Parameters
eraExpansion