Reworking vehicle controller
This commit is contained in:
33
koptilnya/engine_remastered/differential.txt
Normal file
33
koptilnya/engine_remastered/differential.txt
Normal file
@@ -0,0 +1,33 @@
|
||||
-- @include ./wire_component.txt
|
||||
require('./wire_component.txt')
|
||||
|
||||
Differential = class('Differential', WireComponent)
|
||||
|
||||
function Differential:initialize(config)
|
||||
self.power = config.Power or 1
|
||||
self.coast = config.Coast or 1
|
||||
self.preload = config.Preload or 10
|
||||
|
||||
self.viscousCoeff = config.ViscousCoeff or 0.9
|
||||
self.usePowerBias = config.UsePowerBias or 10
|
||||
|
||||
self.distributionCoeff = config.DistributionCoeff or 1
|
||||
self.maxCorrectingTorque = config.MaxCorrectingTorque or 200
|
||||
|
||||
self.avgRPM = 0
|
||||
|
||||
self.leftWheel = nil
|
||||
self.rightWheel = nil
|
||||
end
|
||||
|
||||
function Differential:getInputs()
|
||||
local leftWheelName = 'Axle_' + self.order + '_LeftWheel'
|
||||
local rightWheelName = 'Axle_' + self.order + '_RightWheel'
|
||||
|
||||
local inputs = {}
|
||||
|
||||
inputs[leftWheelName] = 'entity'
|
||||
inputs[rightWheelName] = 'entity'
|
||||
|
||||
return inputs
|
||||
end
|
||||
Reference in New Issue
Block a user