16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 02:29:17 +02:00

Add wiper animation

This commit is contained in:
2025-03-06 22:51:24 +01:00
parent d832ce3d96
commit b5172e940b
10 changed files with 330 additions and 6 deletions

View File

@@ -335,6 +335,14 @@ interpolate( Type_ const &First, Type_ const &Second, double const Factor ) {
return static_cast<Type_>( ( First * ( 1.0 - Factor ) ) + ( Second * Factor ) );
}
template <typename Type_> Type_ smoothInterpolate(Type_ const &First, Type_ const &Second, double Factor)
{
// Apply smoothing (ease-in-out quadratic)
Factor = Factor * Factor * (3 - 2 * Factor);
return static_cast<Type_>((First * (1.0 - Factor)) + (Second * Factor));
}
// tests whether provided points form a degenerate triangle
template <typename VecType_>
bool