mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Look harder for head, log if not found, and compute what we need
regardless.
This commit is contained in:
parent
064d5f2458
commit
ceed571c82
2 changed files with 15 additions and 15 deletions
|
@ -46,21 +46,21 @@ void SkeletonModel::initJointStates() {
|
|||
|
||||
// Determine the default eye position for avatar scale = 1.0
|
||||
int headJointIndex = _geometry->getFBXGeometry().headJointIndex;
|
||||
if (0 <= headJointIndex && headJointIndex < _rig->getJointStateCount()) {
|
||||
|
||||
glm::vec3 leftEyePosition, rightEyePosition;
|
||||
getEyeModelPositions(leftEyePosition, rightEyePosition);
|
||||
glm::vec3 midEyePosition = (leftEyePosition + rightEyePosition) / 2.0f;
|
||||
|
||||
int rootJointIndex = _geometry->getFBXGeometry().rootJointIndex;
|
||||
glm::vec3 rootModelPosition;
|
||||
getJointPosition(rootJointIndex, rootModelPosition);
|
||||
|
||||
_defaultEyeModelPosition = midEyePosition - rootModelPosition;
|
||||
|
||||
// Skeleton may have already been scaled so unscale it
|
||||
_defaultEyeModelPosition = _defaultEyeModelPosition / _scale;
|
||||
if (0 > headJointIndex || headJointIndex >= _rig->getJointStateCount()) {
|
||||
qCWarning(interfaceapp) << "Bad head joint! Got:" << headJointIndex << "jointCount:" << _rig->getJointStateCount();
|
||||
}
|
||||
glm::vec3 leftEyePosition, rightEyePosition;
|
||||
getEyeModelPositions(leftEyePosition, rightEyePosition);
|
||||
glm::vec3 midEyePosition = (leftEyePosition + rightEyePosition) / 2.0f;
|
||||
|
||||
int rootJointIndex = _geometry->getFBXGeometry().rootJointIndex;
|
||||
glm::vec3 rootModelPosition;
|
||||
getJointPosition(rootJointIndex, rootModelPosition);
|
||||
|
||||
_defaultEyeModelPosition = midEyePosition - rootModelPosition;
|
||||
|
||||
// Skeleton may have already been scaled so unscale it
|
||||
_defaultEyeModelPosition = _defaultEyeModelPosition / _scale;
|
||||
|
||||
computeBoundingShape();
|
||||
|
||||
|
|
|
@ -600,7 +600,7 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS
|
|||
} else if (name == jointLeanName) {
|
||||
jointLeanID = getID(object.properties);
|
||||
|
||||
} else if (name == jointHeadName) {
|
||||
} else if (name == jointHeadName || name == "head" || name == "Head" || name == "HEAD" || name == "joint_head") {
|
||||
jointHeadID = getID(object.properties);
|
||||
|
||||
} else if (name == jointLeftHandName || name == "LeftHand" || name == "joint_L_hand") {
|
||||
|
|
Loading…
Reference in a new issue