Game Development Reference
In-Depth Information
Cell falloff
The influence falloff is the second attribute that determines how influence will spread and
has the same value range from 0 to 1. When calculating how much influence a given cell
should have, the 26 surrounding cells are considered using an exponential falloff based on
their distance to the current cell.
Internally, each of the 26 cells is evaluated based on the following function:
cellInfluence = powf((1.0f - falloff), distanceToCell) *
falloff;
The maximum and minimum evaluations of the 26 cells are then summed together to create
the final influence that will be used to interpolate toward the cell's current influence based
on the inertia:
Sandbox.SetFalloff(sandbox, influenceMapLayer, falloffValue);
Setting a falloff of 50 percent results in the following type of influence spread, as shown:
Falloff of 0.5—50 percent falloff
Search WWH ::




Custom Search