-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
As explained here: ByteArena/ba#15 (comment)
Pseudocode of current implementation (incorrect):
In pseudocode:
var curvelocity Vec2 = GetCurrentVelocity()
var newvelocity Vec2 = GetDesiredVelocity()
var maxSteeringForce Vec2 = GetMaxSteeringForce()
var curmag float64 = curvelocity.Mag()
var diff float64 = newvelocity.Mag() - curmag
if math.Abs(diff) > maxSteeringForce {
if diff > 0 {
newvelocity = newvelocity.SetMag(curmag + maxSteeringForce)
} else {
newvelocity = newvelocity.SetMag(curmag - maxSteeringForce)
}
}The current implementation is incorrect as it does not take into account the changes of direction between the two velocities.