VE Lua Documentation

Press F to search!

getObjects

Definition


-- @/lua/vehicle/mapmgr.lua:171

local function getObjects()
  local simTime = obj:getSimTime()
  if simTime ~= lastSimTime then
    local objData = obj:getLastMailbox("objUpdate")
    M.objects = #objData == 0 and {} or lpack.decode(objData)
    lastSimTime = simTime
  end
  return M.objects
end

Callers

@/lua/ge/extensions/editor/trafficManager.lua

  for _, objName in ipairs(group:getObjects()) do -- automatically registers objects as session data, depending on class and dynamic fields
    local obj = scenetree.findObject(objName)
@/lua/vehicle/extensions/tech/trailSim.lua
local function updateDisplay(dt)
  local objects = mapmgr.getObjects()
  local thisVehicle = objects[objectId]
@/lua/ge/extensions/freeroam/specialTriggers.lua
    if obj:getClassName() == 'SimGroup' then -- if object is a SimGroup, process all objects within it
      for _, o in ipairs(obj:getObjects()) do
        setState(tonumber(o) or scenetree.findObject(o):getID(), state)
        v.isNested = true -- if nested SimGroup structure exists, process the children of the SimGroups, in parallel
        for _, o in ipairs(obj:getObjects()) do
          local obj = scenetree.findObjectById(tonumber(o) or scenetree.findObject(o):getID())
          v.maxIdx = 0
          for _, o in ipairs(obj:getObjects()) do
            local obj = scenetree.findObjectById(tonumber(o) or scenetree.findObject(o):getID())
                  local idx = data.idxList[data.currIdx]
                  local innerObjects = obj:getObjects()
                      if obj1 and obj1:getGroup():getName() == name and obj1:getClassName() == 'SimGroup' then
                        local o2 = obj1:getObjects()[idx]
                        if o2 then
@/lua/vehicle/controller/tech/idealRADARSensor.lua
  local vehicles, ctr = {}, 1
  for k, _ in pairs(mapmgr.getObjects()) do
    if k ~= objectId then
@/lua/ge/extensions/editor/api/decal.lua
  local name = Sim.getUniqueName("NewTemplate")
  local templates = Engine.Render.DecalMgr.getSet():getObjects()
@/lua/ge/extensions/editor/gen/world.lua
		-- refresh
		local list = groupBat:getObjects()
		-- refresh static mmeshes
	if groupBat then
		local list = groupBat:getObjects()
		if tableSize(list)>0 then return end
	local nm = rayCast.object.name
		lo('?? mup0:'..tostring(nm)..':'..tostring(scope)..':'..tostring(indrag)..':'..tostring(cedit.part)..':'..tostring(cmesh)..':'..tostring(Engine.Render.DecalMgr.getDecalInstance(1))) --#Engine.Render.DecalMgr.getSet():getObjects())) --..tostring(editor.getDecalTemplates():size())) --..rayCast.object.name)
	if nm == nil then return end
		if groupBat then
			local list = groupBat:getObjects()
			for _,o in pairs(list) do
@/lua/vehicle/ai.lua
local function updatePlayerData()
  mapmgr.getObjects()
  if not next(mapmgr.objects) then return end -- prevents changes if table is empty
  local i = 0
  for id in pairs(mapmgr.getObjects()) do
    if id ~= objectId then
  table.clear(traffic.trafficTable)
  for plID, v in pairs(mapmgr.getObjects()) do
    if plID ~= objectId and (M.mode ~= 'chase' or plID ~= player.id or internalState.chaseData.playerState == 'stopped') then

  for plID, v in pairs(mapmgr.getObjects()) do
    if plID ~= objectId and (M.mode ~= 'chase' or plID ~= player.id or internalState.chaseData.playerState == 'stopped') then

  for plID, v in pairs(mapmgr.getObjects()) do
    if plID ~= objectId and v.states then
          -- Check if there's a vehicle next to this one
          for otherID, v in pairs(mapmgr.getObjects()) do
            if otherID ~= objectId and v.pos and otherID ~= trafficStates.action.nearestPoliceId and v.dirVec and v.dirVec:dot(ego.dirVec) < 0 then
            local distToJcenter = tSi.turnNode and ego.pos:distance(mapData.positions[tSi.turnNode]) or 1
            for vId, v in pairs(mapmgr.getObjects()) do
              if vId ~= objectId then

      for vehId in pairs(mapmgr.getObjects()) do
        if vehId ~= objectId then
    if dt then
      for k, v in pairs(mapmgr.getObjects()) do
        if k ~= objectId then
@/lua/vehicle/extensions/tech/ACC.lua
    local vehicles, ctr = {}, 1
    for k, _ in pairs(mapmgr.getObjects()) do
        if k ~= objectId then
@/lua/vehicle/extensions/tech/platooning.lua
  local vehicles, ctr = {}, 1
  for k, v in pairs(mapmgr.getObjects()) do
    if k == tonumber(vehicleInfront) then -- for dmpc key
    for i, vehicles in ipairs(relayVehicles) do 
      for k, v in pairs(mapmgr.getObjects()) do
        if k == tonumber(vehicles) then
@/lua/ge/extensions/editor/gen/decal.lua
        if groupLines then
            local aobj = groupLines:getObjects()
--                lo('?? pre:'..tableSize(editor.getAllRoads())..':'..#scenetree.getAllObjects())
@/lua/ge/extensions/editor/roadRiverCacheHandler.lua
  for _, group in ipairs(groups) do
    for _, name in pairs(group:getObjects()) do
      local object = scenetree.findObject(name)
@/lua/ge/extensions/editor/gen/test.lua
    if groupBat then
        local list = groupBat:getObjects()
        for _,o in pairs(list) do
		-- refresh
		local list = groupBat:getObjects()
		-- refresh static mmeshes
@/lua/ge/extensions/ui/uiNavi.lua
  if poi_set then
  local poios = poi_set:getObjects() or {}
  for _, pid in pairs(poios) do