mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:17:40 +02:00
Merge pull request #6990 from howard-stearns/better-head-joint-setup
Better head joint setup
This commit is contained in:
commit
17851dd129
1 changed files with 14 additions and 14 deletions
|
@ -46,8 +46,9 @@ void SkeletonModel::initJointStates() {
|
||||||
|
|
||||||
// Determine the default eye position for avatar scale = 1.0
|
// Determine the default eye position for avatar scale = 1.0
|
||||||
int headJointIndex = _geometry->getFBXGeometry().headJointIndex;
|
int headJointIndex = _geometry->getFBXGeometry().headJointIndex;
|
||||||
if (0 <= headJointIndex && headJointIndex < _rig->getJointStateCount()) {
|
if (0 > headJointIndex || headJointIndex >= _rig->getJointStateCount()) {
|
||||||
|
qCWarning(interfaceapp) << "Bad head joint! Got:" << headJointIndex << "jointCount:" << _rig->getJointStateCount();
|
||||||
|
}
|
||||||
glm::vec3 leftEyePosition, rightEyePosition;
|
glm::vec3 leftEyePosition, rightEyePosition;
|
||||||
getEyeModelPositions(leftEyePosition, rightEyePosition);
|
getEyeModelPositions(leftEyePosition, rightEyePosition);
|
||||||
glm::vec3 midEyePosition = (leftEyePosition + rightEyePosition) / 2.0f;
|
glm::vec3 midEyePosition = (leftEyePosition + rightEyePosition) / 2.0f;
|
||||||
|
@ -60,7 +61,6 @@ void SkeletonModel::initJointStates() {
|
||||||
|
|
||||||
// Skeleton may have already been scaled so unscale it
|
// Skeleton may have already been scaled so unscale it
|
||||||
_defaultEyeModelPosition = _defaultEyeModelPosition / _scale;
|
_defaultEyeModelPosition = _defaultEyeModelPosition / _scale;
|
||||||
}
|
|
||||||
|
|
||||||
computeBoundingShape();
|
computeBoundingShape();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue