Table of Contents

Class MapChunk

Namespace
WoWLib.Formats.ADT
Assembly
WoWLib.dll

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

other MapChunk

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

Vector<Vector<byte>>

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

Vector<uint>

Header

The chunk header (flags, grid position, area, holes, origin).

public SMChunk Header { get; set; }

Property Value

SMChunk

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

Vector<float>

Layers

The texture layers (MCLY); layer 0 is opaque, later layers blend through their alpha map.

public Vector<SMLayer> Layers { get; }

Property Value

Vector<SMLayer>

Normals

The 145 terrain normals (MCNR), X Z Y signed bytes.

public Vector<McnrEntry> Normals { get; }

Property Value

Vector<McnrEntry>

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

Vector<uint>

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

Vector<byte>

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

version ClientVersion

Returns

MapChunk

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

era Expansion

Returns

MapChunk