mirror of
https://github.com/overte-org/overte.git
synced 2025-05-08 21:58:48 +02:00
workaround for assert failures when bad view frustum input
This commit is contained in:
parent
ef68f164c9
commit
4bf7faba7b
1 changed files with 5 additions and 3 deletions
|
@ -129,7 +129,9 @@ void ViewFrustum::calculate() {
|
||||||
|
|
||||||
// Also calculate our projection matrix in case people want to project points...
|
// Also calculate our projection matrix in case people want to project points...
|
||||||
// Projection matrix : Field of View, ratio, display range : near to far
|
// Projection matrix : Field of View, ratio, display range : near to far
|
||||||
glm::mat4 projection = glm::perspective(_fieldOfView, _aspectRatio, _nearClip, _farClip);
|
const float CLIP_NUDGE = 1.0f;
|
||||||
|
float farClip = (_farClip != _nearClip) ? _farClip : _nearClip + CLIP_NUDGE; // don't allow near and far to be equal
|
||||||
|
glm::mat4 projection = glm::perspective(_fieldOfView, _aspectRatio, _nearClip, farClip);
|
||||||
glm::vec3 lookAt = _position + _direction;
|
glm::vec3 lookAt = _position + _direction;
|
||||||
glm::mat4 view = glm::lookAt(_position, lookAt, _up);
|
glm::mat4 view = glm::lookAt(_position, lookAt, _up);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue