Improved third person camera

This commit is contained in:
2024-02-21 20:15:11 +01:00
parent 4e632608e1
commit ffe3142937
10 changed files with 137 additions and 134 deletions

View File

@ -9,6 +9,9 @@ static func dampf(from: float, to: float, weight: float, smoothing: float = 0.75
static func damp_angle(from: float, to: float, weight: float, smoothing: float = 0.75):
return lerp_angle(from, to, 1 - exp(-smoothing * weight))
static func damp_spherical(from: Vector3, to: Vector3, weight: float, smoothing: float = 0.75):
return from.slerp(to, 1 - exp(-smoothing * weight))
static func from_to_rotation(from: Vector3, to: Vector3) -> Quaternion:
var axis := from.cross(to).normalized()
var angle := from.angle_to(to)