UI windows

This commit is contained in:
2024-12-29 19:14:10 +01:00
parent e80843c9de
commit 4ac24fa03c
4 changed files with 68 additions and 9 deletions

View File

@@ -231,14 +231,14 @@ smooth_damp :: (current: float, target: float, current_velocity: *float, smooth_
change = clamp(change, -max_change, max_change);
target = current - change;
temp := (<<current_velocity + omega * change) * delta_time;
<<current_velocity = (<<current_velocity - omega * temp) * exp;
temp := (current_velocity.* + omega * change) * delta_time;
current_velocity.* = (current_velocity.* - omega * temp) * exp;
output := target + (change + temp) * exp;
// Prevent overshooting
if (original_to - current > 0.0) == (output > original_to) {
output = original_to;
<<current_velocity = (output - original_to) / delta_time;
current_velocity.* = (output - original_to) / delta_time;
}
return output;