diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-03-23 20:59:23 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-03-23 20:59:23 +0400 |
commit | 402a9d59383d68bff72b3c9da3e53f3e5abcd578 (patch) | |
tree | 3ea60347d2f95c15b57d1b2e5681f5504ed5d108 /source | |
parent | b331c867e1783cc1b3fa8c7ed88b022ddfda8436 (diff) |
Better smoothing for sculpt cube falloff.
The cube test, used by the clay strips brush, now smooths the corners
of the cube using the brush curve.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 6c665533fcb..dcb832ec31f 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -357,7 +357,11 @@ static int sculpt_brush_test_cube(SculptBrushTest *test, float co[3], float loca local_co[2] = fabs(local_co[2]); if (local_co[0] <= side && local_co[1] <= side && local_co[2] <= side) { - test->dist = MAX3(local_co[0], local_co[1], local_co[2]) / side; + float p = 4; + + test->dist = ((powf(local_co[0], p) + + powf(local_co[1], p) + + powf(local_co[2], p)) / pow(side, p)); return 1; } |