VE Lua Documentation

Press F to search!

updateGFXSecondStep

Definition


-- @/lua/vehicle/electrics.lua:448

local function updateGFXSecondStep(dt)
  local values = M.values
  --make sure to update the brakelights value based on the brake value
  values.brakelights = values.brakelights or ceil(values.brake)
  values.brakelight_signal_R = values.signal_right_input == 1 and (blinkPulse and 1 or 0) or ceil(values.brakelights or values.brake or 0)
  values.brakelight_signal_L = values.signal_left_input == 1 and (blinkPulse and 1 or 0) or ceil(values.brakelights or values.brake or 0)

  -- inject imported electrics events second time, this should be the last step before update electrics by ignition state so that we can override everything if needed
  beamstate.updateRemoteElectrics(false)

  updateElectricsWithIgnitionLevelHandler()

  customValueParser.updateGFX(dt)

  --apply the smoothers as the last thing
  for f, s in pairs(smoothers) do
    if values[f] ~= nil then
      values[f] = s:get(values[f], dt)
    end
  end
end

Callers

@/lua/vehicle/main.lua
  controller.updateGFX(dtSim)
  electrics.updateGFXSecondStep(dtSim)
  extensions.hook("updateGFX", dtSim) -- must be before drivetrain, hydros and after electrics