Page MenuHome

Force Fields: implement new true power and linear falloff options.
Needs ReviewPublic

Authored by Alexander Gavrilov (angavrilov) on Fri, Jun 19, 1:03 PM.



The 'power' falloff option in Blender force fields does not actually
generate a true power falloff function, as pointed out in D2389.
However, that patch adds a special 'gravity' falloff option to Force
fields, without addressing the shortcoming in the common options.

The reason for not using the true curve in the options, as far as
one can tell, is that the power curve goes up to infinity as the
distance is reduced to 0, while the falloff options are designed
so that the maximum value of the curve is 1.

However, in reality forces with a power falloff don't actually go
to infinity, because real objects have a nonzero size, and the force
reaches its maximum at the surface of the object. This can be used
to integrate an option to use a true power falloff with the design
of falloff settings, if it requires a nonzero 'minimum' distance
to be set, and uses a curve that reaches 1 at that distance.

Since this is adding a new feature to the minimum distance value,
it is also a good opportunity to add a feature to the maximum
distance. Specifically, the new blend option can be used to create
a linear falloff between min and max, or remove the jump to 0 at
max if combined with power.

Diff Detail

rB Blender
temp-angavrilov-force-falloff (branched from master)
Build Status
Buildable 8648
Build 8648: arc lint + arc unit

Event Timeline

Alexander Gavrilov (angavrilov) requested review of this revision.Fri, Jun 19, 1:03 PM

Some tweaks and renamed the option.


Perhaps cast these two new options to bool here?
So bool instead of int.

I don't see any reason to use int as it seems like they are used as bools either way in the code.


I just copied the other similar parameters. Probably the reason they are int is to avoid the need for cast from bit flag to boolean.