updateGFX
Definition
-- @/lua/vehicle/fire.lua:69
local function updateGFX(dt)
local rand = random(1) --use the same random value for all effects in this frame
--we combine these two values only once per frame here, we need the result of this quite often below
local countTime = dt * fireNodeCounter
local airSpeed = electrics.values.airflowspeed
tEnv = obj:getEnvTemperature() - 273.15
-- Node Iteration --
local currentNode
currentNodeKey, currentNode = getCircular(flammableNodes, currentNodeKey)
local mycid = currentNodeKey
local invSpecHeat = 1 / currentNode.weightSpecHeatCoef
local countTimeInvSpecHeat = countTime * invSpecHeat
local curTemperature = currentNode.temperature
-- Steam Handling --
local underWater = obj:inWater(mycid) and 1 or 0
currentNode.lastUnderWaterValue = underWater
--dynamic baseTemp handling, either use the exhaust manifold temp from the drivetrain or the static base temp from jbeam
currentNode.baseTemp = currentNode.useThermalsBaseTemp and controller.mainController.fireEngineTemperature or currentNode.staticBaseTemp
--emit steam if indicated
if curTemperature > tSteam and underWater == 1 then
obj:addParticleByNodesRelative(currentNodeKey, centreNode, rand * -2, 24, 0, 1)
end
-- Vapor Handling --
if currentNode.containerBeam then
local containerBeamBroken = obj:beamIsBroken(currentNode.containerBeam)
if not currentNode.containerBeamBroken and containerBeamBroken then
currentNode.vaporState = 20 + random(80)
obj:addParticleByNodesRelative(mycid, centreNode, 1, 55, 0.1, 3) -- add fuel splash particles
obj:addParticleByNodesRelative(mycid, centreNode, 1, 50, 0.1, 3)
currentNode.containerBeamBroken = true
currentNode.canIgnite = true
if not currentNode.ignoreContainerBeamBreakMessage then
guihooks.message("vehicle.fire.fuelTankRuptured", 10, "vehicle.damage.fueltank")
end
end
currentNode.vaporState = max(currentNode.vaporState - (vaporCondenseCoef * dt), 0) -- condense fuel again
currentNode.isVapor = currentNode.vaporState >= currentNode.vaporPoint and 1 or 0
end
fireballSoundTimer = fireballSoundTimer >= fireballSoundDelay and 0 or min(fireballSoundTimer + dt, fireballSoundDelay)
--reduce smokePoint by X% if the node is vaporized
local vaporCorrectedSmokePoint = currentNode.smokePoint - (currentNode.smokePoint * currentNode.isVapor * vaporFlashPointModifier)
if fireBurnSoundObj then
if next(hotNodes) == nil then
if fireBurnSoundPlaying then
obj:stopSFX(fireBurnSoundObj)
fireBurnSoundPlaying = false
end
else
if not fireBurnSoundPlaying then
obj:playSFX(fireBurnSoundObj)
fireBurnSoundPlaying = true
end
end
end
-- Particles --
for hotcid, node in pairs(hotNodes) do
if hotcid ~= currentNodeKey then
-- Heat Transfer --
--radiate, conduct heat from hotNodes node to current nodeframe
local dist = obj:nodeLength(currentNodeKey, hotcid) --distance to nearby nodes, for heat radiation
-- conduction
if dist < node.conductionRadius then
curTemperature = curTemperature + (node.temperature - curTemperature) * min(0.5, 0.2 * countTimeInvSpecHeat / (dist + 1e-30))
end
local burningCoef = node.temperature > vaporCorrectedSmokePoint and 1 or 0 --1 when actually burning, 0 otherwise
local radiation = (24 * node.intensity * burningCoef) / (1 + dist * dist * dist) --radiation of heat depends on flame intensity, base heat, and distance to surrounding nodes, factor is arbitary, can be adjusted to change radiation speed
curTemperature = curTemperature + radiation * countTimeInvSpecHeat --radiate heat to current node; multiply it by the delta T (hotNum)
end
node.flameTick = node.flameTick >= 1 and 0 or node.flameTick + 10 * (1 + airSpeed * 0.05) * dt
node.smokeTick = node.smokeTick >= 1 and 0 or node.smokeTick + 1.2 * (1 + airSpeed * 0.05) * dt
local vaporCorrectedNodeSmokePoint = node.smokePoint - (node.smokePoint * node.isVapor * vaporFlashPointModifier)
local vaporCorrectedNodeFlashPoint = node.flashPoint - (node.flashPoint * node.isVapor * vaporFlashPointModifier)
if node.intensity > 0 and node.temperature >= vaporCorrectedNodeFlashPoint and currentNode.lastUnderWaterValue == 0 then
if fireBurnSoundObj == nil then
fireBurnSoundObj = obj:createSFXSource("event:>Vehicle>Fire>Fire_Burn_Loop", "AudioDefaultLoop3D", "fireburn", -1) or false
fireBurnSoundPlaying = true
end
local x = min(node.intensity, 1)
obj:setNodeVolumePitchCT(fireBurnSoundObj, hotcid, x * (0.5*x + 0.5), 1, 0, 0)
if node.flameTick >= 1 then
local rootedIntensity = sqrt(node.intensity)
--small flames for low intensity fire
fireParticleSmall = airSpeed < 10 and 25 or 26
obj:addParticleByNodesRelative(hotcid, centreNode, rand * -2 * rootedIntensity, fireParticleSmall, 0, 1)
if node.intensity > 0.15 then
--medium flames for medium intensity fire
fireParticleMedium = airSpeed < 10 and 27 or 28
obj:addParticleByNodesRelative(hotcid, centreNode, rand * -2 * rootedIntensity, fireParticleMedium, 0, 1)
if node.intensity > 0.3 then
--large flames for high-intensity fire
fireParticleLarge = airSpeed < 10 and 29 or 30
obj:addParticleByNodesRelative(hotcid, centreNode, rand * -2 * rootedIntensity, fireParticleLarge, 0, 1)
if node.intensity > 10 then
node.vaporState = 0
--huge fireball for explosions
if fireballSoundTimer >= fireballSoundDelay then
sounds.playSoundOnceFollowNode("event:>Vehicle>Fire>Fire_Ignition", mycid, 3)
end
obj:addParticleByNodesRelative(hotcid, centreNode, 0, 31, 0.5, 10)
--huge smoke puff for explosions
obj:addParticleByNodesRelative(hotcid, centreNode, 0, 32, 0, 1)
--spray of sparks
obj:addParticleByNodesRelative(hotcid, centreNode, 0, 9, 0.5, 100)
end
end
end
end
end
if node.smokeTick >= 1 then
if node.smokePoint and node.temperature > vaporCorrectedNodeSmokePoint then
local rootedIntensity = sqrt(node.intensity)
--node emits smoke if close to flash point
smokeParticleSmall = airSpeed < 10 and 51 or 43
obj:addParticleByNodesRelative(hotcid, centreNode, rand * -2 * rootedIntensity * (1 + airSpeed * 0.1), smokeParticleSmall, 0, 1)
if node.temperature > node.flashPoint * 4 then
smokeParticleMedium = airSpeed < 10 and 52 or 53
obj:addParticleByNodesRelative(hotcid, centreNode, rand * -2 * rootedIntensity * (1 + airSpeed * 0.1), smokeParticleMedium, 0, 1)
end
end
end
end
-- Cooling Down ---
--coefficient of heat transfer, based on airspeed
local hc = 0.0006 * (waterCoolingCoef * underWater + 1) * (25 + 0.2 * airSpeed)
--if the engine is dead, our nodes can cool below their baseTemp (baseTemp represents the engine's constant heat)
local minTemp = (drivetrain.engineDisabled or underWater == 1) and tEnv or max(tEnv, currentNode.baseTemp)
--heat is lost to the surroundings at a rate of temperature * hc. Lower limit = 0
--temperature is the node's heat divided by its mass * specific heat
curTemperature = min(curTemperature + (minTemp - curTemperature) * min(1, hc * countTimeInvSpecHeat), maxNodeTemp)
-- Fire / Smoke --
if currentNode.canIgnite and curTemperature >= vaporCorrectedSmokePoint then
if currentNode.chemEnergy > 0 and underWater == 0 then
local burnRate = currentNode.burnRate + currentNode.burnRate * currentNode.isVapor * 10
local chemEnergyRatio = currentNode.chemEnergy / currentNode.originalChemEnergy
currentNode.intensity = min(2 * chemEnergyRatio, 1) * (curTemperature / maxNodeTemp) * burnRate
curTemperature = curTemperature + currentNode.intensity * 100 * countTimeInvSpecHeat
currentNode.chemEnergy = max(currentNode.chemEnergy - currentNode.intensity * 3 * countTime, 0)
if currentNode.chemEnergy / currentNode.originalChemEnergy < 0.01 then
currentNode.chemEnergy = 0
end
else
currentNode.intensity = 0
end
hotNodes[mycid] = currentNode --add it to the hot node list
if wheelNodes[mycid] and curTemperature > tirePopTemp then --tire popping
local wheelData = wheelNodes[mycid]
beamstate.deflateTire(wheelData.wheelID, 1)
sounds.playSoundOnceFollowNode("event:>Vehicle>Fire>Fire_Ignition", mycid, 2)
--puff of flame on tire burst
obj:addParticleByNodesRelative(mycid, centreNode, 0, 31, 0.5, 20)
obj:addParticleByNodesRelative(mycid, centreNode, 0, 29, 0.5, 20)
--obj:addParticleByNodesRelative(mycid, centreNode, 0, 9, 0.5, 100)
-- we only want to deflate the tires once, so we just pretend this wheel node is not actually a wheel node anymore
wheelNodes[wheelData.node1] = nil
wheelNodes[wheelData.node2] = nil
end
else
--we are below flashpoint, which means that this node is not hot (anymore)
hotNodes[mycid] = nil --remove hotnode from list
currentNode.intensity = 0 --kill any flames that might still exist
end
currentNode.temperature = curTemperature
end
Callers
@/lua/vehicle/controller/playerController.lua
local function updateGFX(dt)
ballGroundContactNodesPast, ballGroundContactNodesNew = ballGroundContactNodesNew, ballGroundContactNodesPast
@/lua/vehicle/powertrain/electricServo.lua
local function updateGFX(device, dt)
--note: this method is only executed if any electrics name for the target angle is set
@/lua/vehicle/extensions/debug/advancedExternalDebug.lua
local function updateGFX(dt)
mainDebugPacket.isActiveVehicle = playerInfo.firstPlayerSeated
@/lua/vehicle/controller/braking/adaptiveBrakeLights.lua
local function updateGFX(dt)
local brakeValue = electrics.values.brake or 0
@/lua/vehicle/ai.lua
M.updateGFX = nop
local function updateGFX(dtGFX)
dt = dtGFX
@/lua/vehicle/controller/braking/postCrashBrake.lua
local function updateGFX(dt)
if state == "idle" then
@/lua/vehicle/extensions/tech/advancedIMU.lua
local function updateGFX(dtSim)
for sensorId, _ in pairs(advancedIMUs) do
@/lua/vehicle/powertrain/sequentialGearbox.lua
local function updateGFX(device, dt)
if device.targetGearIndex then
@/lua/vehicle/extensions/vehicleStatsLogger.lua
local function updateGFX(dt)
if not doLogging then
@/lua/vehicle/extensions/dynamicVehicleData.lua
local function updateGFX(dt)
timer = timer + dt
@/lua/vehicle/extensions/dragAi.lua
local function updateGFX(dt)
if state == "ready" then
@/lua/vehicle/controller/hydraulicSuspension.lua
local function updateGFX(dt)
if currentPumpFlow > 0 then
@/lua/vehicle/material.lua
local function updateGFX()
-- check for changes
@/lua/ge/extensions/core/input/bindings.lua
local wasWalking
local function updateGFX(dtRaw)
if filechangeTimeout then
@/lua/vehicle/extensions/cruiseControl.lua
local function updateGFX(dt)
if not isEnabled then
@/lua/vehicle/controller/gauges/analogOdometer.lua
local function updateGFX(dt)
updateTimer = updateTimer + dt
@/lua/vehicle/extensions/tech/CANBus/RacingDisplay.lua
local function updateGFX(dt)
if playerInfo.firstPlayerSeated then
@/lua/vehicle/powertrain/combustionEngine.lua
local function updateGFX(device, dt)
device:updateFuelUsage()
device.turbocharger.updateGFX(dt)
device.supercharger.updateGFX(dt)
device.turbocharger.updateGFX(dt)
device.supercharger.updateGFX(dt)
device.nitrousOxideInjection.updateGFX(dt)
device.supercharger.updateGFX(dt)
device.nitrousOxideInjection.updateGFX(dt)
device.thermals.updateGFX(dt)
@/lua/vehicle/controller/twoStepLaunch.lua
local function updateGFX(dt)
if twoStepState == "idle" then
@/lua/vehicle/extensions/tech/dumpPlayerInput.lua
-- this is called every frame
local function updateGFX(dt)
if not f then return end
@/lua/vehicle/controller/lineLock.lua
local function updateGFX(dt)
electrics.values[electricsName] = lineLockActive
@/lua/vehicle/controller/pneumatics/liftAxleControl.lua
local function updateGFX(dt)
if currentMode == modes.drop then
@/lua/vehicle/controller.lua
local function updateGFX(dt)
for i = 1, gfxUpdateCount, 1 do
if controller.updateGFX ~= nil then
print(" sortedControllers[" .. i .. "].updateGFX(dt) -- " .. tostring(controller.typeName))
end
@/lua/vehicle/controller/nitrousOxideInjection.lua
local function updateGFX(dt)
local tankRatio = engine.nitrousOxideInjection.getTankRatio()
@/lua/vehicle/controller/4wd.lua
local function updateGFX(dt)
electrics.values.modeRangeBox = rangeBox and (rangeBox.mode == "low" and 1 or 0) or 0
@/lua/vehicle/controller/pneumatics/lowAirPressureWarning.lua
local function updateGFX(dt)
local pressure = relevantPressureTank and relevantPressureTank.currentPressure or 0
@/lua/vehicle/controller/drivingDynamics/supervisors/components/brakeControl.lua
local function updateGFX(dt)
electrics.values.isYCBrakeActive = isYCBrakeActive and 1 or 0
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/powertrain/turbocharger.lua
local function updateGFX(dt)
--Some verification stuff
@/lua/vehicle/extensions/gameplayStatistic.lua
local function updateGFX(dt)
if lenstatSchedule > 0 then
@/lua/vehicle/controller/gauges/customModules/navigationData.lua
local function updateGFX(dt)
end
@/lua/vehicle/extensions/tech/platooning.lua
local function updateGFX(dtSim)
@/lua/vehicle/controller/controlModes.lua
local function updateGFX(dt)
inputs.steering = input.steering
@/lua/vehicle/extensions/api.lua
local function updateGFX()
httpJsonServer.update()
@/lua/vehicle/extensions/scenario/shiftBooster.lua
local function updateGFX(dt)
if boostTime > 0.01 then
@/lua/vehicle/controller/hydraulics/electricHydraulics.lua
local function updateGFX(dt)
local motorThrottle = 0
@/lua/vehicle/sounds.lua
local function updateGFX(dt)
--crash sounds
@/lua/vehicle/controller/linearActuators/linearActuatorTrailerFeet.lua
local function updateGFX(dt)
local currentPosition = actuator.currentExtendPercent
@/lua/vehicle/controller/gauges/genericGauges.lua
local function updateGFX(dt)
updateTimer = updateTimer + dt
@/lua/vehicle/controller/drivingDynamics/supervisors/components/motorTorqueControl.lua
local function updateGFX(dt)
end
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/controller/hydraulics/hydraulicTrailerFeet.lua
local function updateGFX(dt)
local currentPosition = feetCylinder.currentExtendPercent
@/lua/vehicle/extensions/tech/GPS.lua
local function updateGFX(dtSim)
for sensorId, _ in pairs(GPSs) do
@/lua/vehicle/extensions/gameplayInterface.lua
local function updateGFX(dt)
checkValueChangeNotificationMethod(dt)
@/lua/vehicle/extensions/odometer.lua
local function updateGFX(dt)
relativeOdometer = relativeOdometer + abs(electrics.values.wheelspeed or 0) * dt
@/lua/vehicle/controller/pneumatics/airbrakes.lua
local function updateGFX(dt)
updateSounds(dt)
@/lua/vehicle/controller/drivingDynamics/supervisors/slipProviders/virtualSpeedSlip.lua
local function updateGFX(dt)
end
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/powertrain/combustionEngineThermals.lua
local function updateGFX(dt)
updateCoolingGFXMethod(dt)
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffBias.lua
local function updateGFX(dt)
if not controlParameters.isEnabled then
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/controller/etkGauges.lua
local function updateGFX(dt)
if not uiIsReady then
@/lua/vehicle/controller/propAnimation/sequentialLever.lua
local function updateGFX(dt)
if not relevantGearbox then
@/lua/vehicle/powertrain/supercharger.lua
local function updateGFX(dt)
-- Some verification stuff
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaKombi.lua
local function updateGFX(dt)
if playerInfo.firstPlayerSeated then
@/lua/vehicle/controller/beaconSpin.lua
local function updateGFX(dt)
electrics.values[electricsName] = electrics.values.lightbar > 0 and ((electrics.values[electricsName] + (dt * beaconSpeed)) % 360) or 0 --this needs to be 0 as otherwise the spotlights stay turned on :|
@/lua/vehicle/controller/dragTimer.lua
local function updateGFX(dt)
end
@/lua/vehicle/controller/tech/MQTToutput.lua
local function updateGFX(dt)
updateData(dt)
@/lua/vehicle/electricsCustomValueParser.lua
local function updateGFX(dt)
--copy our main electrics into the sandboxed environment
@/lua/vehicle/extensions/tech/CANBus/ButtonBox.lua
local function updateGFX(dt)
if playerInfo.firstPlayerSeated then
@/lua/vehicle/controller/pneumatics.lua
local function updateGFX(dt)
for _, g in pairs(beamGroups) do
@/gameplay/missionTypes/hypermiling/fluidConsumptionToGraph.lua
local function updateGFX(dtSim)
updateTimer = updateTimer + dtSim
@/lua/vehicle/powertrain/hydraulicPump.lua
local function updateGFX(device, dt)
for _, consumer in ipairs(device.connectedConsumers) do
for _, consumer in ipairs(device.connectedConsumers) do
consumer:updateGFX(device.accumulatorPressure, dt)
end
@/lua/vehicle/controller/gauges/customModules/electricMotorData.lua
local function updateGFX(dt)
end
@/lua/vehicle/extensions/perfectLaunch.lua
local function updateGFX(dt)
if state == "idle" then
straightLine.updateGFX(dt)
end
@/lua/vehicle/controller/axleLift.lua
local function updateGFX(dt)
local frontPos = frontRaisedPosition
@/lua/vehicle/controller/couplings/fifthwheel.lua
local function updateGFX(dt)
--print(state)
@/lua/vehicle/controller/inputOutputDemo.lua
--If you overload this method performance wise, fps will drop gracefully, so disk IO and other heavily unpredictable things are done/triggered from here (or user input)
local function updateGFX(dt)
LogInterestingData()
@/lua/vehicle/energyStorage/n2oTank.lua
local function updateGFX(storage, dt)
storage.remainingMass = storage.storedEnergy / storage.energyDensity
@/lua/vehicle/controller/sound/linearMovement.lua
local function updateGFX(dt)
--get the current length of our sensor beam
@/lua/vehicle/extensions/inputAnalyzer.lua
local function updateGFX(dt)
inputCheckTimer = inputCheckTimer + dt
@/lua/vehicle/controller/vehicleController/vehicleController.lua
--drivingStrategy.core.updateGFX(dt)
@/lua/vehicle/controller/sound/airbrakes.lua
local function updateGFX(dt)
local brake = electrics.values[electricsBrakeName] or 0
@/lua/vehicle/controller/drivingDynamics/supervisors/yawControl.lua
local function updateGFX(dt)
isActiveSmoothed = isActiveSmoother:getUncapped(yawControlActive and 1 or 0, dt)
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/powertrain/hydraulicAccumulator.lua
local function updateGFX(device, dt)
for _, consumer in ipairs(device.connectedConsumers) do
for _, consumer in ipairs(device.connectedConsumers) do
consumer:updateGFX(device.accumulatorPressure, dt)
end
@/lua/vehicle/extensions/tech/mesh.lua
local function updateGFX(dtSim)
for sensorId, _ in pairs(meshes) do
@/lua/vehicle/input.lua
local lockTypeWarned
local function updateGFX(dt)
gxSmoothMax = gx_Smoother:getUncapped(0, dt)
@/lua/vehicle/extensions/advancedwheeldebug.lua
local function updateGFX(dt)
if not isDebugEnabled then
@/lua/vehicle/controller/jato.lua
local function updateGFX(dt)
local jatoInput = min(electrics.values.jatoInput or 0, 1)
@/lua/vehicle/controller/controllerTemplate.lua
local function updateGFX(dt)
end
@/lua/vehicle/extensions/tech/idealRADARSensor.lua
local function updateGFX(dtSim)
for sensorId, _ in pairs(idealRADARs) do
@/lua/vehicle/energyStorage.lua
local function updateGFX(dt)
for i = 1, storageCount, 1 do
if storage.updateGFX then
storage:updateGFX(dt)
end
@/lua/vehicle/powertrain/automaticGearbox.lua
local function updateGFX(device, dt)
--interpolate gear ratio to simulate the opening/closing clutches of the auto gearbox
@/lua/vehicle/controller/tech/screens.lua
local function updateGFX(dt)
end
@/lua/vehicle/controller/drivingDynamics/actuators/electronicDiffLock.lua
local function updateGFX(dt)
if not controlParameters.isEnabled then
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/extensions/telemetryLogger.lua
local function updateGFX(dt)
if not isRecording then
@/lua/vehicle/controller/gauges/customModules/dynamicRedlineData.lua
local function updateGFX(dt)
end
@/lua/vehicle/controller/powertrainControl/antiLag.lua
local function updateGFX(dt)
local throttle = electrics.values.throttle
@/lua/vehicle/controller/propAnimation/singleAxisLever.lua
local function updateGFX(dt)
local gearModeIndex = electrics.values.gearModeIndex or 0
@/lua/vehicle/controller/beamNavigator.lua
local function updateGFX(dt)
updateTimer = updateTimer + dt
@/lua/vehicle/energyStorage/electricBattery.lua
local function updateGFX(storage, dt)
storage:setStoredEnergy(storage.storedEnergy)
@/lua/vehicle/controller/gauges/customModules/accelerationData.lua
local function updateGFX(dt)
end
@/lua/vehicle/controller/drivingDynamics/supervisors/components/awdControl.lua
local function updateGFX(dt)
end
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/extensions/simpleTripApp.lua
local function updateGFX(dtSim)
local dtReal = obj:getRealdt()
@/lua/ge/map.lua
local function updateGFX(dtReal, dtSim)
if dtSim > 0 then
@/lua/vehicle/controller/vivaceGauges.lua
local function updateGFX(dt)
updateTimer = updateTimer + dt
@/lua/vehicle/extensions/tech/wheelForces.lua
local function updateGFX()
end
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaShifter.lua
local function updateGFX(dt)
if playerInfo.firstPlayerSeated then
@/lua/vehicle/controller/advancedCouplerControl.lua
local function updateGFX(dt)
if couplerGroup.spawnSoundDelayTimer > 0 then
@/lua/vehicle/beamstate.lua
local function updateGFX(dt)
-- Planet timers
@/lua/vehicle/controller/drivingDynamics/sensors/sensorHub.lua
local function updateGFX(dt)
--print(M.accNoiseX + M.accNoiseY + M.accNoiseZ)
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/electrics.lua
local function updateGFX(dt)
updateIgnitionStarterHandler(dt)
customValueParser.updateGFX(dt)
@/lua/ge/main.lua
if geluaProfiler then geluaProfiler:start() end
map.updateGFX(dtReal, dtSim)
if geluaProfiler then geluaProfiler:add("luaPreRender map update") end
extensions.core_input_bindings.updateGFX(dtRaw)
simTimeAuthority.update(dtReal)
@/lua/vehicle/extensions/tech/ACC.lua
local function updateGFX(dtSim)
@/lua/vehicle/controller/pneumatics/actuators.lua
local function updateGFX(dt)
for _, g in pairs(crossFlowGroups) do
@/lua/vehicle/controller/drivingDynamics/supervisors/components/diffControl.lua
local function updateGFX(dt)
end
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/controller/gauges/customModules/tireData.lua
local function updateGFX(dt)
end
@/lua/vehicle/controller/dummy.lua
local function updateGFX(dt)
electrics.values.throttle = math.min(math.max(input.throttle or 0, 0), 1)
@/lua/vehicle/extensions/core/booster.lua
local function updateGFX(dtSim)
local planets = {}
@/lua/vehicle/controller/sound/reverseWarn.lua
local function updateGFX(dt)
tick = tick + dt
@/lua/vehicle/extensions/escMeasurement.lua
local function updateGFX(dt)
if workerCoroutine ~= nil then
@/lua/vehicle/hydros.lua
local function updateGFX(dt) -- dt in seconds
local invPhysSteps = physicsDt / dt
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffLock.lua
local function updateGFX(dt)
if not controlParameters.isEnabled then
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/energyStorage/pressureTank.lua
local function updateGFX(storage, dt)
-- calculate pressure from stored energy and capacity: PV = nRT, e = nRT, therefore PV = e and P = e / V
@/lua/vehicle/controller/drivingDynamics/sensors/virtualSensors.lua
local function updateGFX(dt)
end
local function updateGFXDebug(dt)
updateGFX(dt)
local virtual = M.virtual
@/lua/vehicle/energyStorage/fuelTank.lua
local function updateGFX(storage, dt)
storage.remainingVolume = storage.storedEnergy / (storage.fuelLiquidDensity * storage.energyDensity)
@/lua/vehicle/thrusters.lua
local invalidThrusterControlWarned
local function updateGFX()
table.clear(thrusterState)
@/lua/vehicle/controller/powertrainControl/activeCenterDiff.lua
local function updateGFX(dt)
end
@/lua/vehicle/protocols.lua
local function updateGFX(dtSim)
if not playerInfo.firstPlayerSeated then return end
@/lua/vehicle/controller/sbrGauges.lua
local function updateGFX(dt)
updateTimer = updateTimer + dt
@/lua/vehicle/controller/braking/brakedDifferentialSteering.lua
local function updateGFX(dt)
local steering = electrics.values.steering_input or 0
@/lua/vehicle/extensions/dynoClient.lua
local function updateGFX(dt)
if not dynoObjectID then return end
@/lua/vehicle/extensions/tech/OBDEmulator.lua
local function updateGFX(dt)
if playerInfo.firstPlayerSeated then
@/lua/vehicle/controller/propAnimation/googlyEyes.lua
local function updateGFX(dt)
local sizeCoef = linearScale(sensors.gz, 0, defaultGravity * gravityMaxSizeCoef, maxSizeCoef, minSizeCoef)
@/lua/vehicle/powertrain/genericTorqueProvider.lua
local function updateGFX(device, dt)
device.outputRPM = device.outputAV1 * avToRPM
@/lua/vehicle/controller/powertrainControl/rimPullControl.lua
local function updateGFX(dt)
--read the rim pull input from the relevant axis action
@/lua/vehicle/powertrain.lua
local function updateGFX(dt)
M.currentGravity = obj:getGravity()
if device.updateGFX then
device:updateGFX(dt)
end
@/lua/vehicle/powertrain/nitrousOxideInjection.lua
local function updateGFX(dt)
if assignedEngine.engineDisabled then
@/lua/vehicle/powertrain/centrifugalClutch.lua
local function updateGFX(device, dt)
local kClutchToHousing = 20
@/lua/vehicle/controller/tirePressureControl.lua
local function updateGFX(dt)
pEnv = obj:getEnvPressure()
@/lua/vehicle/controller/shiftLights.lua
local function updateGFX(dt)
local rpm = electrics.values[inputElectricsName]
@/lua/vehicle/sensors.lua
local function updateGFX(dt)
local ffisensors = M.ffiSensors
@/lua/vehicle/controller/loggerTemplate.lua
-- If you overload this method performance wise, fps will drop gracefully, so disk IO and other heavily unpredictable things are done/triggered from here (or user input)
local function updateGFX(dt)
logInterestingData()
@/lua/vehicle/controller/esc.lua
local function updateGFX(dt)
warningLightsTimer = warningLightsTimer + dt
@/lua/vehicle/controller/drivingDynamics/supervisors/tractionControl.lua
local function updateGFX(dt)
isActiveSmoothed = isActiveSmoother:getUncapped(tractionControlActive and 1 or 0, dt)
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/extensions/aeroDebug.lua
local function updateGFX(dt)
if not isEnabled then
@/lua/vehicle/extensions/gameplayInterfaceModules/interactCargoContainers.lua
local anyContainerNeedsUpdate = false
local function updateGFX(dtSim)
anyContainerNeedsUpdate = false
@/lua/vehicle/extensions/tech/LINBus/LINBusPeak.lua
local function updateGFX(dt)
if M.isConnected then
@/lua/vehicle/powertrain/compressor.lua
local function updateGFX(device, dt)
if streams.willSend("pneumaticsData") then
@/lua/vehicle/controller/braking/compressionBrake.lua
local function updateGFX(dt)
local compressionBrakeCoefActual = compressionBrakeCoef * (1 - sign(controlledEngine.requestedThrottle))
@/lua/vehicle/extensions/vehiclePerformanceData.lua
local function updateGFX(dt)
--iterate active recordings and execute the update method
@/lua/vehicle/props.lua
local function updateGFX()
local evals = electrics.values
@/lua/vehicle/powertrain/electricMotor.lua
local function updateGFX(device, dt)
device:updateEnergyUsage()
@/lua/vehicle/controller/drivingDynamics/supervisors/yawProviders/STMEstimate.lua
local function updateGFX(dt)
end
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/powertrain/hydraulicCylinder.lua
local function updateGFX(cylinder, dt)
local valvePosition = electrics.values[cylinder.directionElectricsName] or 0
@/lua/vehicle/extensions/mqttGrafanaDemo.lua
local function updateGFX(dt)
if not client then return end
@/lua/vehicle/controller/pyrotechnicCharge.lua
local function updateGFX(dt)
if not hasTriggered then
@/lua/vehicle/extensions/tech/powertrainSensor.lua
local function updateGFX(dtSim)
for sensorId, _ in pairs(powertrains) do
@/lua/vehicle/extensions/escCalibration.lua
local function updateGFX(dt)
if skewStiffnessTestState == idleState then
@/lua/vehicle/controller/lightbar.lua
-- @param dt: Delta time since last frame in seconds
local function updateGFX(dt)
-- Skip if lightbar system isn't active
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaController.lua
local function updateGFX(dt)
if playerInfo.firstPlayerSeated then
@/lua/vehicle/controller/drivingDynamics/supervisors/components/aeroControl.lua
local function updateGFX(dt)
end
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/main.lua
lastDt = dtSim
sensors.updateGFX(dtSim) -- must be before input and ai
mapmgr.sendTracking() -- must be before ai
mapmgr.sendTracking() -- must be before ai
wheels.updateGFX(dtSim)
ai.updateGFX(dtSim) -- must be before input and after wheels
wheels.updateGFX(dtSim)
ai.updateGFX(dtSim) -- must be before input and after wheels
input.updateGFX(dtSim) -- must be as early as possible
ai.updateGFX(dtSim) -- must be before input and after wheels
input.updateGFX(dtSim) -- must be as early as possible
electrics.updateGFX(dtSim)
input.updateGFX(dtSim) -- must be as early as possible
electrics.updateGFX(dtSim)
controller.updateGFX(dtSim)
electrics.updateGFX(dtSim)
controller.updateGFX(dtSim)
electrics.updateGFXSecondStep(dtSim)
extensions.hook("updateGFX", dtSim) -- must be before drivetrain, hydros and after electrics
hydros.updateGFX(dtSim) -- must be early for FFB, but after (input, electrics) and before props
powertrain.updateGFX(dtSim)
hydros.updateGFX(dtSim) -- must be early for FFB, but after (input, electrics) and before props
powertrain.updateGFX(dtSim)
energyStorage.updateGFX(dtSim)
powertrain.updateGFX(dtSim)
energyStorage.updateGFX(dtSim)
drivetrain.updateGFX(dtSim)
energyStorage.updateGFX(dtSim)
drivetrain.updateGFX(dtSim)
beamstate.updateGFX(dtSim) -- must be after drivetrain
drivetrain.updateGFX(dtSim)
beamstate.updateGFX(dtSim) -- must be after drivetrain
protocols.updateGFX(dtSim)
beamstate.updateGFX(dtSim) -- must be after drivetrain
protocols.updateGFX(dtSim)
sounds.updateGFX(dtSim)
protocols.updateGFX(dtSim)
sounds.updateGFX(dtSim)
thrusters.updateGFX() -- should be after extensions.hook
sounds.updateGFX(dtSim)
thrusters.updateGFX() -- should be after extensions.hook
if playerInfo.firstPlayerSeated then
damageTracker.updateGFX(dtSim)
end
props.updateGFX() -- must be after hydros
material.updateGFX()
props.updateGFX() -- must be after hydros
material.updateGFX()
fire.updateGFX(dtSim)
material.updateGFX()
fire.updateGFX(dtSim)
recovery.updateGFX(dtSim)
fire.updateGFX(dtSim)
recovery.updateGFX(dtSim)
powertrain.updateGFXLastStage(dtSim)
@/lua/vehicle/extensions/utRecorder.lua
local function updateGFX(dt)
local pos = obj:getPosition()
@/lua/vehicle/controller/gauges/customModules/environmentData.lua
local function updateGFX(dt)
end
@/lua/vehicle/controller/braking/hydraulicPumpBrake.lua
local function updateGFX(dt)
--the engine technically runs the hydraulic pump for the brakes, so no spinning engine means no brake pressure
@/lua/vehicle/controller/drivingDynamics/CMU.lua
local function updateGFX(dt)
checkForRollOverAndCrash(dt)
local function updateGFXDebugNotEnabled(dt)
updateGFX(dt)
local function updateGFXDebugEnabled(dt)
updateGFX(dt)
@/lua/vehicle/extensions/core/quickAccess.lua
local function updateGFX(dt)
if actionCallbackCountdown then
@/lua/vehicle/extensions/tech/roadsSensor.lua
local function updateGFX(dtSim)
for sensorId, _ in pairs(roadsSensors) do
@/lua/vehicle/controller/airplaneSurfaces.lua
local function updateGFX(dt)
local rudder = input.rudder or 0
@/lua/vehicle/powertrain/manualGearbox.lua
local function updateGFX(device, dt)
--local gearIndex = device.grindingShiftTargetIndex or device.gearIndex
@/lua/vehicle/controller/wendoverGauges.lua
local function updateGFX(dt)
updateTimer = updateTimer + dt
@/lua/vehicle/controller/drivingDynamics/actuators/activeCenterDiffLock.lua
local function updateGFX(dt)
if not controlParameters.isEnabled then
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/controller/propAnimation/dualAxisLever.lua
local function updateGFX(dt)
updateTargetQueue(dt)
@/lua/vehicle/controller/propAnimation/hPattern.lua
local function updateGFX(dt)
if not relevantGearbox and not demoMode then
@/lua/vehicle/extensions/tech/CANBus/CANBusPeak.lua
local function updateGFX(dt)
if M.isConnected and next(canMessageCallbacks) ~= nil then
@/lua/vehicle/extensions/straightLine.lua
local function updateGFX(dt)
if baseTargetPos then
@/lua/vehicle/controller/drivingDynamics/actuators/electronicSplitShaftLock.lua
local function updateGFX(dt)
if not controlParameters.isEnabled then
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/wheels.lua
local function updateGFX(dt)
updateThermalsGFXMethod(dt)
@/lua/vehicle/controller/driveModes.lua
local function updateGFX(dt)
for _, buttonData in pairs(simpleControlButtons) do
@/lua/ge/extensions/util/export.lua
local function updateGFX(dt)
if lastMeshInfo and lastMeshInfo.dataIsReady then
@/lua/vehicle/powertrain/frictionClutch.lua
local function updateGFX(device, dt)
local kClutchToBellHousing = 30
@/lua/vehicle/controller/drivingDynamics/sensors/vehicleData.lua
local function updateGFX(dt)
end
local function updateGFXDebug(dt)
updateGFX(dt)
@/lua/vehicle/controller/sound/AVAS.lua
local function updateGFX(dt)
local gear = electrics.values.gear
@/lua/vehicle/controller/braking/transbrake.lua
local function updateGFX(dt)
electrics.values[electricsName] = gearbox.lockCoef == 0
@/lua/vehicle/controller/gauges/customModules/combustionEngineData.lua
local function updateGFX(dt)
end
@/lua/vehicle/extensions/tech/tyreBarrier.lua
local function updateGFX(dtSim)
if IMUcontroller ~= nil then