diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-04-26 11:31:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-04-26 11:31:54 +0300 |
commit | c2f7cffd56afffcceda11813a3dcc0a93d84673a (patch) | |
tree | 76c1f5e70b86e3c8a9b8e750be99d1b7ca2996fd /source/blender/bmesh | |
parent | d33314393ebb7ce68ee599fb4f3e07bcb7983759 (diff) |
Add inverse-square falloff to bmesh, mask & compo.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operators.h | 1 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_queries.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operators.h b/source/blender/bmesh/intern/bmesh_operators.h index d2ce2faf09d..d9961e589da 100644 --- a/source/blender/bmesh/intern/bmesh_operators.h +++ b/source/blender/bmesh/intern/bmesh_operators.h @@ -46,6 +46,7 @@ enum { SUBD_FALLOFF_ROOT, SUBD_FALLOFF_SHARP, SUBD_FALLOFF_LIN, + SUBD_FALLOFF_INVSQUARE = 7, /* matching PROP_INVSQUARE */ }; enum { diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index 1e0b1f21381..61328a525f1 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -2419,6 +2419,9 @@ float bmesh_subd_falloff_calc(const int falloff, float val) break; case SUBD_FALLOFF_LIN: break; + case SUBD_FALLOFF_INVSQUARE: + val = val * (2.0f - val); + break; default: BLI_assert(0); break; |