getClosestHotNodeTempDistance
Definition
-- @/lua/vehicle/fire.lua:43
local function getClosestHotNodeTempDistance(cid)
if next(hotNodes) == nil then
return 0, math.huge
end
local minSquareDistance = math.huge
local minDistanceTemperature = 0
for k, v in pairs(hotNodes) do
local squareDistance = obj:nodeSquaredLength(k, cid)
if squareDistance <= minSquareDistance then
minSquareDistance = squareDistance
minDistanceTemperature = v.temperature
end
end
return minDistanceTemperature, sqrt(minSquareDistance)
end
Callers
@/lua/vehicle/powertrain/combustionEngineThermals.lua
local energyExhaustToAir = exhaustTempSquared * exhaustTempSquared * kExhaustToAir
local fireTemperature, fireDistance = fire.getClosestHotNodeTempDistance(parentEngine.engineNodeID)
local energyFireToBlock = (fireTemperature - M.engineBlockTemperature) * 50 * max(10 - fireDistance, 0)
local energyExhaustToAir = exhaustTempSquared * exhaustTempSquared * kExhaustToAir
local fireTemperature, fireDistance = fire.getClosestHotNodeTempDistance(parentEngine.engineNodeID)
local energyFireToBlock = max((fireTemperature - M.engineBlockTemperature) * 50 * max(10 - fireDistance, 1), 0)
@/lua/vehicle/wheels.lua
local energyBrakeCoreToAir = (wd.brakeCoreTemperature - tEnv) * coreCooling * wd.brakeCoolingArea
local fireTemperature, fireDistance = fire.getClosestHotNodeTempDistance(wd.node1)
local energyFireToDiskSurface = max((fireTemperature - wd.brakeSurfaceTemperature) * 5 * max(10 - fireDistance, 0), 0)