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 usePower = self.gearbox and self.gearbox.torque > self.usePowerBias or false
local usedCoeff = usePower and self.power or self.coast local usedCoeff = usePower and self.power or self.coast
local lwPowerCoeff = 1 -- usedCoeff local lwPowerCoeff = usedCoeff
local rwPowerCoeff = 1 -- usedCoeff local rwPowerCoeff = usedCoeff
-- this could probably be shortened? -- this could probably be shortened?
if lwtq - rwtq > self.preload then -- if lwtq - rwtq > self.preload then
lwPowerCoeff = 1 + (1 - usedCoeff) -- lwPowerCoeff = usedCoeff
rwPowerCoeff = usedCoeff -- rwPowerCoeff = usedCoeff
end -- end
if rwtq - lwtq > self.preload then -- if rwtq - lwtq > self.preload then
lwPowerCoeff = usedCoeff -- lwPowerCoeff = usedCoeff
rwPowerCoeff = 1 + (1 - usedCoeff) -- rwPowerCoeff = usedCoeff
end -- end
local lwCorrectingTorque = math.clamp(lwDampingTorque * lwPowerCoeff, -self.maxCorrectingTorque, local lwCorrectingTorque = math.clamp(lwDampingTorque * lwPowerCoeff, -self.maxCorrectingTorque,
self.maxCorrectingTorque) self.maxCorrectingTorque)