oakmound / oak

A pure Go game engine
Apache License 2.0
1.55k stars 83 forks source link

alg\floatgeom: Fix Polygon rect collision overeager singledimension overlap #178

Closed Implausiblyfun closed 2 years ago

Implausiblyfun commented 2 years ago

Polygon overlap checks have 2 parts. In the first part we attempt to see if the bounding rectangles overlap.

Previously if the bounding rectangles overlapped in a single dimension we claimed they overlapped which is incorrect. This led to claims of overlap in instances where it should not have occured.

codecov-commenter commented 2 years ago

Codecov Report

Merging #178 (5e79f98) into master (6a1342f) will increase coverage by 0.11%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #178      +/-   ##
==========================================
+ Coverage   92.61%   92.72%   +0.11%     
==========================================
  Files         141      141              
  Lines        6403     6406       +3     
==========================================
+ Hits         5930     5940      +10     
+ Misses        411      406       -5     
+ Partials       62       60       -2     
Impacted Files Coverage Δ
alg/floatgeom/polygon.go 98.14% <100.00%> (+3.86%) :arrow_up:
event/handler.go 96.66% <0.00%> (-3.34%) :arrow_down:
sceneLoop.go 94.38% <0.00%> (+3.37%) :arrow_up:
drawLoop.go 60.37% <0.00%> (+3.77%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6a1342f...5e79f98. Read the comment docs.