Lerp function

This commit is contained in:
Joaquin 2022-08-03 05:01:52 -06:00
parent 389b3e9c87
commit d34e16b0d3

View File

@ -193,8 +193,6 @@ namespace cheat::feature
selectedIndexName = name; selectedIndexName = name;
} }
app::Vector3 Lerp(const app::Vector3 &a, const app::Vector3 &b, float t) { return a + (b - a) * t; }
void CustomTeleports::DrawMain() void CustomTeleports::DrawMain()
{ {
// Buffers // Buffers
@ -381,7 +379,7 @@ namespace cheat::feature
app::Vector3 zero = {0,0,0}; app::Vector3 zero = {0,0,0};
auto newPos = zero, speed = zero; auto newPos = zero, speed = zero;
while (t <= 1.0f) { while (t <= 1.0f) {
newPos = Lerp(avatarPos, endPos, t); newPos = app::Vector3_Lerp(avatarPos, endPos, t, nullptr);
manager.avatar()->setAbsolutePosition(newPos); manager.avatar()->setAbsolutePosition(newPos);
t += 0.01f; t += 0.01f;
LOG_DEBUG("newpos: %s, completion rate: %.02f%%", il2cppi_to_string(newPos).c_str(), t * 100.0f); LOG_DEBUG("newpos: %s, completion rate: %.02f%%", il2cppi_to_string(newPos).c_str(), t * 100.0f);