Class M2RootWotlk
An MD20 model body for one client version: header scalars plus every offset-addressed block, decoded. A version's class carries ONLY the members that version defines. See https://wowdev.wiki/M2.
public class M2RootWotlk : M2Root, IDisposable
- Inheritance
-
M2RootWotlk
- Implements
- Inherited Members
Constructors
M2RootWotlk()
public M2RootWotlk()
M2RootWotlk(M2RootWotlk)
Copy-construct: a deep copy of other (the C++ copy constructor).
public M2RootWotlk(M2RootWotlk other)
Parameters
otherM2RootWotlk
Properties
AttachmentLookupTable
Attachment lookup: attachment id -> index.
public Vector<ushort> AttachmentLookupTable { get; }
Property Value
Attachments
Attachment points (weapons, effects, name plates).
public Vector<M2AttachmentWotlkPlus> Attachments { get; }
Property Value
BoneLookupTable
Bone lookup: skin sections select bone subsets through it.
public Vector<ushort> BoneLookupTable { get; }
Property Value
Bones
The bones (MAX_BONES nominally 256).
public Vector<M2CompBoneWotlkPlus> Bones { get; }
Property Value
BoundingBox
The render bounds.
public CAaBox BoundingBox { get; set; }
Property Value
BoundingSphereRadius
The render bounding-sphere radius.
public float BoundingSphereRadius { get; set; }
Property Value
CameraLookupTable
Camera lookup: camera type -> index.
public Vector<ushort> CameraLookupTable { get; }
Property Value
Cameras
Cameras (portrait, character info, flyby).
public Vector<M2CameraWotlk> Cameras { get; }
Property Value
CollisionBox
The collision bounds.
public CAaBox CollisionBox { get; set; }
Property Value
CollisionNormals
Collision-hull per-face normals.
public Vector<C3Vector> CollisionNormals { get; }
Property Value
CollisionSphereRadius
The collision bounding-sphere radius.
public float CollisionSphereRadius { get; set; }
Property Value
CollisionTriangles
Collision-hull triangle indices (3 per face).
public Vector<ushort> CollisionTriangles { get; }
Property Value
CollisionVertices
Collision-hull vertices.
public Vector<C3Vector> CollisionVertices { get; }
Property Value
Colors
Color and alpha animations, referenced from skin batches.
public Vector<M2ColorWotlkPlus> Colors { get; }
Property Value
Events
Timed events (sounds, footsteps, death thud).
public Vector<M2EventWotlkPlus> Events { get; }
Property Value
FormatVersion
The MD20 format version (256 vanilla .. 274 Legion+).
public uint FormatVersion { get; set; }
Property Value
GlobalFlags
Global flags, see GlobalFlags.
public GlobalFlags GlobalFlags { get; set; }
Property Value
GlobalLoops
Global-sequence loop lengths (timestamps).
public Vector<M2Loop> GlobalLoops { get; }
Property Value
KeyBoneLookup
Key-bone lookup: key bone slot -> bone index, -1 if none.
public Vector<short> KeyBoneLookup { get; }
Property Value
Lights
Model lights.
public Vector<M2LightWotlkPlus> Lights { get; }
Property Value
Materials
Materials: render flags + blending modes.
public Vector<M2Material> Materials { get; }
Property Value
Name
The model's internal name; empty in 9.2+ files.
public string Name { get; set; }
Property Value
ParticleEmitters
Particle emitters.
public Vector<M2ParticleWotlk> ParticleEmitters { get; }
Property Value
ReplacableTextureLookup
Replacable-texture reverse lookup: replacable id -> texture index or -1.
public Vector<short> ReplacableTextureLookup { get; }
Property Value
RibbonEmitters
Ribbon (trail) emitters.
public Vector<M2RibbonWotlkPlus> RibbonEmitters { get; }
Property Value
SequenceLookups
Animation-id hash table: AnimationData.dbc id -> sequence index, quadratic probing, -1 empty.
public Vector<short> SequenceLookups { get; }
Property Value
Sequences
The animation sequences.
public Vector<M2SequenceWotlkToMop> Sequences { get; }
Property Value
TextureCombinerCombos
Second-texture material override combos; present in the layout only under global flag 0x8 (TBC+).
public Vector<ushort> TextureCombinerCombos { get; }
Property Value
TextureLookupTable
Texture lookup: batches select textures through it.
public Vector<ushort> TextureLookupTable { get; }
Property Value
TextureMappingLookupTable
Texture-mapping lookup: -1 environment, 0 first UV set, 1 second (unused since Cata).
public Vector<short> TextureMappingLookupTable { get; }
Property Value
TextureTransforms
UV animations.
public Vector<M2TextureTransformWotlkPlus> TextureTransforms { get; }
Property Value
TextureTransformsLookupTable
Texture-transform lookup: batches select UV animations through it, -1 static.
public Vector<short> TextureTransformsLookupTable { get; }
Property Value
TextureWeights
Global transparency weights.
public Vector<M2TextureWeightWotlkPlus> TextureWeights { get; }
Property Value
Textures
The texture definitions.
public Vector<M2Texture> Textures { get; }
Property Value
TransparencyLookupTable
Transparency lookup: batches select texture weights through it.
public Vector<ushort> TransparencyLookupTable { get; }
Property Value
Vertices
The global vertex list (Z-up model space).
public Vector<M2Vertex> Vertices { get; }
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 override void Dispose()
EnsureValid()
Validate and raise on the first error instead of returning a report — the assert-style face of validate().
public void EnsureValid()
Read(byte[])
Deserialize file bytes into this entity, replacing its contents. Offsets resolve against the given buffer; sequence-gated data is read inline.
public void Read(byte[] data)
Parameters
databyte[]the file (or containing-chunk payload) bytes
Validate()
Check the logical integrity contracts this file must satisfy to LOAD in the client — companion-array counts, lookup ranges — 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 in wowlib's canonical layout (an offset format has no byte-perfect round-trip guarantee; a written entity re-reads equal instead).
public byte[] Write()
Returns
- byte[]
the file bytes
Operators
operator ==(M2RootWotlk?, M2RootWotlk?)
public static bool operator ==(M2RootWotlk? l, M2RootWotlk? r)
Parameters
Returns
operator !=(M2RootWotlk?, M2RootWotlk?)
public static bool operator !=(M2RootWotlk? l, M2RootWotlk? r)