VE Lua Documentation

Press F to search!

setFFBConfig

Definition


-- @/lua/vehicle/hydros.lua:589

local function setFFBConfig(ffbParams)
  if ffbParams.forceCoef ~= nil then M.wheelFFBForceCoef = ffbParams.forceCoef end
  if ffbParams.softlockForce ~= nil then softlockForceCoef = clamp(ffbParams.softlockForce, 0 ,1) end
  if ffbParams.smoothing ~= nil then wheelFFBSmoothing = ffbParams.smoothing * 0.7 end
  if ffbParams.gforceCoef ~= nil then M.GforceCoef = ffbParams.gforceCoef  end
  if ffbParams.enableThrottleForceFeedback ~= nil then M.enableThrottleForceFeedback = ffbParams.enableThrottleForceFeedback end
  if ffbParams.enableBrakeForceFeedback ~= nil then M.enableBrakeForceFeedback = ffbParams.enableBrakeForceFeedback end

  wheelFFBSmoothing2automatic = ffbParams.smoothing2automatic ~= false
  -- IMPORTANT: these equations exist in 3 places in hydros.lua, 2 places in options.js, and 1 place in bindings.lua
  if wheelFFBSmoothing2automatic then
    wheelFFBSmoothing2 = max(5000, (500 - wheelFFBSmoothing)*100+5000)
  else
    wheelFFBSmoothing2 = ffbParams.smoothing2 * 109 + 500
  end

  turnOffFFBInterfaces()
end

Callers

@/ui/ui-vue/mockdata/inputBindings.js
                "title": "ui.inputActions.vehicle.ffbForceCoefDec.title",
                "onDown": "local c = hydros.getFFBConfig(); c.forceCoef = c.forceCoef - 10; hydros.setFFBConfig(c) ui_message('Testing FFB strength at  '..dumps(c.forceCoef))",
                "order": 61,
                "title": "ui.inputActions.vehicle.ffbSmoothingDec.title",
                "onDown": "local c = hydros.getFFBConfig(); c.smoothing = c.smoothing - 10; hydros.setFFBConfig(c) ui_message('Testing FFB smoothing at '..dumps(c.smoothing))",
                "order": 63,
                "title": "ui.inputActions.vehicle.ffbSmoothingInc.title",
                "onDown": "local c = hydros.getFFBConfig(); c.smoothing = c.smoothing + 10; hydros.setFFBConfig(c) ui_message('Testing FFB smoothing at '..dumps(c.smoothing))",
                "order": 62,
                "title": "ui.inputActions.vehicle.ffbForceCoefInc.title",
                "onDown": "local c = hydros.getFFBConfig(); c.forceCoef = c.forceCoef + 10; hydros.setFFBConfig(c) ui_message('Testing FFB strength at '..dumps(c.forceCoef))",
                "order": 60,