GE Lua Documentation

Press F to search!

changeSpeed

Definition


-- @/lua/ge/extensions/core/camera.lua:1599

local function changeSpeed(val)
  local multiplier = 1 + math.abs(val)*0.2
  if val > 0 then camData.speed = camData.speed * multiplier end
  if val < 0 then camData.speed = camData.speed / multiplier end
  setSpeed(clamp(camData.speed, 2, 100))

  ui_message({txt="ui.camera.speed", context={speed=camData.speed}}, 1, "cameraspeed")
  if editor and editor.active and editor.showNotification then
    editor.showNotification(string.format("Camera Speed: %.2f", camData.speed), nil, "CamSpeed", nil, false)
  end
end

Callers

@/ui/ui-vue/mockdata/inputBindings.js
                "title": "ui.inputActions.vehicle.increase_cc_speed.title",
                "onDown": "extensions.use('cruiseControl').changeSpeed( 1/3.6)",
                "order": 52,
                "title": "ui.inputActions.vehicle.decrease_cc_speed_large.title",
                "onDown": "extensions.use('cruiseControl').changeSpeed(-10/3.6)",
                "order": 53,
                "isCentered": true,
                "onChange": "if core_camera then core_camera.changeSpeed(VALUE) end",
                "title": "ui.inputActions.camera.changeCameraSpeed.title",
                "title": "ui.inputActions.vehicle.decrease_cc_speed.title",
                "onDown": "extensions.use('cruiseControl').changeSpeed(-1/3.6)",
                "order": 53,
                "title": "ui.inputActions.vehicle.increase_cc_speed_large.title",
                "onDown": "extensions.use('cruiseControl').changeSpeed( 10/3.6)",
                "order": 52,
@/lua/ge/extensions/tech/platoonFunctions.lua

local function changeSpeed(speed)
  targetSpeed = speed
@/lua/vehicle/extensions/core/quickAccess.lua

                extensions.cruiseControl.changeSpeed(delta)
              else

                extensions.cruiseControl.changeSpeed(-delta)
              else
@/lua/vehicle/extensions/tech/platooning.lua

local function changeSpeed(speed)
  targetSpeed = speed
@/lua/ge/server/commands.lua
local function changeCameraSpeed(val)
  if core_camera then core_camera.changeSpeed(val) end
end
@/lua/vehicle/extensions/cruiseControl.lua

local function changeSpeed(offset)
  isEnabled = true
@/lua/vehicle/extensions/tech/ACC.lua

local function changeSpeed(speed)
    targetSpeed = speed