Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 3 files). Show all
Unified · Split
| @@ -37,7 +37,8 @@ SkeletonModel::SkeletonModel(Avatar* owningAvatar, QObject* parent) : · 36 unmodified lines | ||
| 37 | 37 | _defaultEyeModelPosition(glm::vec3(0.0f, 0.0f, 0.0f)), |
| 38 | 38 | _standingFoot(NO_FOOT), |
| 39 | 39 | _standingOffset(0.0f), |
| 40 | − _clampedFootPosition(0.0f) | |
| 40 | + _clampedFootPosition(0.0f), | |
| 41 | + _headClipDistance(DEFAULT_NEAR_CLIP) | |
| 41 | 42 | { |
| 42 | 43 | } |
| 43 | 44 | |
| @@ -78,6 +79,10 @@ void SkeletonModel::setJointStates(QVector<JointState> states) { · 34 unmodified lines | ||
| 78 | 79 | buildShapes(); |
| 79 | 80 | } |
| 80 | 81 | |
| 82 | + Extents meshExtents = getMeshExtents(); | |
| 83 | + _headClipDistance = -(meshExtents.minimum.z / _scale.z - _defaultEyeModelPosition.z); | |
| 84 | + _headClipDistance = std::max(_headClipDistance, DEFAULT_NEAR_CLIP); | |
| 85 | + | |
| 81 | 86 | emit skeletonLoaded(); |
| 82 | 87 | } |
| 83 | 88 | |