Revert last commit

This commit is contained in:
Ivan Grachyov 2021-11-13 02:13:35 +05:00
parent 675bc6bf44
commit 1a2aea0fdb

View File

@ -76,19 +76,19 @@ function Differential:update()
local usePower = self.gearbox and self.gearbox.torque > self.usePowerBias or false
local usedCoeff = usePower and self.power or self.coast
local lwPowerCoeff = 1 -- usedCoeff
local rwPowerCoeff = 1 -- usedCoeff
local lwPowerCoeff = usedCoeff
local rwPowerCoeff = usedCoeff
-- this could probably be shortened?
if lwtq - rwtq > self.preload then
lwPowerCoeff = 1 + (1 - usedCoeff)
rwPowerCoeff = usedCoeff
end
-- if lwtq - rwtq > self.preload then
-- lwPowerCoeff = usedCoeff
-- rwPowerCoeff = usedCoeff
-- end
if rwtq - lwtq > self.preload then
lwPowerCoeff = usedCoeff
rwPowerCoeff = 1 + (1 - usedCoeff)
end
-- if rwtq - lwtq > self.preload then
-- lwPowerCoeff = usedCoeff
-- rwPowerCoeff = usedCoeff
-- end
local lwCorrectingTorque = math.clamp(lwDampingTorque * lwPowerCoeff, -self.maxCorrectingTorque,
self.maxCorrectingTorque)