From 145289ad958e43b3f4f8475c581fca2180f6be88 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 12 May 2012 22:13:38 +0000 Subject: code cleanup: minor improvements to float/vector usage. --- source/blender/blenkernel/intern/curve.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/curve.c') diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 43cc63aefa6..d5dfcda77ce 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -588,7 +588,7 @@ void BKE_nurb_test2D(Nurb *nu) } } -void BKE_nurb_minmax(Nurb *nu, float *min, float *max) +void BKE_nurb_minmax(Nurb *nu, float min[3], float max[3]) { BezTriple *bezt; BPoint *bp; @@ -1166,19 +1166,23 @@ void BKE_curve_forward_diff_bezier(float q0, float q1, float q2, float q3, float } } -static void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float *p3, float *p, int it, int stride) +static void forward_diff_bezier_cotangent(const float p0[3], const float p1[3], const float p2[3], const float p3[3], + float p[3], int it, int stride) { /* note that these are not purpendicular to the curve * they need to be rotated for this, * - * This could also be optimized like forward_diff_bezier */ + * This could also be optimized like BKE_curve_forward_diff_bezier */ int a; for (a = 0; a <= it; a++) { float t = (float)a / (float)it; int i; for (i = 0; i < 3; i++) { - p[i] = (-6 * t + 6) * p0[i] + (18 * t - 12) * p1[i] + (-18 * t + 6) * p2[i] + (6 * t) * p3[i]; + p[i] = (-6.0f * t + 6.0f) * p0[i] + + ( 18.0f * t - 12.0f) * p1[i] + + (-18.0f * t + 6.0f) * p2[i] + + ( 6.0f * t) * p3[i]; } normalize_v3(p); p = (float *)(((char *)p) + stride); -- cgit v1.2.3