mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Added generic Lerp
This commit is contained in:
parent
bec6f1d007
commit
e72cfc6d96
1 changed files with 10 additions and 0 deletions
|
@ -348,6 +348,16 @@ namespace System
|
|||
return val1 + (val2 - val1) * pct;
|
||||
}
|
||||
|
||||
public static T Lerp<T>(T val1, T val2, float pct) where T : operator T + T, operator T - T, operator T * float
|
||||
{
|
||||
return val1 + (val2 - val1) * pct;
|
||||
}
|
||||
|
||||
public static T Lerp<T>(T val1, T val2, double pct) where T : operator T + T, operator T - T, operator T * double
|
||||
{
|
||||
return val1 + (val2 - val1) * pct;
|
||||
}
|
||||
|
||||
public static T Min<T>(T val1, T val2) where T : IOpComparable, IIsNaN
|
||||
{
|
||||
if (val1 < val2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue