nonsticky walls
This commit is contained in:
parent
4226265030
commit
cc3480c0c0
1 changed files with 6 additions and 4 deletions
10
src/Test.hs
10
src/Test.hs
|
@ -380,12 +380,14 @@ checkBoundsCollision2
|
||||||
where
|
where
|
||||||
vel@(V2 vr vc) = fmap (/ dt) (next - pre)
|
vel@(V2 vr vc) = fmap (/ dt) (next - pre)
|
||||||
colltr
|
colltr
|
||||||
| vr > 0 = (((fromIntegral (floor pr :: Int)) + minr - 0.15) - pr) / vr
|
| vr > 0 && prr <= maxr = (((fromIntegral (floor pr :: Int)) + minr - 0.15) - pr) / vr
|
||||||
| vr < 0 = (((fromIntegral (floor pr :: Int)) + maxr + 0.15) - pr) / vr
|
| vr < 0 && prr >= minr = (((fromIntegral (floor pr :: Int)) + maxr + 0.15) - pr) / vr
|
||||||
| otherwise = dt
|
| otherwise = dt
|
||||||
colltc
|
colltc
|
||||||
| vc > 0 = (((fromIntegral (floor pc :: Int)) + minc - 0.15) - pc) / vc
|
| vc > 0 && prc <= maxc = (((fromIntegral (floor pc :: Int)) + minc - 0.15) - pc) / vc
|
||||||
| vc < 0 = (((fromIntegral (floor pc :: Int)) + maxc + 0.15) - pc) / vc
|
| vc < 0 && prc >= minc = (((fromIntegral (floor pc :: Int)) + maxc + 0.15) - pc) / vc
|
||||||
| otherwise = dt
|
| otherwise = dt
|
||||||
inrow = pr > minr && pr < maxr
|
inrow = pr > minr && pr < maxr
|
||||||
incol = pc > minc && pc < maxc
|
incol = pc > minc && pc < maxc
|
||||||
|
prr = pr - (fromIntegral $ floor pr)
|
||||||
|
prc = pc - (fromIntegral $ floor pc)
|
||||||
|
|
Loading…
Reference in a new issue