Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-05-10 14:07:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-10 14:07:01 +0400
commit4392fc6f1d4950ab0e0e60aae1bd5dea5baf26de (patch)
tree119985340414ffbbf749ef0ef41efdacf7cdd8c5 /source/blender/blenlib
parenta961b683fc62f893e70d9e0fbf80ed4d1e31b857 (diff)
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.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_math_geom.h4
-rw-r--r--source/blender/blenlib/intern/math_geom.c4
2 files changed, 4 insertions, 4 deletions
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;