Table of Contents

Class WMOGroupBody

Namespace
WoWLib.Formats.WMO.Group
Assembly
WoWLib.dll

The MOGP container payload, abstract over the client version. Construct a concrete version with WMOGroupBody.for_version(expansion).

public class WMOGroupBody : IDisposable
Inheritance
WMOGroupBody
Implements
Derived
Inherited Members

Constructors

WMOGroupBody()

public WMOGroupBody()

WMOGroupBody(WMOGroupBody)

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

public WMOGroupBody(WMOGroupBody other)

Parameters

other WMOGroupBody

Properties

Batches

Render batches (MOBA).

public FamilyVector<WMOBatch> Batches { get; }

Property Value

FamilyVector<WMOBatch>

BspFaceIndices

BSP face indices (MOBR).

public Vector<ushort> BspFaceIndices { get; }

Property Value

Vector<ushort>

BspNodes

Collision BSP nodes (MOBN).

public Vector<CAaBspNode> BspNodes { get; }

Property Value

Vector<CAaBspNode>

DoodadRefs

Doodad references into the root's MODD (MODR).

public Vector<ushort> DoodadRefs { get; }

Property Value

Vector<ushort>

Header

The group header leading the MOGP payload.

public WMOGroupHeader Header { get; set; }

Property Value

WMOGroupHeader

Indices

Triangle vertex indices (MOVI), three per triangle.

public Vector<ushort> Indices { get; }

Property Value

Vector<ushort>

LightRefs

Light references into the root's MOLT (MOLR).

public Vector<ushort> LightRefs { get; }

Property Value

Vector<ushort>

Liquid

Liquid data (MLIQ): a vertex grid and tile-flag grid with a base position and material id.

public MliqData Liquid { get; set; }

Property Value

MliqData

Normals

Normals (MONR).

public Vector<C3Vector> Normals { get; }

Property Value

Vector<C3Vector>

Polys

Per-triangle material info (MOPY).

public Vector<SmoPoly> Polys { get; }

Property Value

Vector<SmoPoly>

TransBatchIndices

Triangle-strip indices (MORI).

public Vector<ushort> TransBatchIndices { get; }

Property Value

Vector<ushort>

Vertices

Vertices (MOVT).

public Vector<C3Vector> Vertices { get; }

Property Value

Vector<C3Vector>

Methods

AppendTexcoordSet(Vector<C2Vector>)

Fill the next free texture-coordinate slot (MOTV).

public void AppendTexcoordSet(Vector<C2Vector> coords)

Parameters

coords Vector<C2Vector>

AppendVertexColorLayer(Vector<CImVector>)

Fill the next free vertex-color layer slot (MOCV).

public void AppendVertexColorLayer(Vector<CImVector> colors)

Parameters

colors Vector<CImVector>

ClearTexcoordSets()

Empty every texture-coordinate slot (MOTV).

public void ClearTexcoordSets()

ClearVertexColorLayers()

Empty every vertex-color layer slot (MOCV).

public void ClearVertexColorLayers()

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

EnsureValid()

Validate and raise on the first error instead of returning a report — the assert-style face of validate().

public void EnsureValid()

ForVersion(ClientVersion)

A fresh WMOGroupBody 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 WMOGroupBody ForVersion(ClientVersion version)

Parameters

version ClientVersion

Returns

WMOGroupBody

ForVersion(Expansion)

A fresh WMOGroupBody for the given era, as the family base — the dynamic twin of the typed Era factories.

public static WMOGroupBody ForVersion(Expansion era)

Parameters

era Expansion

Returns

WMOGroupBody

Read(byte[])

Deserialize file bytes into this entity, replacing its contents. Unmodeled chunks are preserved so an unmodified entity rewrites byte-for-byte.

public void Read(byte[] data)

Parameters

data byte[]

SetTexcoordSet(ulong, Vector<C2Vector>)

Replace one filled texture-coordinate set (MOTV).

public void SetTexcoordSet(ulong set, Vector<C2Vector> coords)

Parameters

set ulong
coords Vector<C2Vector>

SetVertexColorLayer(ulong, Vector<CImVector>)

Replace one filled vertex-color layer (MOCV).

public void SetVertexColorLayer(ulong layer, Vector<CImVector> colors)

Parameters

layer ulong
colors Vector<CImVector>

TexcoordSet(ulong)

One filled texture-coordinate set (MOTV), as a live zero-copy view.

public Vector<C2Vector>? TexcoordSet(ulong set)

Parameters

set ulong

Returns

Vector<C2Vector>

TexcoordSetCount()

The number of filled texture-coordinate sets (MOTV), 0 to 4.

public ulong TexcoordSetCount()

Returns

ulong

Validate()

Check the logical integrity contracts this file must satisfy to LOAD in the client — companion-chunk counts, index ranges, flag/presence coherence — which write() deliberately never enforces. Call it before writing when you want to know the result will load. A file read from a client and left unmodified reports no errors; warnings mark states real client files ship.

public ValidationReport Validate()

Returns

ValidationReport

VertexColorLayer(ulong)

One filled vertex-color layer (MOCV), as a live zero-copy view.

public Vector<CImVector>? VertexColorLayer(ulong layer)

Parameters

layer ulong

Returns

Vector<CImVector>

VertexColorLayerCount()

The number of filled vertex-color layers (MOCV), 0 to 2.

public ulong VertexColorLayerCount()

Returns

ulong

Write()

Serialize this entity.

public byte[] Write()

Returns

byte[]