SKIN
The skinned frame acts itself as a joint. I call it ‘root’ here.
SKIN (v29)
In Mafia, mesh vertices are sorted by joint id and weight.
Joint 1 fully weighted vertices (1.0 weight)
Joint 1 weighted vertices
Joint 2 fully weighted vertices (1.0 weight)
Joint 2 weighted vertices
…
Root fully weighted vertices (1.0 weight)
lods SKIN_LOD[mesh.numLods]
numJoints uint8
numW1Verts uint32
min vector3
max vector3
joints SKIN_JOINT[numJoints]
matrix matrix4
numW1Verts uint32
numWeights uint32
parentId uint32
min vector3
max vector3
weights float[numWeights]
lods(SKIN_LOD[]) - array of SKIN_LODnumJoints(uint8)numW1Verts(uint32) - number of verts with 1.0 weight influenced by root, at the end of vertex buffermin,max(vector3) - bounding box of verts affected by this (root) joint, in local spacejoints(SKIN_JOINT[]) - array of SKIN_JOINTjoint.matrix(matrix4)joint.numW1Verts(uint32) - number of verts with 1.0 weightjoint.numWeights(uint32) - number of explicitly defined weightsjoint.parentId(uint32) - 1-based parent joint id, 0 = rootjoint.min,joint.max(vector3) - bounding box of verts affected by this joint, in local spacejoint.weights(float[]) - array of float
Every vertex should be described - sum of all numW1Verts for root and numW1Verts and numWeights for each joint should be equal to number of mesh vertices.
SKIN (v41, v42)
v41 uses vector4, v42 uses vector3
numJoints uint8
min vector4/vector3
max vector4/vector3
parentIds uint8[numGroups] 0 = root
joints JOINT[numGroups]
matrix matrix4
min vector4/vector3
max vector4/vector3
lods LOD[mesh.numLods]
numWeights uint32
weights WEIGHT[numWeights]
boneId uint8
weight uint8