diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2007-03-17 23:11:50 +0300 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2007-03-17 23:11:50 +0300 |
commit | 6b4f197983c013707e23a69628f26dcb0b2b9c5a (patch) | |
tree | c185737b47f60c3d55aad5ce749b4ced1bccbccf /source/blender/src/sculptmode.c | |
parent | afadfa54bd502d7eddd05a3c7298e696c572a3aa (diff) |
== Sculpt Mode ==
Added a #define for the number of vertices the flatten brush should sample when calculating the distance to flatten to.
Diffstat (limited to 'source/blender/src/sculptmode.c')
-rw-r--r-- | source/blender/src/sculptmode.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c index 5091f8e9c7a..7c9a2259a3c 100644 --- a/source/blender/src/sculptmode.c +++ b/source/blender/src/sculptmode.c @@ -98,6 +98,9 @@ #include <stdlib.h> #include <string.h> +/* Number of vertices to average in order to determine the flatten distance */ +#define FLATTEN_SAMPLE_SIZE 10 + /* ===== STRUCTS ===== * */ @@ -659,15 +662,14 @@ void do_inflate_brush(const EditData *e, const ListBase *active_verts) void calc_flatten_center(Mesh *me, ActiveData *node, const EditData *e, float co[3]) { - const int FTOT = 10; - ActiveData *outer[10]; + ActiveData *outer[FLATTEN_SAMPLE_SIZE]; int i; - for(i = 0; i < FTOT; ++i) + for(i = 0; i < FLATTEN_SAMPLE_SIZE; ++i) outer[i] = node; for(; node; node = node->next) { - for(i = 0; i < FTOT; ++i) { + for(i = 0; i < FLATTEN_SAMPLE_SIZE; ++i) { if(node->dist > outer[i]->dist) { outer[i] = node; break; @@ -676,9 +678,9 @@ void calc_flatten_center(Mesh *me, ActiveData *node, const EditData *e, float co } co[0] = co[1] = co[2] = 0.0f; - for(i = 0; i < FTOT; ++i) + for(i = 0; i < FLATTEN_SAMPLE_SIZE; ++i) VecAddf(co, co, me->mvert[outer[i]->Index].co); - VecMulf(co, 1.0f / FTOT); + VecMulf(co, 1.0f / FLATTEN_SAMPLE_SIZE); } void do_flatten_brush(const EditData *e, const ListBase *active_verts) |