Table of Contents

Class BoneFile

Namespace
WoWLib.Formats.M2.Bone
Assembly
WoWLib.dll

A .bone file (WoD+): facial-pose (FacePose 808) bone offset matrices, one file per pose variant, referenced by BFID. See https://wowdev.wiki/BONE.

public class BoneFile : IDisposable
Inheritance
BoneFile
Implements
Inherited Members

Constructors

BoneFile()

public BoneFile()

BoneFile(BoneFile)

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

public BoneFile(BoneFile other)

Parameters

other BoneFile

Properties

BoneIds

The affected bone ids (BIDA).

public Vector<ushort> BoneIds { get; }

Property Value

Vector<ushort>

BoneOffsetMatrices

The per-bone offset matrices (BOMT), same count as bone_ids.

public Vector<C44Matrix> BoneOffsetMatrices { get; }

Property Value

Vector<C44Matrix>

Prelude

The raw u32 prelude (version marker).

public BoneFilePrelude Prelude { get; set; }

Property Value

BoneFilePrelude

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

EnsureValid()

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

public void EnsureValid()

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

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[]

the file bytes

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

every violated contract, in member order

Write()

Serialize this entity.

public byte[] Write()

Returns

byte[]

the file bytes

Operators

operator ==(BoneFile?, BoneFile?)

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

Parameters

l BoneFile
r BoneFile

Returns

bool

operator !=(BoneFile?, BoneFile?)

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

Parameters

l BoneFile
r BoneFile

Returns

bool