From c4ad974909a1dfd61fe811b6921bb5b054bf1c0a Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 28 Jul 2010 22:22:39 +0200 Subject: [PATCH] Changed: #963 Floating point exceptions --- code/nel/src/3d/frustum.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/nel/src/3d/frustum.cpp b/code/nel/src/3d/frustum.cpp index 57b609839..7aac90dba 100644 --- a/code/nel/src/3d/frustum.cpp +++ b/code/nel/src/3d/frustum.cpp @@ -111,7 +111,7 @@ CVector CFrustum::projectZ(const CVector &vec) const CVector ret; float decalX, decalY; float w, h; - float OOw, OOh; + float OOw = 1.0f, OOh = 1.0f; // Fast transform to openGL like axis. CVector pt; @@ -123,8 +123,8 @@ CVector CFrustum::projectZ(const CVector &vec) const decalY= (Top+Bottom); w= Right-Left; h= Top-Bottom; - OOw= 1.0f/w; - OOh= 1.0f/h; + if (w) OOw /= w; + if (h) OOh /= h; // project to -1..+1. if(Perspective)