VE Lua Documentation

Press F to search!

newTemporalSmoothingNonLinear

Definition


-- @/lua/common/filters.lua:311

function newTemporalSmoothingNonLinear(inRate, outRate, startingValue)
  local rate = min(inRate or 1, 1e+30)
  local data = {[false] = rate, [true] = min(outRate or rate, 1e+30), state = startingValue or 0}
  return setmetatable(data, temporalSmoothingNonLinear)
end

Callers

@/lua/vehicle/hydros.lua

local curForceLimitSmoother = newTemporalSmoothingNonLinear(1000) -- prevent spikes when resetting vehicle (and ideally also when window focus is lost/gained)
local FFBperiod = 0 -- how small period the steering wheel drivers can cope with, before they crash and burn
@/lua/ge/extensions/gameplay/markers/gasStationMarker.lua
        iconPos = iconPos,
        iconPosSmoother = newTemporalSmoothingNonLinear(10,10),
        iconAlphaSmoother = newTemporalSmoothingNonLinear(30,30),
        iconPosSmoother = newTemporalSmoothingNonLinear(10,10),
        iconAlphaSmoother = newTemporalSmoothingNonLinear(30,30),
        overlap = false,
@/lua/vehicle/controller/drivingDynamics/actuators/activeCenterDiffLock.lua
local outputAV2Smoother = newExponentialSmoothing(500)
local lockCoefSmoother = newTemporalSmoothingNonLinear(8, 20)
@/lua/vehicle/controller/vehicleController/vehicleController.lua
  smoother.brakeInput = newTemporalSmoothing(brakeSmoothingIn * 2, brakeSmoothingOut * 2)
  smoother.aggressionAxis = newTemporalSmoothingNonLinear(aggressionSmoothingIn, aggressionSmoothingOut)
  smoother.aggressionKey = newTemporalSmoothingNonLinear(aggressionSmoothingIn, aggressionSmoothingOut * 0.2)
  smoother.aggressionAxis = newTemporalSmoothingNonLinear(aggressionSmoothingIn, aggressionSmoothingOut)
  smoother.aggressionKey = newTemporalSmoothingNonLinear(aggressionSmoothingIn, aggressionSmoothingOut * 0.2)
  smoother.avgAV = newTemporalSmoothingNonLinear(5, 5)
  smoother.aggressionKey = newTemporalSmoothingNonLinear(aggressionSmoothingIn, aggressionSmoothingOut * 0.2)
  smoother.avgAV = newTemporalSmoothingNonLinear(5, 5)
  smoother.wheelSlipShiftUp = newTemporalSmoothingNonLinear(wheelSlipShiftUpSmoothingIn, wheelSlipShiftUpSmoothingOut)
  smoother.avgAV = newTemporalSmoothingNonLinear(5, 5)
  smoother.wheelSlipShiftUp = newTemporalSmoothingNonLinear(wheelSlipShiftUpSmoothingIn, wheelSlipShiftUpSmoothingOut)
  smoother.groundContactSmoother = newTemporalSmoothing(100, 2)
@/lua/ge/extensions/core/groundMarkerArrows.lua
        wp = nil,
        nudgeForwardSmoother = newTemporalSmoothingNonLinear(3,3),
        nudgeForwardSmootherTarget = 0,
        nudgeForwardSmootherTarget = 0,
        nearFarScaleSmoother = newTemporalSmoothingNonLinear(15,15, arrowSmall),
        nearFarScaleSmootherTarget = 0,
        nearFarScaleSmootherTarget = 0,
        alphaSmoother = newTemporalSmoothingNonLinear(5,5, 0),
        alphaSmootherTarget = 0,
@/lua/vehicle/ai.lua

