History

Set clip near distance per skeleton model if no separate head model

David Rowe committed 11 years ago

Commit a04bd091 parent 468b62e3 files · +22 −4Browse files

Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 3 files). Show all

Unified · Split

interface/src/avatar/SkeletonModel.cpp+6−1
@@ -37,7 +37,8 @@ SkeletonModel::SkeletonModel(Avatar* owningAvatar, QObject* parent) : · 36 unmodified lines
3737 _defaultEyeModelPosition(glm::vec3(0.0f, 0.0f, 0.0f)),
3838 _standingFoot(NO_FOOT),
3939 _standingOffset(0.0f),
40− _clampedFootPosition(0.0f)
40+ _clampedFootPosition(0.0f),
41+ _headClipDistance(DEFAULT_NEAR_CLIP)
4142 {
4243 }
4344
@@ -78,6 +79,10 @@ void SkeletonModel::setJointStates(QVector<JointState> states) { · 34 unmodified lines
7879 buildShapes();
7980 }
8081
82+ Extents meshExtents = getMeshExtents();
83+ _headClipDistance = -(meshExtents.minimum.z / _scale.z - _defaultEyeModelPosition.z);
84+ _headClipDistance = std::max(_headClipDistance, DEFAULT_NEAR_CLIP);
85+
8186 emit skeletonLoaded();
8287 }
8388

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t