diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 02:13:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 02:13:38 +0400 |
commit | 145289ad958e43b3f4f8475c581fca2180f6be88 (patch) | |
tree | 5f6d6081166a3459fb5beacd9fa99f62d33000fb /source/blender/blenkernel/intern/curve.c | |
parent | a88f910b9a21e284a2d742213f7c01ed13ddd751 (diff) |
code cleanup: minor improvements to float/vector usage.
Diffstat (limited to 'source/blender/blenkernel/intern/curve.c')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 12 |
1 files changed, 8 insertions, 4 deletions
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); |