mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Don’t render head if inside it!
This commit is contained in:
parent
65340f1667
commit
2286916fbb
1 changed files with 7 additions and 1 deletions
|
@ -578,7 +578,13 @@ void MyAvatar::renderBody(bool forceRenderHead) {
|
|||
} else {
|
||||
// Render the body's voxels and head
|
||||
_skeletonModel.render(1.0f);
|
||||
_head.render(1.0f, false);
|
||||
|
||||
// Render head so long as the camera isn't inside it
|
||||
const float RENDER_HEAD_CUTOFF_DISTANCE = 0.10f;
|
||||
Camera* myCamera = Application::getInstance()->getCamera();
|
||||
if (forceRenderHead || (glm::length(myCamera->getPosition() - _head.calculateAverageEyePosition()) > RENDER_HEAD_CUTOFF_DISTANCE)) {
|
||||
_head.render(1.0f, false);
|
||||
}
|
||||
}
|
||||
_hand.render(true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue