UI windows
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user