Table of Contents

Class SMChunk

Namespace
WoWLib.Formats.ADT.Chunks
Assembly
WoWLib.dll

A terrain cell header (MCNK, 128 bytes): the flags, its (x, y) position in the 16x16 cell grid, the area id, the terrain hole mask and the origin. The sub-chunk offset/size/count fields are binary bookkeeping wowlib derives on write, so they are not exposed. See https://wowdev.wiki/ADT/v18#MCNK_chunk.

public class SMChunk : IDisposable
Inheritance
SMChunk
Implements
Inherited Members

Constructors

SMChunk()

public SMChunk()

SMChunk(SMChunk)

Copy-construct: a deep copy of other (the C++ copy constructor).

public SMChunk(SMChunk other)

Parameters

other SMChunk

Properties

AreaId

The cell's area id (a foreign key into AreaTable; in the alpha clients, packed zone/subzone u16s).

public uint AreaId { get; set; }

Property Value

uint

Flags

Flags; MapChunkFlags bits.

public MapChunkFlags Flags { get; set; }

Property Value

MapChunkFlags

HolesHighRes

The 64-bit high-resolution hole mask (the 8 bytes at header offset 0x14), valid when the high_res_holes flag is set.

public ulong HolesHighRes { get; }

Property Value

ulong

HolesLowRes

The 16-bit low-resolution terrain hole mask (a 4x4 bitfield); used unless the high_res_holes flag selects holes_high_res.

public ushort HolesLowRes { get; set; }

Property Value

ushort

IndexX

The cell's column index in the 16x16 grid (0-15).

public uint IndexX { get; set; }

Property Value

uint

IndexY

The cell's row index in the 16x16 grid (0-15).

public uint IndexY { get; set; }

Property Value

uint

NoEffectDoodad

An 8x8 bitfield (8 bytes): 1 disables detail doodads in that sub-cell (WoD may store it as an explicit MCDD chunk).

public FixedArray<byte> NoEffectDoodad { get; set; }

Property Value

FixedArray<byte>

Position

The cell origin in world space; MCVT heights are relative to it.

public C3Vector Position { get; set; }

Property Value

C3Vector

PredominantTexture

The "really low quality" predominant-texture map: an 8x8 grid of 2-bit layer indices (16 bytes), naming the detail doodads to show per sub-cell.

public FixedArray<byte> PredominantTexture { get; set; }

Property Value

FixedArray<byte>

UnknownButUsed

Unknown but written (padding in the alpha clients).

public ushort UnknownButUsed { get; set; }

Property Value

ushort

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()

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Reference-identity hash (the C++ type has no hash to mirror).

public override int GetHashCode()

Returns

int

SetHolesHighRes(ulong)

Set the 64-bit high-resolution hole mask (and the high_res_holes flag).

public void SetHolesHighRes(ulong holes)

Parameters

holes ulong

Operators

operator ==(SMChunk?, SMChunk?)

public static bool operator ==(SMChunk? l, SMChunk? r)

Parameters

l SMChunk
r SMChunk

Returns

bool

operator !=(SMChunk?, SMChunk?)

public static bool operator !=(SMChunk? l, SMChunk? r)

Parameters

l SMChunk
r SMChunk

Returns

bool