From 75e36650e35d556fa9959ac0c9e1831a070fb2ef Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sat, 18 May 2013 11:04:29 +0000 Subject: Code cleanup / Cycles: * Simplify shaperadius() function a bit to avoid castings. * Style cleanup 1.f -> 1.0f, to follow rest of Cycles code. --- intern/cycles/blender/blender_curves.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'intern/cycles/blender/blender_curves.cpp') diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp index df00c8fd92e..56d78fb5c26 100644 --- a/intern/cycles/blender/blender_curves.cpp +++ b/intern/cycles/blender/blender_curves.cpp @@ -115,11 +115,12 @@ void curveinterp_v3_v3v3v3v3(float3 *p, float3 *v1, float3 *v2, float3 *v3, floa float shaperadius(float shape, float root, float tip, float time) { float radius = 1.0f - time; + if(shape != 0.0f) { if(shape < 0.0f) - radius = (float)pow(1.0f - time, 1.f + shape); + radius = powf(radius, 1.0f + shape); else - radius = (float)pow(1.0f - time, 1.f / (1.f - shape)); + radius = powf(radius, 1.0f / (1.0f - shape)); } return (radius * (root - tip)) + tip; } -- cgit v1.2.3