simplify collision detection
This commit is contained in:
parent
f6860c1332
commit
e444c03c33
1 changed files with 4 additions and 8 deletions
12
src/Test.hs
12
src/Test.hs
|
@ -305,21 +305,17 @@ checkBoundsCollision
|
|||
| otherwise = V2 (0 * mr) (0 * mc)
|
||||
where
|
||||
ntestr
|
||||
| ndistr <= hheight + 0.15 = True
|
||||
= ndistr <= hheight + 0.15
|
||||
-- | ncdistsq <= 0.005 = True
|
||||
| otherwise = False
|
||||
ntestc
|
||||
| ndistc <= hwidth + 0.15 = True
|
||||
= ndistc <= hwidth + 0.15
|
||||
-- | ncdistsq <= 0.005 = True
|
||||
| otherwise = False
|
||||
testr
|
||||
| distr <= hheight + 0.15 = True
|
||||
= distr <= hheight + 0.15
|
||||
-- | cdistsq <= 0.005 = True
|
||||
| otherwise = False
|
||||
testc
|
||||
| distc <= hwidth + 0.15 = True
|
||||
= distc <= hwidth + 0.15
|
||||
-- | cdistsq <= 0.005 = True
|
||||
| otherwise = False
|
||||
ndistr = abs (fr - (fromIntegral (floor fr :: Int) + (minr + hheight)))
|
||||
ndistc = abs (fc - (fromIntegral (floor fc :: Int) + (minc + hwidth)))
|
||||
distr = abs (pr - (fromIntegral (floor fr :: Int) + (minr + hheight)))
|
||||
|
|
Loading…
Reference in a new issue