lib/shmup_lib.rb
# This optimization is primarily useful when members of group2 are loosely spatially ordered
# @param [Array] group1
# @param [Array] group2
# @param [GeoGeo::Box] group1_bbox
# @return [Array]
This optimization is primarily useful when members of group2 are loosely spatially ordered
This optimization is primarily useful when members of group2 are loosely spatially ordered
def __pre_sweep_between_groups(group1, group2, group1_bbox = nil)
      il = group1.length
      jl = group2.length
      group1_bbox ||= __group_bbox(group1, 0, il)
      group2_bbox = __group_bbox(group2, 0, jl)
      j = 0
      f_j = false
      l_j = jl
      flag = true
      while j < jl
        if GeoGeo::intersect?(group2[j].collider, group1_bbox)
          f_j = j if flag
          l_j = j + 1
          flag = false
        end
        j += 1
      end
      if flag
        f_j = jl
      elsif f_j != 0 || l_j != jl
        group2_bbox = __group_bbox(group2, f_j, l_j)
      end
      return f_j, l_j, group2_bbox
    end
def __pre_sweep_between_groups ( group1 , group2 , group1_bbox = nil ) il = group1 . length jl = group2 . length group1_bbox ||= __group_bbox ( group1 , 0 , il ) group2_bbox = __group_bbox ( group2 , 0 , jl ) j = 0 f_j = false l_j = jl flag = true while j < jl if GeoGeo :: intersect? ( group2 [ j ] . collider , group1_bbox ) f_j = j if flag l_j = j + 1 flag = false end j += 1 end if flag f_j = jl elsif f_j != 0 || l_j != jl group2_bbox = __group_bbox ( group2 , f_j , l_j ) end return f_j , l_j , group2_bbox end
This optimization is primarily useful when members of group2 are loosely spatially ordered
This optimization is primarily useful when members of group2 are loosely spatially ordered
None
Array
group1
group2
group1_bbox
None