Fixed bookmark jump transition bug

This commit is contained in:
Yousef Khadadeh 2026-04-09 10:20:40 +03:00
parent bacca9ff68
commit 4aa810fe43
7 changed files with 21 additions and 9 deletions

View file

@ -21,7 +21,7 @@ TimePoint::operator float() const {
return get_time_since();
}
bool smooth_two_way_time(float& timeToUpdate, float deltaTime, bool isWay1, float animDuration) {
bool smooth_two_way_animation_time_check_for_change(float& timeToUpdate, float deltaTime, bool isWay1, float animDuration) {
float newTimeToUpdate = std::clamp(isWay1 ? (timeToUpdate + deltaTime) : (timeToUpdate - deltaTime), 0.0f, animDuration);
if(newTimeToUpdate != timeToUpdate) {
timeToUpdate = newTimeToUpdate;
@ -30,6 +30,15 @@ bool smooth_two_way_time(float& timeToUpdate, float deltaTime, bool isWay1, floa
return false;
}
float smooth_two_way_animation_time_get_lerp(float& timeToUpdate, float deltaTime, bool isWay1, float animDuration) {
timeToUpdate = std::clamp(isWay1 ? (timeToUpdate + deltaTime) : (timeToUpdate - deltaTime), 0.0f, animDuration);
return timeToUpdate / animDuration;
}
void smooth_two_way_animation_time(float& timeToUpdate, float deltaTime, bool isWay1, float animDuration) {
timeToUpdate = std::clamp(isWay1 ? (timeToUpdate + deltaTime) : (timeToUpdate - deltaTime), 0.0f, animDuration);
}
WorldVec lerp_world_vec_double(const WorldVec& v1, const WorldVec& v2, double t) {
return {FixedPoint::lerp_double(v1.x(), v2.x(), t), FixedPoint::lerp_double(v1.y(), v2.y(), t)};
}