From 858ee3d3220c973e46e956e063e248885529d712 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sun, 29 Nov 2009 10:29:51 +0000 Subject: [PATCH] Fix problems of diasappearing trees / smoke --- src/Billboard.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Billboard.cpp b/src/Billboard.cpp index f001a2b..0f38076 100644 --- a/src/Billboard.cpp +++ b/src/Billboard.cpp @@ -203,8 +203,8 @@ void CylindricalBillboard::realRender() const // perform the rotation. The if statement is used for stability reasons // if the lookAt and objToCamProj vectors are too close together then // |angleCosine| could be bigger than 1 due to lack of precision - if ((angleCosine < 0.99990) && (angleCosine > -0.9999)) - glRotatef(acos(angleCosine)*180/3.14, upAux.x, upAux.y, upAux.z); + //if ((angleCosine < 0.999999f) && (angleCosine > -0.999999f)) + glRotatef(acos(angleCosine)*180.0f/M_PI, upAux.x, upAux.y, upAux.z); drawTextureQuad(); @@ -261,8 +261,7 @@ void SphericalBillboard::realRender() const // perform the rotation. The if statement is used for stability reasons // if the lookAt and objToCamProj vectors are too close together then // |angleCosine| could be bigger than 1 due to lack of precision - if ((angleCosine < 0.99990) && (angleCosine > -0.9999)) - glRotatef(acos(angleCosine)*180/3.14, upAux.x, upAux.y, upAux.z); + glRotatef(acos(angleCosine)*180.0f/M_PI, upAux.x, upAux.y, upAux.z); // so far it is just like the cylindrical billboard. The code for the // second rotation comes now @@ -280,7 +279,6 @@ void SphericalBillboard::realRender() const angleCosine = objToCamProj.dot(objToCam); - // Tilt the object. The test is done to prevent instability // when objToCam and objToCamProj have a very small // angle between them -- 2.39.2