diff options
author | Thomas Dinges <blender@dingto.org> | 2013-05-18 15:04:29 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-05-18 15:04:29 +0400 |
commit | 75e36650e35d556fa9959ac0c9e1831a070fb2ef (patch) | |
tree | abaebe762b1589d2570cb25a63deca8541e7bc72 /intern/cycles/blender/blender_curves.cpp | |
parent | f314ff02bda2ad959b6dc374d090047d270cd885 (diff) |
Code cleanup / Cycles:
* Simplify shaperadius() function a bit to avoid castings.
* Style cleanup 1.f -> 1.0f, to follow rest of Cycles code.
Diffstat (limited to 'intern/cycles/blender/blender_curves.cpp')
-rw-r--r-- | intern/cycles/blender/blender_curves.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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; } |