local targetSpeedDifSmoother = newTemporalSmoothingNonLinear(1e300, 4, 0)
local targetSpeedSmoother = newTemporalSmoothingNonLinear(10, 10, ego.speed)
local targetSpeedDifSmoother = newTemporalSmoothingNonLinear(1e300, 4, 0)
local targetSpeedSmoother = newTemporalSmoothingNonLinear(10, 10, ego.speed)
local egoDeviationSmoother = newTemporalSmoothing(1)
local egoDeviationSmoother = newTemporalSmoothing(1)
local smoothTcs = newTemporalSmoothingNonLinear(0.1, 0.9)
local throttleSmoother = newTemporalSmoothing(1e30, 0.2)
  RRT = {1,1,1,2,1,2,2,2,2,2,2,3,2,3,3,3,3,3,3,4,3,4,4,4,4,4,4,1,4,1,1,1},
  speedSmoother = newTemporalSmoothingNonLinear(1000, 0.25),
  steerSmoother = newTemporalSmoothingNonLinear(2)
  speedSmoother = newTemporalSmoothingNonLinear(1000, 0.25),
  steerSmoother = newTemporalSmoothingNonLinear(2)
}
@/lua/ge/extensions/gameplay/markers/missionMarker.lua
  self.iconAlphaSmoother = newTemporalSmoothing()
  self.iconPositionSmoother = newTemporalSmoothingNonLinear(10,10)
  self.cruisingSmoother = newTemporalSmoothingNonLinear(10,10)
  self.iconPositionSmoother = newTemporalSmoothingNonLinear(10,10)
  self.cruisingSmoother = newTemporalSmoothingNonLinear(10,10)
@/lua/vehicle/controller/drivingDynamics/actuators/electronicDiffLock.lua
local brakingPID
local side1BrakingSmoother = newTemporalSmoothingNonLinear(10, 10)
local side2BrakingSmoother = newTemporalSmoothingNonLinear(10, 10)
local side1BrakingSmoother = newTemporalSmoothingNonLinear(10, 10)
local side2BrakingSmoother = newTemporalSmoothingNonLinear(10, 10)
@/lua/vehicle/controller/tech/advancedIMU.lua
  -- Create acceleration smoothers (3 passes).
  sm.sm1AccX = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravX)
  sm.sm1AccY = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravY)
  sm.sm1AccX = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravX)
  sm.sm1AccY = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravY)
  sm.sm1AccZ = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravZ)
  sm.sm1AccY = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravY)
  sm.sm1AccZ = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravZ)
  sm.sm2AccX = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravX)
  sm.sm1AccZ = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravZ)
  sm.sm2AccX = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravX)
  sm.sm2AccY = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravY)
  sm.sm2AccX = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravX)
  sm.sm2AccY = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravY)
  sm.sm2AccZ = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravZ)
  sm.sm2AccY = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravY)
  sm.sm2AccZ = newTemporalSmoothingNonLinear(inOutRate, inOutRate, initGravZ)
  -- Create gyroscopic smoothers.
  sm.sm1GyroX = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm1GyroY = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm1GyroX = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm1GyroY = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm1GyroZ = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm1GyroY = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm1GyroZ = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm2GyroX = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm1GyroZ = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm2GyroX = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm2GyroY = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm2GyroX = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm2GyroY = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm2GyroZ = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm2GyroY = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
  sm.sm2GyroZ = newTemporalSmoothingNonLinear(inOutRate, inOutRate, 0.0)
end
@/lua/ge/extensions/gameplay/markers/inspectVehicleMarker.lua
  self.visible = true
  self.iconPositionSmoother = newTemporalSmoothingNonLinear(10,10)
  self.cruisingSmoother = newTemporalSmoothingNonLinear(10,10)
  self.iconPositionSmoother = newTemporalSmoothingNonLinear(10,10)
  self.cruisingSmoother = newTemporalSmoothingNonLinear(10,10)
  self.iconAlphaSmoother = newTemporalSmoothingNonLinear(20,20)
  self.cruisingSmoother = newTemporalSmoothingNonLinear(10,10)
  self.iconAlphaSmoother = newTemporalSmoothingNonLinear(20,20)
  self.iconDistanceSmoother = newTemporalSmoothingNonLinear(20,20)
  self.iconAlphaSmoother = newTemporalSmoothingNonLinear(20,20)
  self.iconDistanceSmoother = newTemporalSmoothingNonLinear(20,20)
end
@/lua/vehicle/controller/vehicleController/shiftLogic/cvtGearbox2.lua

  smoother.cvtGearRatioSmoother = newTemporalSmoothingNonLinear(cvtGearRatioSmoothingIn, cvtGearRatioSmoothingOut)
  smoother.lockupSmoother = newTemporalSmoothingNonLinear(lockupSmoothing)
  smoother.cvtGearRatioSmoother = newTemporalSmoothingNonLinear(cvtGearRatioSmoothingIn, cvtGearRatioSmoothingOut)
  smoother.lockupSmoother = newTemporalSmoothingNonLinear(lockupSmoothing)
@/lua/ge/extensions/gameplay/drift/display.lua
local outOfBoundsFlag = false
local creepSmoother = newTemporalSmoothingNonLinear(50,10, 0)
@/lua/ge/extensions/flowgraph/nodes/math/smoothers/nonLinear.lua
  C.oldSet = 0
  self.smoother = newTemporalSmoothingNonLinear()
