mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 12:38:27 +02:00
Fix for screwy view when you lean too far forward.
This commit is contained in:
parent
1b4daa8eb9
commit
dfd5f7d53e
1 changed files with 4 additions and 0 deletions
|
@ -401,6 +401,10 @@ void ViewFrustum::computeOffAxisFrustum(float& left, float& right, float& bottom
|
||||||
far = max(far, -corners[i].z);
|
far = max(far, -corners[i].z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make sure the near clip isn't too small to be valid
|
||||||
|
const float MIN_NEAR = 0.01f;
|
||||||
|
near = max(MIN_NEAR, near);
|
||||||
|
|
||||||
// get the near/far normal and use it to find the clip planes
|
// get the near/far normal and use it to find the clip planes
|
||||||
glm::vec4 normal = eyeMatrix * glm::vec4(0.0f, 0.0f, 1.0f, 0.0f);
|
glm::vec4 normal = eyeMatrix * glm::vec4(0.0f, 0.0f, 1.0f, 0.0f);
|
||||||
nearClipPlane = glm::vec4(-normal.x, -normal.y, -normal.z, glm::dot(normal, corners[0]));
|
nearClipPlane = glm::vec4(-normal.x, -normal.y, -normal.z, glm::dot(normal, corners[0]));
|
||||||
|
|
Loading…
Reference in a new issue