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

◆ GetLerpValue() [1/2]

static double Terraria.Utils.GetLerpValue ( double from,
double to,
double t,
bool clamped = false )
inlinestatic

Definition at line 325 of file Utils.cs.

326 {
327 if (clamped)
328 {
329 if (from < to)
330 {
331 if (t < from)
332 {
333 return 0.0;
334 }
335 if (t > to)
336 {
337 return 1.0;
338 }
339 }
340 else
341 {
342 if (t < to)
343 {
344 return 1.0;
345 }
346 if (t > from)
347 {
348 return 0.0;
349 }
350 }
351 }
352 return (t - from) / (to - from);
353 }