Ref T668, clamp time fraction [0,1]

This commit is contained in:
Klaus Basan
2019-05-16 14:43:11 +02:00
parent 2c53846a96
commit 848f54d4a7
3 changed files with 18 additions and 8 deletions

View File

@@ -21,6 +21,12 @@ namespace BlackMisc
return timeFraction >= 0.0 && timeFraction <= 1.0;
}
//! Valid time fraction [0,1], this allows minor overshooting
inline bool isAcceptableTimeFraction(double timeFraction)
{
return timeFraction >= 0.0 && timeFraction <= 1.01;
}
//! Clamp time fraction [0,1]
inline double clampValidTimeFraction(double timeFraction)
{