Class M2RootTbc
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 M2RootTbc : M2Root, IDisposable
- Inheritance
-
M2RootTbc
- Implements
- Inherited Members
Constructors
M2RootTbc()
public M2RootTbc()
M2RootTbc(M2RootTbc)
Copy-construct: a deep copy of other (the C++ copy constructor).
public M2RootTbc(M2RootTbc other)
Parameters
otherM2RootTbc
Properties
AttachmentLookupTable
Attachment lookup: attachment id -> index.
public Vector<ushort> AttachmentLookupTable { get; }
Property Value
Attachments
Attachment points (weapons, effects, name plates).
public Vector<M2AttachmentVanillaToTbc> 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<M2CompBoneTbc> 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<M2CameraVanillaToTbc> 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<M2ColorVanillaToTbc> Colors { get; }
Property Value
Events
Timed events (sounds, footsteps, death thud).
public Vector<M2EventVanillaToTbc> 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<M2LightVanillaToTbc> 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<M2ParticleTbc> ParticleEmitters { get; }
Property Value
PlayableAnimationLookup
Playable-animation fallbacks, one per AnimationData.dbc id (pre-WotLK).
public Vector<M2SequenceFallback> PlayableAnimationLookup { 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<M2RibbonVanillaToTbc> 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<M2SequenceVanillaToTbc> Sequences { get; }
Property Value
SkinProfiles
The skin profiles (LOD views), embedded in the model pre-WotLK; WotLK+ moves them to .skin files.
public Vector<M2SkinProfileTbcToWotlk> SkinProfiles { 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
TextureFlipbooks
Texture flipbooks (pre-WotLK; never seen engaged).
public Vector<M2TextureFlipbookVanillaToTbc> TextureFlipbooks { 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<M2TextureTransformVanillaToTbc> 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<M2TextureWeightVanillaToTbc> 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 ==(M2RootTbc?, M2RootTbc?)
public static bool operator ==(M2RootTbc? l, M2RootTbc? r)
Parameters
Returns
operator !=(M2RootTbc?, M2RootTbc?)
public static bool operator !=(M2RootTbc? l, M2RootTbc? r)