Fixed bookmark jump transition bug
This commit is contained in:
parent
bacca9ff68
commit
4aa810fe43
7 changed files with 21 additions and 9 deletions
|
|
@ -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)};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue