some cleanup
This commit is contained in:
parent
5c634c3865
commit
819559607c
2 changed files with 0 additions and 28 deletions
|
@ -161,10 +161,6 @@ class (Show c, Mass c) => Collidible c where
|
|||
Collision tx (V2 (floor $ signum d1x) 0)
|
||||
(_, True, True, False, True) ->
|
||||
Collision ty (V2 0 (floor $ signum d1y))
|
||||
-- (True, _, True, False, _) ->
|
||||
-- NoCollision
|
||||
-- (_, True, False, _, False) ->
|
||||
-- NoCollision
|
||||
(_, _, _, False, False) ->
|
||||
NoCollision
|
||||
(_, _, True, _, _) ->
|
||||
|
@ -224,12 +220,4 @@ elasticCollision damping mo1 (mo2, Collision ddt (V2 dirx diry)) dt =
|
|||
in
|
||||
velocityUpdater
|
||||
mo1
|
||||
-- (positionUpdater
|
||||
-- mo1
|
||||
-- (p1 +
|
||||
-- if dirx == 0 && diry == 0
|
||||
-- then (dt *) <$> V2 (-v1x) 0
|
||||
-- else (ddt *) <$> v1
|
||||
-- )
|
||||
-- )
|
||||
nvel
|
||||
|
|
|
@ -117,9 +117,6 @@ instance Actor Pituicat where
|
|||
{ pcMoveVel = (if pcXColl physCat then V2 0 1 else V2 1 1) *
|
||||
lerp (min 0.95 (60 * dt)) (pcMoveVel physCat) (pcTMoveVel physCat)
|
||||
, pcGrounded = pcGrounded physCat && abs dy * dt <= 2
|
||||
-- , pcPos = pcPos physCat + if not (pcXColl physCat)
|
||||
-- then (dt *) <$> pcMoveVel physCat
|
||||
-- else V2 0 0
|
||||
, pcEffects =
|
||||
foldl
|
||||
(\acc eff ->
|
||||
|
@ -203,19 +200,6 @@ instance Collidible Pituicat where
|
|||
(filter ((NoCollision /= ) . snd) collrs)
|
||||
}
|
||||
collide cat collrs@(collr@((other, Collision ddt (V2 dirx diry))):_) dt =
|
||||
-- let ncat = elasticCollision 0.3 cat other collr
|
||||
-- nvel@(V2 _ vy) = pcVel ncat
|
||||
-- grounded = diry == -1 && abs (vy * ddt) < 2
|
||||
-- fact = fromIntegral <$> V2
|
||||
-- (1 - abs dirx)
|
||||
-- (if diry /= -1 && quadrance nvel > bounceThreshold then 1 else 0)
|
||||
-- in
|
||||
-- ncat
|
||||
-- { pcVel = nvel * fact
|
||||
-- , pcMoveVel = pcMoveVel ncat * fact
|
||||
-- , pcTMoveVel = pcTMoveVel ncat * fact
|
||||
-- , pcGrounded = grounded
|
||||
-- }
|
||||
let ncat = elasticCollision 0.3 cat collr dt
|
||||
vel@(V2 vx vy) = velocity ncat
|
||||
moveVel@(V2 mx my) = pcMoveVel cat
|
||||
|
|
Loading…
Reference in a new issue