Improved lerp interpolation
This commit is contained in:
10
client/math/Math.gd
Normal file
10
client/math/Math.gd
Normal file
@ -0,0 +1,10 @@
|
||||
class_name Math
|
||||
|
||||
static func damp(from: Variant, to: Variant, weight: float, smoothing: float = 0.75):
|
||||
return lerp(from, to, 1 - exp(-smoothing * weight))
|
||||
|
||||
static func dampf(from: float, to: float, weight: float, smoothing: float = 0.75):
|
||||
return lerpf(from, to, 1 - exp(-smoothing * weight))
|
||||
|
||||
static func damp_angle(from: float, to: float, weight: float, smoothing: float = 0.75):
|
||||
return lerp_angle(from, to, 1 - exp(-smoothing * weight))
|
Reference in New Issue
Block a user