end
@/lua/ge/extensions/gameplay/markers/walkingMarker.lua
         iconPos = iconPos,
         iconPosSmoother = newTemporalSmoothingNonLinear(10,10),
         iconAlphaSmoother = newTemporalSmoothingNonLinear(20,20),
         iconPosSmoother = newTemporalSmoothingNonLinear(10,10),
         iconAlphaSmoother = newTemporalSmoothingNonLinear(20,20),
         overlap = false,
@/lua/vehicle/controller/drivingDynamics/sensors/sensorHub.lua

local rollAVSmoother = newTemporalSmoothingNonLinear(20)
local pitchAVSmoother = newTemporalSmoothingNonLinear(20)
local rollAVSmoother = newTemporalSmoothingNonLinear(20)
local pitchAVSmoother = newTemporalSmoothingNonLinear(20)
local yawAVSmoother = newTemporalSmoothingNonLinear(20)
local pitchAVSmoother = newTemporalSmoothingNonLinear(20)
local yawAVSmoother = newTemporalSmoothingNonLinear(20)

local accelerationXSmoother = newTemporalSmoothingNonLinear(15)
local accelerationYSmoother = newTemporalSmoothingNonLinear(15)
local accelerationXSmoother = newTemporalSmoothingNonLinear(15)
local accelerationYSmoother = newTemporalSmoothingNonLinear(15)
local accelerationZSmoother = newTemporalSmoothingNonLinear(20)
local accelerationYSmoother = newTemporalSmoothingNonLinear(15)
local accelerationZSmoother = newTemporalSmoothingNonLinear(20)
@/lua/vehicle/wheels.lua
        deflatedTireAngle = 0,
        downForceSmoother = newTemporalSmoothingNonLinear(5),
        downForce = 0,

    wd.dynamicRadiusSmoother = newTemporalSmoothingNonLinear(0.5, 0.5)
    wd.dynamicRadiusSmoother:set(wd.radius)
@/lua/vehicle/electrics.lua
  elseif smootherType == "temporalNonLinear" then
    return newTemporalSmoothingNonLinear(unpack(params))
  end
@/lua/vehicle/controller/controlModes.lua
    configurations[v.electric] = v
    configurations[v.electric].smoother = newTemporalSmoothingNonLinear(configurations[v.electric].smoothIn, configurations[v.electric].smoothOut)
    electrics.values[v.electric] = 0
@/lua/vehicle/scriptai.lua
local aiSpeed = 0
local speedDiffSmoother = newTemporalSmoothingNonLinear(math.huge, 0.3)
local targetPos = vec3(0, 0, 0)
@/lua/ge/extensions/scenario/raceMarkers/attention.lua

  self.iconPositionSmoother = newTemporalSmoothingNonLinear(10,10)
  self.iconPositionSmoother:set(5)
@/lua/vehicle/sounds.lua
    rumbleStripHighSpeedContactSmoother = newTemporalSmoothing(1, 1),
    pressureSmoother = newTemporalSmoothingNonLinear(1, 1),
    looseSurfaceKickupLimit = 0,

            soundTable.smoothing = newTemporalSmoothingNonLinear(decayFactor, attackFactor) --first value = decay smoothing, second value = attack smoothing. The smaller the number, the more the smoothing
@/lua/vehicle/controller/vehicleController/shiftLogic/cvtGearbox.lua

  smoother.cvtGearRatioSmoother = newTemporalSmoothingNonLinear(cvtGearRatioSmoothingIn, cvtGearRatioSmoothingOut)
  smoother.cvtTargetAVSmoother = newTemporalSmoothingNonLinear(cvtTargetAVSmoothingIn, cvtTargetAVSmoothingOut)
  smoother.cvtGearRatioSmoother = newTemporalSmoothingNonLinear(cvtGearRatioSmoothingIn, cvtGearRatioSmoothingOut)
  smoother.cvtTargetAVSmoother = newTemporalSmoothingNonLinear(cvtTargetAVSmoothingIn, cvtTargetAVSmoothingOut)
@/lua/vehicle/sensors.lua

