public void CheckModelHierarchy(idRenderModel model)
{
if(_jointInfo.Length != model.JointCount)
{
idConsole.Error("Model '{0}' has different # of joints than anim '{1}'", model.Name, this.Name);
}
idMD5Joint[] modelJoints = model.Joints;
int parent = -1;
int jointCount = _jointInfo.Length;
int modelJointCount = modelJoints.Length;
for(int i = 0; i < jointCount; i++)
{
int jointIndex = _jointInfo[i].NameIndex;
if(modelJoints[i].Name != idR.AnimManager.GetJointName(jointIndex))
{
idConsole.Error("Model '{0}''s joint names don't match anim '{1}''s", model.Name, this.Name);
}
else if(modelJoints[i].Parent != null)
{
for(int j = 0; j < modelJointCount; j++)
{
if(modelJoints[j] == modelJoints[i].Parent)
{
parent = j;
break;
}
}
}
else
{
parent = -1;
}
if(parent != _jointInfo[i].ParentIndex)
{
idConsole.Error("Model '{0}' has different joint hierarchy than anim '{1}'", model.Name, this.Name);
}
}
}