| 161 | } |
| 162 | |
| 163 | float attenuateLinearDistance(float aDistance, float aMinDistance, float aMaxDistance, float aRolloffFactor) |
| 164 | { |
| 165 | float distance = MAX(aDistance, aMinDistance); |
| 166 | distance = MIN(distance, aMaxDistance); |
| 167 | return 1 - aRolloffFactor * (distance - aMinDistance) / (aMaxDistance - aMinDistance); |
| 168 | } |
| 169 | |
| 170 | float attenuateExponentialDistance(float aDistance, float aMinDistance, float aMaxDistance, float aRolloffFactor) |
| 171 | { |