Skip to content

Common structures

The shared wire-level math and colour primitives (wowdev.wiki Common Types) used across every WoW file format — vectors, matrices, planes, bounding volumes and colours — under their established client names. All are trivially copyable with the exact on-disk layout, so chunk payloads read straight into arrays of them; the numeric vectors bind as zero-copy NumPy views (see Containers).

C2Vector

C2Vector()
C2Vector(x: float = 0.0, y: float = 0.0)

A 2D float vector: texture coordinates, UV animation speeds.

x property writable

x: float

The x component.

y property writable

y: float

The y component.

C2IVector

C2IVector()
C2IVector(x: int = 0, y: int = 0)

A 2D integer vector.

x property writable

x: Annotated[int, int32]

The x component.

y property writable

y: Annotated[int, int32]

The y component.

C3Vector

C3Vector()
C3Vector(x: float = 0.0, y: float = 0.0, z: float = 0.0)

A 3D float vector — the workhorse: positions, normals, rotations-as-Euler-degrees in placements.

x property writable

x: float

The x component.

y property writable

y: float

The y component.

z property writable

z: float

The z component.

C3IVector

C3IVector()
C3IVector(x: int = 0, y: int = 0, z: int = 0)

A 3D integer vector.

x property writable

x: Annotated[int, int32]

The x component.

y property writable

y: Annotated[int, int32]

The y component.

z property writable

z: Annotated[int, int32]

The z component.

C4Vector

C4Vector()
C4Vector(x: float = 0.0, y: float = 0.0, z: float = 0.0, w: float = 0.0)

A 4D float vector.

x property writable

x: float

The x component.

y property writable

y: float

The y component.

z property writable

z: float

The z component.

w property writable

w: float

The w component.

C4Quaternion

C4Quaternion()
C4Quaternion(x: float = 0.0, y: float = 0.0, z: float = 0.0, w: float = 1.0)

A quaternion with the scalar part LAST on disk (x, y, z, w) — note the difference from math libraries that lead with w.

x property writable

x: float

The x component.

y property writable

y: float

The y component.

z property writable

z: float

The z component.

w property writable

w: float

The w (scalar) component.

C33Matrix

C33Matrix()
C33Matrix(columns: list[C3Vector] | None = ...)

A 3x3 matrix as three column C3Vectors.

columns property writable

columns: list[C3Vector]

The three columns.

C34Matrix

C34Matrix()
C34Matrix(columns: list[C3Vector] | None = ...)

A 3x4 matrix as four column C3Vectors.

columns property writable

columns: list[C3Vector]

The four columns.

C44Matrix

C44Matrix()
C44Matrix(columns: list[C4Vector] | None = ...)

A 4x4 matrix as four column C4Vectors.

columns property writable

columns: list[C4Vector]

The four columns.

C4Plane

C4Plane()
C4Plane(normal: C3Vector | None = ..., distance: float = 0.0)

A plane as a normal and its signed distance from the origin.

normal property writable

normal: C3Vector

The plane normal.

distance property writable

distance: float

The signed distance from the origin.

CAaBox

CAaBox()
CAaBox(min: C3Vector | None = ..., max: C3Vector | None = ...)

An axis-aligned bounding box: minimum and maximum corners.

min property writable

min: C3Vector

The minimum corner.

max property writable

max: C3Vector

The maximum corner.

CAaSphere

CAaSphere()
CAaSphere(position: C3Vector | None = ..., radius: float = 0.0)

An axis-aligned sphere: position and radius.

position property writable

position: C3Vector

The center position.

radius property writable

radius: float

The radius.

CRange

CRange()
CRange(min: float = 0.0, max: float = 0.0)

A float range: minimum and maximum.

min property writable

min: float

The minimum.

max property writable

max: float

The maximum.

CArgb

CArgb()
CArgb(r: int = 0, g: int = 0, b: int = 0, a: int = 0)

A color stored as r, g, b, a bytes.

r property writable

r: Annotated[int, uint8]

The red component.

g property writable

g: Annotated[int, uint8]

The green component.

b property writable

b: Annotated[int, uint8]

The blue component.

a property writable

a: Annotated[int, uint8]

The alpha component.

CImVector

CImVector()
CImVector(b: int = 0, g: int = 0, r: int = 0, a: int = 0)

A color stored as b, g, r, a bytes — the client's immediate-mode vertex color layout (WMO MOCV, doodad colors).

b property writable

b: Annotated[int, uint8]

The blue component.

g property writable

g: Annotated[int, uint8]

The green component.

r property writable

r: Annotated[int, uint8]

The red component.

a property writable

a: Annotated[int, uint8]

The alpha component.

fixed16

fixed16()
fixed16(value: int = 0)

A signed 16-bit fixed-point value with an implicit 0x7FFF scale.

value property writable

value: Annotated[int, int16]

The raw fixed-point integer; value / 0x7FFF is the float.

as_float property

as_float: float

The value as a float in [-1, 1].

MapObjDefFlags

Bases: IntFlag

WMO placement flag bits (SMMapObjDef.flags).

Attributes:

Name Description
Destroyable

A destroyable, server-controllable building (e.g. the DeathknightStart tower).

UseLod

Also load the _LOD1 WMO, selected by distance (WoD+).

HasScale

The scale field is engaged: scale / 1024 applies (Legion+; otherwise 1.0).

EntryIsFdid

name_id is a FileDataID to load directly, not a name-table index (Legion+).

UseSetsFromMwds

Doodad set indices come from the ADT MWDS chunk (Shadowlands+).

Destroyable class-attribute instance-attribute

Destroyable = 1

UseLod class-attribute instance-attribute

UseLod = 2

HasScale class-attribute instance-attribute

HasScale = 4

EntryIsFdid class-attribute instance-attribute

