GE Lua Documentation

Press F to search!

pointBBox

Definition


-- @/lua/common/mathlib.lua:1267

function pointBB2d(x, y, radius)
  return x - radius, y - radius, x + radius, y + radius
end

Callers

@/lua/ge/extensions/freeroam/bigMapMarkers.lua
  for i, poi in ipairs(filteredPois) do
    qt:preLoad(i, quadtree.pointBBox(poi.markerInfo.bigmapMarker.pos.x, poi.markerInfo.bigmapMarker.pos.y, settings.radius))
    count = i
      -- find all the list that potentially overlap with cur, and get all the ones that actually overlap into cluster list
      for id in qt:query(quadtree.pointBBox(bmi.pos.x, bmi.pos.y, settings.radius)) do
        local candidate = filteredPois[id]
@/lua/ge/extensions/gameplay/markers/missionMarker.lua
  for i, poi in ipairs(pois) do
    qt:preLoad(i, quadtree.pointBBox(poi.markerInfo.missionMarker.pos.x, poi.markerInfo.missionMarker.pos.y, 1.5)) -- Fixed radius of 1.5m
    count = i
      -- find all the list that potentially overlap with cur, and get all the ones that actually overlap into cluster list
      for id in qt:query(quadtree.pointBBox(pmi.pos.x, pmi.pos.y, 1.5)) do -- Fixed radius of 1.5m
        local candidate = poiList[id]
@/lua/ge/map.lua
  for i = 1, list2Count do
    nodeTree:preLoad(i, quadtree.pointBBox(nodeList2[i].pos.x, nodeList2[i].pos.y, nodeList2[i].radius))
  end
  for i = 1, list1Count do
    for j in nodeTree:queryNotNested(quadtree.pointBBox(nodeList1[i].pos.x, nodeList1[i].pos.y, nodeList1[i].radius)) do
      if not matchedL2[j] then
    if not (v.noMerge or endNodesOnly) or v.endNode then
      q:preLoad(k, pointBBox(v.pos.x, v.pos.y, v.radius))
      nodeCount = nodeCount + 1
    if not (n1.noMerge or endNodesOnly) or n1.endNode then
      for n2id in q:queryNotNested(pointBBox(n1.pos.x, n1.pos.y, n1.radius)) do
        if n1id < n2id then
  local edgeId, l2Xnorm
  for l_id in q_edges:queryNotNested(pointBBox(l1n1pos.x, l1n1pos.y, l1n1rad)) do
    local l2n1id, l2n2id = edges[l_id][1], edges[l_id][2]
      local nodeMin, eIdMin, xMin
      for edgeId in q_edges:queryNotNested(quadtree.pointBBox(n.pos.x, n.pos.y, n.radius)) do
        local l1n1id = edges[edgeId][1] -- edge inNode id
--         local validColorFound = true
--         for k in nodeKdTree:queryNotNested(pointBBox(node.pos.x, node.pos.y, node.radius * 4)) do -- check all nodes with this colorCode
--           if mapNodes[k].debugColorCode == colorCode then -- check distance between nodes with the same colorCode -- and nodes[k].pos:squaredDistance(nodes[nodeId].pos) < 400
        local validColorFound = true
        for k in nodeKdTree:queryNotNested(pointBBox(node.pos.x, node.pos.y, node.radius * 4)) do -- check nodes around nodeId
          if mapNodes[k].debugColorCode == colorCode then
    gp:setPointPositionRadius(nid, nPos, radius)
    nodeKdTree:preLoad(nid, pointBBox(nPos.x, nPos.y, radius))
    maxRadius = max(maxRadius, radius)
        local vPos = v.pos
        for item_id in nodeKdTree:queryNotNested(pointBBox(vPos.x, vPos.y, v.radius)) do
          if item_id ~= nodeName then -- what if the closest node is also an orphan?
    closestDist = searchRadius * searchRadius
    for item_id in edgeKdTree:queryNotNested(pointBBox(pos.x, pos.y, searchRadius)) do
      local i = stringFind(item_id, '\0')

  for item_id in edgeKdTree:queryNotNested(pointBBox(pos.x, pos.y, 20)) do -- assuming that no roads would have a radius greater than 20 m
    local i = stringFind(item_id, '\0')
      else
        for item_id in edgeKdTree:queryNotNested(pointBBox(position.x, position.y, searchRadius)) do
          if not seenEdges[item_id] then

    for node1id in nodeKdTree:queryNotNested(quadtree.pointBBox(camPos.x, camPos.y, drawDist)) do
      local node = map.nodes[node1id]
    local tmpPos, edgeDirVec, right1 = vec3(), vec3(), vec3()
    for edgeID in edgeKdTree:queryNotNested(quadtree.pointBBox(camPos.x, camPos.y, drawDist)) do
      local i = stringFind(edgeID, '\0')
@/lua/ge/extensions/editor/slotTrafficEditor.lua
  if qtNodes then
    for nid in qtNodes:query(quadtree.pointBBox(camPos.x, camPos.y, editor.getPreference("gizmos.visualization.visualizationDrawDistance"))) do
      local node = mapNodes[nid]
          n.normal = map.surfaceNormal(nPos, radius * 0.5)
          qtNodes:preLoad(nid, quadtree.pointBBox(nPos.x, nPos.y, radius))
          gp:setPointPositionRadius(nid, nPos, radius)
      local rayDir = ray.dir
      for nid in qtNodes:query(quadtree.pointBBox(camPos.x, camPos.y, 200)) do
        local node = mapNodes[nid]
    if qtNodes then
      for nid in qtNodes:query(quadtree.pointBBox(camPos.x, camPos.y, editor.getPreference("gizmos.visualization.visualizationDrawDistance"))) do
        local node = mapNodes[nid]
@/lua/vehicle/mapmgr.lua
    bestDist = searchRadiusSq
    for item_id in edgeKdTree:queryNotNested(pointBBox(pos.x, pos.y, searchRadius)) do
      local i = stringFind(item_id, '\0')

  for item_id in edgeKdTree:queryNotNested(pointBBox(pos.x, pos.y, 20)) do -- assuming that no roads would have a radius greater than 20 m
    local i = stringFind(item_id, '\0')
      else
        for item_id in edgeKdTree:queryNotNested(pointBBox(position.x, position.y, searchRadius)) do
          if not seenEdges[item_id] then
@/lua/ge/extensions/editor/aiViz.lua
          n.normal = n.normal or map.surfaceNormal(nPos, radius * 0.5)
          qtNodes:preLoad(nid, quadtree.pointBBox(nPos.x, nPos.y, radius))
        end
      local rayDir = ray.dir
      for nid in qtNodes:query(quadtree.pointBBox(camPos.x, camPos.y, 200)) do
        local node = mapNodes[nid]
    if qtNodes then
      for nid in qtNodes:query(quadtree.pointBBox(camPos.x, camPos.y, editor.getPreference("gizmos.visualization.visualizationDrawDistance"))) do
        local node = mapNodes[nid]
@/lua/ge/extensions/gameplay/missions/startTrigger.lua
      for i, loc in ipairs(locations) do
        qt:preLoad(i, quadtree.pointBBox(loc.pos.x, loc.pos.y, (mergeRadius or loc.radius)))
        count = i
          -- find all the locations that potentially overlap with cur, and get all the ones that actually overlap into cluster list
          for id in qt:query(quadtree.pointBBox(cur.pos.x, cur.pos.y, mergeRadius or cur.radius)) do
            local candidate = locations[id]