added the multiple root joints warning

This commit is contained in:
Thijs Wenker 2019-03-08 07:32:41 +01:00
parent c35e4d15ab
commit f2bca5d6c6

View file

@ -168,12 +168,23 @@ void AvatarDoctor::startDiagnosing() {
_errors.push_back({ "Asymmetrical leg bones.", DEFAULT_URL });
}
// Multiple skeleton root joints checkup
int skeletonRootJoints = 0;
foreach(const HFMJoint& joint, avatarModel.joints) {
if (joint.parentIndex == -1 && joint.isSkeletonJoint) {
skeletonRootJoints++;
}
}
if (skeletonRootJoints > 1) {
_errors.push_back({ "Multiple root joints found.", DEFAULT_URL });
}
const auto rig = new Rig();
rig->reset(avatarModel);
const float eyeHeight = rig->getUnscaledEyeHeight();
const float ratio = eyeHeight / DEFAULT_AVATAR_HEIGHT;
const float avatarHeight = eyeHeight + ratio * DEFAULT_AVATAR_EYE_TO_TOP_OF_HEAD;
qDebug() << "avatarHeight = " << avatarHeight;
// SCALE
const float RECOMMENDED_MIN_HEIGHT = DEFAULT_AVATAR_HEIGHT * 0.25f;