Table of Contents

Class LiquidInstance

Namespace
WoWLib.Formats.ADT
Assembly
WoWLib.dll

One liquid layer over a terrain cell (an MH2O instance), decoded. The heightmap/depthmap/uvmap arrays are present according to vertex_format and each hold (width + 1) x (height + 1) entries; exists_bitmap (when not empty) is a width x height bit grid selecting which tiles render. Heights outside [min_height, max_height] and the binary offsets are derived, not stored.

public class LiquidInstance : IDisposable
Inheritance
LiquidInstance
Implements
Inherited Members

Constructors

LiquidInstance()

public LiquidInstance()

LiquidInstance(ushort, ushort, LiquidVertexFormat, float, float, byte, byte, byte, byte, byte[], float[], byte[], Vector<UvMapEntry>)

public LiquidInstance(ushort liquidType, ushort liquidObjectOrLvf, LiquidVertexFormat vertexFormat, float minHeight, float maxHeight, byte xOffset, byte yOffset, byte width, byte height, byte[] existsBitmap, float[] heightmap, byte[] depthmap, Vector<UvMapEntry> uvmap)

Parameters

liquidType ushort
liquidObjectOrLvf ushort
vertexFormat LiquidVertexFormat
minHeight float
maxHeight float
xOffset byte
yOffset byte
width byte
height byte
existsBitmap byte[]
heightmap float[]
depthmap byte[]
uvmap Vector<UvMapEntry>

LiquidInstance(LiquidInstance)

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

public LiquidInstance(LiquidInstance other)

Parameters

other LiquidInstance

Properties

Depthmap

Depth bytes, (width+1) x (height+1) row-major; present for height_depth, depth_only, height_uv_depth.

public Vector<byte> Depthmap { get; }

Property Value

Vector<byte>

ExistsBitmap

The per-tile exists mask, width x height bits row-major (LSB first); empty means every tile renders.

public Vector<byte> ExistsBitmap { get; }

Property Value

Vector<byte>

Height

The liquid rectangle height in tiles (1-8).

public byte Height { get; set; }

Property Value

byte

Heightmap

Surface heights, (width+1) x (height+1) row-major; present for vertex formats height_depth, height_uv, height_uv_depth.

public Vector<float> Heightmap { get; }

Property Value

Vector<float>

LiquidObjectOrLvf

The stored liquid_object_or_lvf field: a LiquidObject id (>= 42) or a raw LiquidVertexFormat; vertex_format holds the resolved layout.

public ushort LiquidObjectOrLvf { get; set; }

Property Value

ushort

LiquidType

The liquid type (a LiquidType foreign key: 1 ocean, 2 ocean-flat, 3 slime, 5/6 magma, …).

public ushort LiquidType { get; set; }

Property Value

ushort

MaxHeight

Maximum surface height.

public float MaxHeight { get; set; }

Property Value

float

MinHeight

Minimum surface height (the flat height when no heightmap).

public float MinHeight { get; set; }

Property Value

float

Uvmap

UV texture coordinates, (width+1) x (height+1) row-major; present for height_uv and height_uv_depth.

public Vector<UvMapEntry> Uvmap { get; }

Property Value

Vector<UvMapEntry>

VertexFormat

The resolved vertex layout wowlib decoded (and will re-lay).

public LiquidVertexFormat VertexFormat { get; set; }

Property Value

LiquidVertexFormat

Width

The liquid rectangle width in tiles (1-8).

public byte Width { get; set; }

Property Value

byte

XOffset

The liquid rectangle's x offset within the cell (0-7).

public byte XOffset { get; set; }

Property Value

byte

YOffset

The liquid rectangle's y offset within the cell (0-7).

public byte YOffset { get; set; }

Property Value

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

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

VertexCount()

public ulong VertexCount()

Returns

ulong

Operators

operator ==(LiquidInstance?, LiquidInstance?)

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

Parameters

l LiquidInstance
r LiquidInstance

Returns

bool

operator !=(LiquidInstance?, LiquidInstance?)

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

Parameters

l LiquidInstance
r LiquidInstance

Returns

bool