VE Lua Documentation

Press F to search!

applyImpulseBody

Definition


-- @/lua/vehicle/thrusters.lua:109

local function applyImpulseBody(force, dt)
  local n1, n2 = v.data.refNodes[0].ref, v.data.refNodes[0].back
  for _, thruster in ipairs(impulseState) do
    if thruster[1] == n1 and thruster[2] == n2 then
      thruster[3] = force
      thruster[4] = dt or lastDt
      return
    end
  end

  table.insert(impulseState, {n1, n2, force, dt})
  M.update = update
  updateCorePhysicsStepEnabled()
end

Callers