mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 20:06:48 +02:00
Set clip distance on rendering frustum rather than camera
This fixes wrong clipping distance used for rendering in FPV if also have rear view mirror.
This commit is contained in:
parent
7b54443bda
commit
648a2e3b1d
1 changed files with 2 additions and 2 deletions
|
@ -1034,7 +1034,7 @@ void MyAvatar::renderBody(ViewFrustum* renderFrustum, RenderMode renderMode, boo
|
|||
|
||||
// Set near clip distance according to skeleton model dimensions if first person and there is no separate head model.
|
||||
if (shouldRenderHead(cameraPos, renderMode) || !getHead()->getFaceModel().getURL().isEmpty()) {
|
||||
camera->setNearClip(DEFAULT_NEAR_CLIP);
|
||||
renderFrustum->setNearClip(DEFAULT_NEAR_CLIP);
|
||||
} else {
|
||||
float clipDistance = _skeletonModel.getHeadClipDistance();
|
||||
if (OculusManager::isConnected()) {
|
||||
|
@ -1047,7 +1047,7 @@ void MyAvatar::renderBody(ViewFrustum* renderFrustum, RenderMode renderMode, boo
|
|||
clipDistance += headOffset;
|
||||
}
|
||||
}
|
||||
camera->setNearClip(clipDistance);
|
||||
renderFrustum->setNearClip(clipDistance);
|
||||
}
|
||||
|
||||
// Render the body's voxels and head
|
||||
|
|
Loading…
Reference in a new issue