This commit is contained in:
nek0 2018-05-05 13:41:55 +02:00
parent 38218fa50c
commit a8beb8fca5

View file

@ -359,9 +359,9 @@ checkBoundsCollision2
-> V2 Double
checkBoundsCollision2
pre@(V2 pr pc) next@(V2 nr nc) dt acc (Boundaries (minr, minc) (maxr, maxc))
| (colltr >= dt || abs colltr > 0.1) && (colltc >= dt || abs colltc > 0.1) = acc
| (colltr >= dt || abs colltr > 0.1) = (V2 1 0) * acc
| (colltc >= dt || abs colltc > 0.1) = (V2 0 1) * acc
| (colltr > dt || colltr < -0.1) && (colltc > dt || colltc < -0.1) = acc
| (colltr > dt || colltr < -0.1) = (V2 1 0) * acc
| (colltc > dt || colltc < -0.1) = (V2 0 1) * acc
| otherwise = V2 0 0
where
vel@(V2 vr vc) = fmap (/ dt) (next - pre)