VE Lua Documentation

Press F to search!

getBeamLength

Definition


-- @/=[C]:-1
function getBeamLength(...)

Callers

@/lua/vehicle/controller/pneumatics/actuators.lua
    for _, v in pairs(g.beams) do
      local beamLength = max(obj:getBeamLength(v.cid) - v.lengthOffset, 0)
      local beamVolume = v.surface * beamLength + 1e-30
    for _, v in pairs(g.beams) do
      local beamLength = obj:getBeamLength(v.cid)
      local beamVolume = v.surface * beamLength
    else
      local beamLength = max(obj:getBeamLength(relevantBeams[name].cid) - relevantBeams[name].lengthOffset, 0)
      local beamVolume = relevantBeams[name].surface * beamLength
@/lua/vehicle/controller/bypassDampers.lua
  for _, damper in ipairs(dampers) do
    local beamLength = obj:getBeamLength(damper.beamCid)
    local displacement = -beamLength + damper.initialBeamLength
@/lua/vehicle/powertrain/hydraulicCylinder.lua
    currentBeamVelocity = currentBeamVelocity + cylinder.beamVelocitySmoothers[cid]:get(beamVelocity)
    currentExtend = currentExtend + obj:getBeamLength(cid)
    cylinder.previousBeamVelocities[cid] = cylinder.beamVelocitySmoothers[cid]:value(beamVelocity)
    currentBeamVelocity = currentBeamVelocity + cylinder.beamVelocitySmoothers[cid]:get(beamVelocity)
    currentExtend = currentExtend + obj:getBeamLength(cid)
    cylinder.previousBeamVelocities[cid] = cylinder.beamVelocitySmoothers[cid]:value(beamVelocity)
    currentBeamVelocity = currentBeamVelocity + cylinder.beamVelocitySmoothers[cid]:get(beamVelocity)
    currentExtend = currentExtend + obj:getBeamLength(cid)
    cylinder.previousBeamVelocities[cid] = cylinder.beamVelocitySmoothers[cid]:value(beamVelocity)
    currentBeamVelocity = currentBeamVelocity + cylinder.beamVelocitySmoothers[cid]:get(beamVelocity)
    currentExtend = currentExtend + obj:getBeamLength(cid)
    cylinder.previousBeamVelocities[cid] = cylinder.beamVelocitySmoothers[cid]:value(beamVelocity)
    currentBeamVelocity = currentBeamVelocity + cylinder.beamVelocitySmoothers[cid]:get(beamVelocity)
    currentExtend = currentExtend + obj:getBeamLength(cid)
    cylinder.previousBeamVelocities[cid] = cylinder.beamVelocitySmoothers[cid]:value(beamVelocity)
@/lua/vehicle/controller/pneumatics/autoLevelSuspension.lua
    local controlBeamId = controlGroup.controlBeamId
    local curLength = obj:getBeamLength(controlBeamId)

    g.currentLength = obj:getBeamLength(g.controlBeamId)
    g.timeOutsideTarget = 0
      local defaultTargetLength = groupData.defaultTargetLength
      local initialCurrentLength = obj:getBeamLength(controlBeamId)
@/lua/vehicle/controller/sound/linearMovement.lua
  --get the current length of our sensor beam
  local positionSensorBeamLength = obj:getBeamLength(positionSensorBeamCid)
  --calculate a smoothed velocity of that beam length
  if hasEndstops then
    local positionSensorBeamLength = obj:getBeamLength(positionSensorBeamCid)
    if positionSensorBeamLength <= positionSensorBeamMinPosition then
local function reset(jbeamData)
  lastPositionSensorBeamLength = obj:getBeamLength(positionSensorBeamCid)
  lastSegmentMod = 0

  lastPositionSensorBeamLength = obj:getBeamLength(positionSensorBeamCid)
  local velocitySmoothing = jbeamData.velocitySmoothing or 5
@/lua/vehicle/controller/playerController.lua
  for _, cid in ipairs(lockBeams) do
    obj:setBeamLength(cid, obj:getBeamLength(cid))
    obj:setBeamSpringDamp(cid, spring, damp, -1, -1)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veJBeamPicker.lua

local function getBeamLength(beamID)
  local beam = vEditor.vdata.beams[beamID]
local beamDataRendering = {
  {name = "Length",           enabled = im.BoolPtr(true),     units = "m",      color = rainbowColor(8, 2, 1),   data = function(id) return getBeamLength(id) end, plotData = {}},
  {name = "Speed",            enabled = im.BoolPtr(false),    units = "m/s",    color = rainbowColor(8, 3, 1),   data = function(id) getVELuaBeamData(id, "speed", "obj:getBeamVelocity(" .. id .. ")") return M.beamDataFromVELua[id].speed end, plotData = {}},
@/lua/vehicle/powertrain/linearActuator.lua
    velocity = velocity + obj:screwBeam(cid, actuatorForce * invCidCount, device.speedLimit, math.huge, math.cos(device.leadAngle), 1, 1, device.frictionForce, 0.0, 0, device.minExtend, device.maxExtend)
    currentExtend = currentExtend + obj:getBeamLength(cid)
  end
@/lua/vehicle/bdebugImpl.lua
        local beam = v.data.beams[i]
        local beamText = string.format("%d: %.3f m", beam.cid, obj:getBeamLength(beam.cid))
        text = k ~= tblSize and text .. beamText .. ', ' or text .. beamText

          local currLen = obj:getBeamLength(beam.cid)
          local restLen = obj:getBeamRefLength(beam.cid)
        if partsSelected[beam.partPath or v.config.partsTree.partPath] then
          local currLen = obj:getBeamLength(beam.cid)
          local restLen = obj:getBeamRefLength(beam.cid)