Tweak for smoothing limits in stretch-constraint volume preservation.
Uses a arctan instead of sine function now, which has the advantage of not overestimating the bulging.
This commit is contained in:
parent
c08e7e1dc0
commit
0297763afa
|
@ -1 +1 @@
|
|||
Subproject commit c980697651ad7f21a7cd8ad23dc26e482b5fa752
|
||||
Subproject commit 841b1b9f494b6f980da4e244bbd86ecb8a8ac0b7
|
|
@ -1 +1 @@
|
|||
Subproject commit c210f87f12929bbd0884db7bf76baa3f1eed7b02
|
||||
Subproject commit fd695c3a81b63db072311e8516e0dbb8d4474047
|
|
@ -2693,11 +2693,9 @@ static void stretchto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
|
|||
const float bulge_median = ((data->flag & STRETCHTOCON_USE_BULGE_MIN) ?
|
||||
0.5f * (data->bulge_min + data->bulge_max) : 0.0f);
|
||||
const float bulge_range = data->bulge_max - bulge_median;
|
||||
float x, bulge_smoothed;
|
||||
float bulge_smoothed;
|
||||
|
||||
x = bulge_range != 0.0f ? (bulge - bulge_median) / bulge_range : 0.0f;
|
||||
CLAMP(x, -1.0f, 1.0f);
|
||||
bulge_smoothed = bulge_median + bulge_range * sinf(0.5f*M_PI * x);
|
||||
bulge_smoothed = bulge_median + bulge_range * atanf(bulge - bulge_median) / (0.5f * M_PI);
|
||||
|
||||
if (data->flag & STRETCHTOCON_USE_BULGE_MIN) {
|
||||
CLAMP_MIN(bulge, data->bulge_min);
|
||||
|
|
Loading…
Reference in New Issue