Class LiquidInstance
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
liquidTypeushortliquidObjectOrLvfushortvertexFormatLiquidVertexFormatminHeightfloatmaxHeightfloatxOffsetbyteyOffsetbytewidthbyteheightbyteexistsBitmapbyte[]heightmapfloat[]depthmapbyte[]uvmapVector<UvMapEntry>
LiquidInstance(LiquidInstance)
Copy-construct: a deep copy of other (the C++ copy constructor).
public LiquidInstance(LiquidInstance other)
Parameters
otherLiquidInstance
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
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
Height
The liquid rectangle height in tiles (1-8).
public byte Height { get; set; }
Property Value
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
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
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
MaxHeight
Maximum surface height.
public float MaxHeight { get; set; }
Property Value
MinHeight
Minimum surface height (the flat height when no heightmap).
public float MinHeight { get; set; }
Property Value
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
VertexFormat
The resolved vertex layout wowlib decoded (and will re-lay).
public LiquidVertexFormat VertexFormat { get; set; }
Property Value
Width
The liquid rectangle width in tiles (1-8).
public byte Width { get; set; }
Property Value
XOffset
The liquid rectangle's x offset within the cell (0-7).
public byte XOffset { get; set; }
Property Value
YOffset
The liquid rectangle's y offset within the cell (0-7).
public byte YOffset { get; set; }
Property Value
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
objobjectThe object to compare with the current object.
Returns
GetHashCode()
Reference-identity hash (the C++ type has no hash to mirror).
public override int GetHashCode()
Returns
VertexCount()
public ulong VertexCount()
Returns
Operators
operator ==(LiquidInstance?, LiquidInstance?)
public static bool operator ==(LiquidInstance? l, LiquidInstance? r)
Parameters
Returns
operator !=(LiquidInstance?, LiquidInstance?)
public static bool operator !=(LiquidInstance? l, LiquidInstance? r)