TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ MultiLerp()

static float Terraria.Utils.MultiLerp ( float percent,
params float[] floats )
inlinestatic

Definition at line 189 of file Utils.cs.

190 {
191 float num = 1f / ((float)floats.Length - 1f);
192 float num2 = num;
193 int num3 = 0;
194 while (percent / num2 > 1f && num3 < floats.Length - 2)
195 {
196 num2 += num;
197 num3++;
198 }
199 return MathHelper.Lerp(floats[num3], floats[num3 + 1], (percent - num * (float)num3) / num);
200 }

Referenced by Terraria.DelegateMethods.CharacterPreview.CompanionCubePet(), Terraria.NPC.GetAttackDamage_ForProjectiles_MultiLerp(), and Terraria.DelegateMethods.CharacterPreview.SlimePet().

+ Here is the caller graph for this function: