generated from Persson-dev/OpenGLComputeShader
format ...
This commit is contained in:
@@ -199,13 +199,9 @@ static void CreateGpuBuffer() {
|
|||||||
static std::vector<glm::mat4> GetTransformMatrixBlended(float dt) {
|
static std::vector<glm::mat4> GetTransformMatrixBlended(float dt) {
|
||||||
std::vector<glm::mat4> result(TRANSFORMATION_COUNT);
|
std::vector<glm::mat4> result(TRANSFORMATION_COUNT);
|
||||||
|
|
||||||
constexpr auto lerp = [](float x, float y, float t){
|
constexpr auto lerp = [](float x, float y, float t) { return x * (1 - t) + y * t; };
|
||||||
return x * (1 - t) + y * t;
|
|
||||||
};
|
|
||||||
|
|
||||||
constexpr auto eased = [lerp](float x, float y, float t){
|
constexpr auto eased = [lerp](float x, float y, float t) { return lerp(x, y, -(std::cos(3.14 * t) - 1.0f) / 2.0f); };
|
||||||
return lerp(x, y, -(std::cos(3.14 * t) - 1.0f) / 2.0f);
|
|
||||||
};
|
|
||||||
|
|
||||||
float blendFactor = std::min(ANIMATION_TIME, dt) / ANIMATION_TIME;
|
float blendFactor = std::min(ANIMATION_TIME, dt) / ANIMATION_TIME;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user