EntryIsFdid = 8

UseSetsFromMwds class-attribute instance-attribute

UseSetsFromMwds = 128

DoodadDefFlags

Bases: IntFlag

M2 placement flag bits (SMDoodadDef.flags).

Attributes:

Name Description
Biodome

Sets the internal WDOODADDEF 0x800 flag; meaning unknown (biodome).

Shrubbery

Shrubbery; not checked by 6.0.1+ clients.

Unk4

Unknown (Legion+).

Unk8

Unknown (Legion+).

Unk10

Unknown (Shadowlands+); sets flag 0x4 on the PVS doodad.

LiquidKnown

SMDoodadDef::Flag_liquidKnown (Legion+).

EntryIsFdid

name_id is a FileDataID to load directly, not an MMID index (Legion+).

Unk100

Unknown (Legion+).

AcceptProjTextures

Accepts projected textures (Legion+).

Biodome class-attribute instance-attribute

Biodome = 1

Shrubbery class-attribute instance-attribute

Shrubbery = 2

Unk4 class-attribute instance-attribute

Unk4 = 4

Unk8 class-attribute instance-attribute

Unk8 = 8

Unk10 class-attribute instance-attribute

Unk10 = 16

LiquidKnown class-attribute instance-attribute

LiquidKnown = 32

EntryIsFdid class-attribute instance-attribute

EntryIsFdid = 64

Unk100 class-attribute instance-attribute

Unk100 = 256

AcceptProjTextures class-attribute instance-attribute

AcceptProjTextures = 4096

SMMapObjDef

SMMapObjDef()
SMMapObjDef(name_id: int = 0, unique_id: int = 0, position: C3Vector | None = ..., rotation: C3Vector | None = ..., extents: CAaBox | None = ..., flags: MapObjDefFlags | None = ..., doodad_set: int = 0, name_set: int = 0, scale: int = 0)

A WMO placement (the 64-byte MODF record of WDT, WDL and ADT): which object, where, and how it is instanced.

name_id property writable

name_id: int

The object: an MWID/MWMO name-table reference, or a FileDataID when flags has EntryIsFdid (Legion+). The WDT global-WMO record ignores it and uses the MWMO content.

unique_id property writable

unique_id: int

Unique instance id across the whole map (WDT global-WMO records leave it unused).

position property writable

position: C3Vector

Position, in the map's placement coordinate system.

rotation property writable

rotation: C3Vector

Rotation as Euler angles, degrees.

extents property writable

extents: CAaBox

The transformed object's bounding box (position plus the rotated extents); culling and collision use it.

flags property writable

Flags; MapObjDefFlags bits.

doodad_set property writable

doodad_set: int

The WMO doodad set shown by this instance (MODS index, or MWDR when use_sets_from_mwds is set).

name_set property writable

name_set: int

The WMO name set (renames the same model per instance).

scale property writable

scale: Annotated[int, uint16]

Scale, 1024 = 1.0, engaged by the has_scale flag (Legion+); padding in older clients.

SMDoodadDef

SMDoodadDef()
SMDoodadDef(name_id: int = 0, unique_id: int = 0, position: C3Vector | None = ..., rotation: C3Vector | None = ..., scale: int = 1024, flags: DoodadDefFlags | None = ...)

An M2 (doodad) placement (the 36-byte MDDF record of ADT, reused by the WDL MLDD low-resolution set): which model, where, and at what scale.

name_id property writable

name_id: int

The model: an MMID name-table reference, or a FileDataID when flags has entry_is_fdid (Legion+; WDL MLDD entries are always FileDataIDs).

unique_id property writable

unique_id: int

Unique instance id across the whole map.

position property writable

position: C3Vector

Position, in the map's placement coordinate system.

rotation property writable

rotation: C3Vector

Rotation as Euler angles, degrees.

scale property writable

scale: Annotated[int, uint16]

Scale, 1024 = 1.0.

flags property writable

Flags; DoodadDefFlags bits.

Chunk payload containers

Two member types from wowlib.formats own their whole chunk payload encoding instead of mapping a wire struct: the decoded string-table block (MOTX, MOGN, MODN, …) and the verbatim blob that preserves opaque or undocumented chunk payloads byte-for-byte.

StringBlock

StringBlock()

A chunk of zero-terminated strings (texture and model filenames, group names), decoded into (offset, value) entries. Other chunks reference entries by their byte offset in the on-disk blob; adding appends, and existing offsets never move.

empty property

empty: bool

Whether the on-disk blob holds any bytes.

size property

size: int

The on-disk blob size in bytes, trailing padding included.

Entry

Entry()
Entry(offset: int, value: str)

One decoded string and the blob byte offset other chunks reference it by.

offset property writable
offset: int

Byte offset of the string in the on-disk blob.

value property writable
value: str

The string, without its terminator.

at

at(offset: int) -> str

The string at a byte offset another chunk stored; empty if the offset lands on padding or out of range.

Parameters:

Name Type Description Default
offset int

byte offset into the on-disk blob

required

Returns:

Type Description
str

the referenced string (a mid-entry offset yields the suffix)

add

add(string: str) -> int

Append a string; existing offsets never move.

Parameters:

Name Type Description Default
string str

the string to append (no embedded zero bytes)

required

Returns:

Type Description
int

the offset the new string starts at - the value to store in referencing chunks

entries

entries() -> list[Entry]

The decoded entries, in blob order.

Returns:

Type Description
list[Entry]

the (offset, value) entries

ChunkBlob

ChunkBlob()

An unparsed chunk payload, preserved verbatim for round-trip. Backs chunks wowlib keeps opaque — offset-based (MOTA, MDDL) or undocumented (MPVD, MOMX).

empty property

empty: bool

Whether the payload holds any bytes.

size property

size: int

The payload size in bytes.