Example #1
0
func Mathf_LerpAngle(a, b, t float64) (r float64) {
	if r = Mathf_Repeat(b-a, 360); r > 180 {
		r -= 360
	}
	r = unum.Clamp01(t)*r + a
	return
}
Example #2
0
func Mathf_Lerp(from, to, t float64) float64 {
	return unum.Clamp01(t)*(to-from) + from
}
Example #3
0
func Mathf_SmoothStep(from, to, t float64) float64 {
	t = unum.Clamp01(t)
	t = -2*t*t*t + 3*t*t
	return to*t + from*(1-t)
}