-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/Rinzii/ccmath into dev
- Loading branch information
Showing
12 changed files
with
574 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
Checks: '-*, | ||
-modernize-use-trailing-return-type, | ||
bugprone-*, | ||
-bugprone-easily-swappable-parameters, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
) | ||
|
||
|
||
set(ccmath_extensions_headers | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) 2024-Present Ian Pike | ||
* Copyright (c) 2024-Present ccmath contributors | ||
* | ||
* This library is provided under the MIT License. | ||
* See LICENSE for more information. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "ccmath/math/exponential/exp2.hpp" | ||
|
||
namespace ccm::ext | ||
{ | ||
/** | ||
* @brief Frame rate independent linear interpolation smoothing. | ||
* @tparam T Type of the input and output. | ||
* @param a Current value. | ||
* @param b Target value. | ||
* @param t Delta time, in seconds. | ||
* @param h Half-life, time until halfway, in seconds. | ||
* @return The smoothed value. | ||
* | ||
* @warning Currently waiting on ccm::exp2 to be implemented. Till then this will NOT work. | ||
*/ | ||
template<typename T> | ||
inline constexpr T slerp(T a, T b, T t, T h) | ||
{ | ||
return b + (a - b) * ccm::exp2<T>(-t / h); | ||
} | ||
} // namespace ccm::ext |
Oops, something went wrong.