- Add max steering lock and limit drift assist to never exceed it - Bring back tyre curve debug - Show relevant wheel debug values - Calculate camber for pacejka
15 lines
420 B
Odin
15 lines
420 B
Odin
// "Engine" math, to avoid aliasing with core:math
|
|
package emath
|
|
|
|
import "core:math"
|
|
|
|
_ :: math
|
|
|
|
exp_smooth :: proc "contextless" (target: $T, pos: T, speed: f32, dt: f32) -> T {
|
|
return pos + ((target - pos) * (1.0 - math.exp_f32(-speed * dt)))
|
|
}
|
|
|
|
exp_smooth_angle :: proc "contextless" (target: $T, pos: T, speed: f32, dt: f32) -> T {
|
|
return pos + (math.angle_diff(pos, target) * (1.0 - math.exp_f32(-speed * dt)))
|
|
}
|