Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 2 files). Show all
Unified · Split
| @@ -46,21 +46,21 @@ void SkeletonModel::initJointStates() { · 45 unmodified lines | |||
| 46 | 46 | ||
| 47 | // Determine the default eye position for avatar scale = 1.0 | 47 | // Determine the default eye position for avatar scale = 1.0 |
| 48 | int headJointIndex = _geometry->getFBXGeometry().headJointIndex; | 48 | int headJointIndex = _geometry->getFBXGeometry().headJointIndex; |
| 49 | if (0 <= headJointIndex && headJointIndex < _rig->getJointStateCount()) { | 49 | if (0 > headJointIndex || headJointIndex >= _rig->getJointStateCount()) { |
| 50 | 50 | qCWarning(interfaceapp) << "Bad head joint! Got:" << headJointIndex << "jointCount:" << _rig->getJointStateCount(); | |
| 51 | glm::vec3 leftEyePosition, rightEyePosition; | 51 | } |
| 52 | getEyeModelPositions(leftEyePosition, rightEyePosition); | 52 | glm::vec3 leftEyePosition, rightEyePosition; |
| 53 | glm::vec3 midEyePosition = (leftEyePosition + rightEyePosition) / 2.0f; | 53 | getEyeModelPositions(leftEyePosition, rightEyePosition); |
| 54 | glm::vec3 midEyePosition = (leftEyePosition + rightEyePosition) / 2.0f; | ||
| 54 | 55 | ||
| 55 | int rootJointIndex = _geometry->getFBXGeometry().rootJointIndex; | 56 | int rootJointIndex = _geometry->getFBXGeometry().rootJointIndex; |
| 56 | glm::vec3 rootModelPosition; | 57 | glm::vec3 rootModelPosition; |
| 57 | getJointPosition(rootJointIndex, rootModelPosition); | 58 | getJointPosition(rootJointIndex, rootModelPosition); |
| 58 | 59 | ||
| 59 | _defaultEyeModelPosition = midEyePosition - rootModelPosition; | 60 | _defaultEyeModelPosition = midEyePosition - rootModelPosition; |
| 60 | 61 | ||
| 61 | // Skeleton may have already been scaled so unscale it | 62 | // Skeleton may have already been scaled so unscale it |
| 62 | _defaultEyeModelPosition = _defaultEyeModelPosition / _scale; | 63 | _defaultEyeModelPosition = _defaultEyeModelPosition / _scale; |
| 63 | } | ||
| 64 | 64 | ||
| 65 | computeBoundingShape(); | 65 | computeBoundingShape(); |
| 66 | 66 | ||