local gx_smooth2 = newTemporalSmoothingNonLinear(7)
local gy_smooth2 = newTemporalSmoothingNonLinear(7)
local gx_smooth2 = newTemporalSmoothingNonLinear(7)
local gy_smooth2 = newTemporalSmoothingNonLinear(7)
local gz_smooth2 = newTemporalSmoothingNonLinear(7)
local gy_smooth2 = newTemporalSmoothingNonLinear(7)
local gz_smooth2 = newTemporalSmoothingNonLinear(7)
@/lua/ge/extensions/gameplay/markers/parkingMarker.lua
  self.visible = true
  self.iconPositionSmoother = newTemporalSmoothingNonLinear(10,10)
  self.cruisingSmoother = newTemporalSmoothingNonLinear(10,10)
  self.iconPositionSmoother = newTemporalSmoothingNonLinear(10,10)
  self.cruisingSmoother = newTemporalSmoothingNonLinear(10,10)
  self.iconAlphaSmoother = newTemporalSmoothingNonLinear(20,20)
  self.cruisingSmoother = newTemporalSmoothingNonLinear(10,10)
  self.iconAlphaSmoother = newTemporalSmoothingNonLinear(20,20)
  self.iconDistanceSmoother = newTemporalSmoothingNonLinear(20,20)
  self.iconAlphaSmoother = newTemporalSmoothingNonLinear(20,20)
  self.iconDistanceSmoother = newTemporalSmoothingNonLinear(20,20)
  self.overlapSmoother = newTemporalSmoothingNonLinear(10,10)
  self.iconDistanceSmoother = newTemporalSmoothingNonLinear(20,20)
  self.overlapSmoother = newTemporalSmoothingNonLinear(10,10)
end
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffBias.lua
local biasPID
local biasSmoother = newTemporalSmoothingNonLinear(10, 10)
@/lua/ge/extensions/core/cameraModes/collision.lua
  if not smoother then
    smoother = newTemporalSmoothingNonLinear(1, 7, 0)
    smoother:set(closestHit)
@/lua/vehicle/powertrain/combustionEngine.lua
      local rpmOutRate = jbeamData.rpmSmootherOutRate or 25
      device.soundRPMSmoother = newTemporalSmoothingNonLinear(rpmInRate, rpmOutRate)
      local loadInRate = jbeamData.loadSmootherInRate or 20
      local loadOutRate = jbeamData.loadSmootherOutRate or 20
      device.soundLoadSmoother = newTemporalSmoothingNonLinear(loadInRate, loadOutRate)
  local idleAVStartOffsetRate = jbeamData.idleRPMStartRate or 1
  device.idleAVStartOffsetSmoother = newTemporalSmoothingNonLinear(idleAVStartOffsetRate, 100)
  device.idleStartCoef = jbeamData.idleRPMStartCoef or 2
@/lua/vehicle/controller/braking/adaptiveBrakeLights.lua
  decelThreshold = jbeamData.decelThreshold or 1.3 -- m/s/s (default value is the legal threshold in the U.K.)
  accelSmoother = newTemporalSmoothingNonLinear(5)
  prevWheelspeed = 0
@/lua/vehicle/controller/drivingDynamics/actuators/electronicSplitShaftLock.lua
local outputAVSmoother = newExponentialSmoothing(500)
local clutchRatioSmoother = newTemporalSmoothingNonLinear(20, 5)
@/lua/vehicle/controller/propAnimation/googlyEyes.lua

  sizeCoefSmoother = newTemporalSmoothingNonLinear(sizeSmoothingIn, sizeSmoothingOut)
@/lua/vehicle/powertrain/electricMotor.lua
        local rpmOutRate = soundConfig.rpmSmootherOutRate or 25
        device.soundRPMSmoother = newTemporalSmoothingNonLinear(rpmInRate, rpmOutRate)
        local loadInRate = soundConfig.loadSmootherInRate or 20
        local loadOutRate = soundConfig.loadSmootherOutRate or 20
        device.soundLoadSmoother = newTemporalSmoothingNonLinear(loadInRate, loadOutRate)
        device.soundMaxLoadMix = soundConfig.maxLoadMix or 1
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffLock.lua
local lockingPID
local lockingSmoother = newTemporalSmoothingNonLinear(10, 10)
local lockingCoef = 0
@/lua/ge/extensions/gameplay/markers/crawlMarker.lua
     iconPos = cluster.iconPos,
     iconPosSmoother = newTemporalSmoothingNonLinear(10,10),
     iconAlphaSmoother = newTemporalSmoothingNonLinear(20,20),
     iconPosSmoother = newTemporalSmoothingNonLinear(10,10),
     iconAlphaSmoother = newTemporalSmoothingNonLinear(20,20),
     overlap = false,