cut11b: compute direct bounded joint error in StepDof without +-pi wrapback
This commit is contained in:
parent
1f35274dab
commit
1bbf0c9eee
1 changed files with 1 additions and 1 deletions
|
|
@ -2112,7 +2112,7 @@ namespace RustToDust.Ymir
|
||||||
float recoilTorque,
|
float recoilTorque,
|
||||||
float dt)
|
float dt)
|
||||||
{
|
{
|
||||||
float err = MatchRules.NormalizeAngle(target - theta);
|
float err = target - theta;
|
||||||
float tau = Math.Clamp(kp * err - kd * omega, -tauMax, tauMax) + recoilTorque;
|
float tau = Math.Clamp(kp * err - kd * omega, -tauMax, tauMax) + recoilTorque;
|
||||||
omega += (tau / inertia) * dt;
|
omega += (tau / inertia) * dt;
|
||||||
theta = Math.Clamp(theta + omega * dt, -3.08f, 3.08f);
|
theta = Math.Clamp(theta + omega * dt, -3.08f, 3.08f);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue