From 303be4bbd0c358677b1b18630c138fab43223eb3 Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Thu, 24 Dec 2015 10:55:48 +0000 Subject: [PATCH] templated FibonacciPt function on ScalarType --- vcg/math/gen_normal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcg/math/gen_normal.h b/vcg/math/gen_normal.h index 6e94bcb2..3087d09a 100644 --- a/vcg/math/gen_normal.h +++ b/vcg/math/gen_normal.h @@ -62,7 +62,7 @@ static Point3x FibonacciPt(int i, int n) const ScalarType Phi = ScalarType(sqrt(5)*0.5 + 0.5); const ScalarType phi = 2.0*M_PI* (i/Phi - floor(i/Phi)); ScalarType cosTheta = 1.0 - (2*i + 1.0)/ScalarType(n); - float sinTheta = 1 - cosTheta*cosTheta; + ScalarType sinTheta = 1 - cosTheta*cosTheta; sinTheta = sqrt(std::min(ScalarType(1),std::max(ScalarType(0),sinTheta))); return Point3x( cos(phi)*sinTheta,