mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 02:25:41 +00:00
Aggressively inline LerpInternal
This commit is contained in:
parent
f6b885b46b
commit
8976993cee
@ -135,12 +135,12 @@ namespace X10D.DoubleExtensions
|
|||||||
return Math.Round(value / nearest) * nearest;
|
return Math.Round(value / nearest) * nearest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
private static double LerpInternal(double a, double b, double t)
|
private static double LerpInternal(double a, double b, double t)
|
||||||
{
|
{
|
||||||
// rookie mistake: a + t * (b - a)
|
// rookie mistake: a + t * (b - a)
|
||||||
|
|
||||||
// "precise" method: (1 - t) * a + t * b
|
// "precise" method: (1 - t) * a + t * b
|
||||||
return (1 - t) * a + t * b;
|
return (1.0 - t) * a + t * b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user