-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continue major restructure of the project
- Loading branch information
Showing
5 changed files
with
48 additions
and
15 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
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,6 @@ | ||
|
||
|
||
set(ccmath_extensions_headers | ||
${CMAKE_CURRENT_SOURCE_DIR}/include/ccmath/extensions/slerp.hpp | ||
|
||
) |
This file was deleted.
Oops, something went wrong.
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 |
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 |
---|---|---|
|
@@ -10,5 +10,10 @@ | |
|
||
namespace ccm | ||
{ | ||
template<typename T> | ||
inline constexpr T exp2(T x) | ||
{ | ||
return 0; | ||
} | ||
|
||
} // namespace ccm |