From 4392fc6f1d4950ab0e0e60aae1bd5dea5baf26de Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 10 May 2013 10:07:01 +0000 Subject: Optimize BKE_mesh_calc_normals(), gives approx 25% speedup. - no need to allocate polygon normal array. - no need to use BLI_array_ functions (realloc's). - reduce some of the looping. --- source/blender/blenlib/BLI_math_geom.h | 4 ++-- source/blender/blenlib/intern/math_geom.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index ad846823669..4ebb1a1a1d9 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -237,8 +237,8 @@ void accumulate_vertex_normals(float n1[3], float n2[3], float n3[3], float n4[3], const float f_no[3], const float co1[3], const float co2[3], const float co3[3], const float co4[3]); -void accumulate_vertex_normals_poly(float **vertnos, float polyno[3], - float **vertcos, float vdiffs[][3], int nverts); +void accumulate_vertex_normals_poly(float **vertnos, const float polyno[3], + const float **vertcos, float vdiffs[][3], const int nverts); /********************************* Tangents **********************************/ diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index c8de9108fc3..5811bb51012 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -3107,8 +3107,8 @@ void accumulate_vertex_normals(float n1[3], float n2[3], float n3[3], /* Add weighted face normal component into normals of the face vertices. * Caller must pass pre-allocated vdiffs of nverts length. */ -void accumulate_vertex_normals_poly(float **vertnos, float polyno[3], - float **vertcos, float vdiffs[][3], int nverts) +void accumulate_vertex_normals_poly(float **vertnos, const float polyno[3], + const float **vertcos, float vdiffs[][3], int nverts) { int i; -- cgit v1.2.3