Add menu option for auto camera rotation
This commit is contained in:
+4
-17
@@ -197,6 +197,7 @@ reflectCircCreatures rad p1 p2 cs
|
||||
$ IM.mapMaybe (reflectCircCreature rad p1 p2) cs
|
||||
where
|
||||
f (a,_,_) = magV (a -.- p1)
|
||||
|
||||
-- | collides a point with forcefields
|
||||
-- if found, returns point of collision, deflection if required, and the id
|
||||
collidePointFFs :: a
|
||||
@@ -204,24 +205,10 @@ collidePointFFs = undefined
|
||||
collidePointFF :: a
|
||||
collidePointFF = undefined
|
||||
--
|
||||
--collidePointFFs :: Point2 -> Point2 -> StdGen -> IM.IntMap ForceField
|
||||
-- -> Maybe (Point2,(Maybe (Point2,StdGen),Int))
|
||||
--collidePointFFs p1 p2 g fs = listToMaybe $ sortBy f $ IM.elems
|
||||
-- $ IM.mapMaybe (collidePointFF p1 p2 g) fs
|
||||
-- where f (a,_) (b,_) = compare (magV (p1 -.- a)) (magV (p1 -.- b))
|
||||
--
|
||||
--collidePointFF :: Point2 -> Point2 -> StdGen -> ForceField
|
||||
-- -> Maybe (Point2,(Maybe (Point2,StdGen),Int))
|
||||
--collidePointFF p1 p2 g ff = fmap f ip
|
||||
-- where (p3:p4:_) = _ffLine ff
|
||||
-- ip = intersectSegSeg p1 p2 p3 p4
|
||||
-- ref = (_ffDeflect ff) <*> Just g <*> Just (p2 -.- p1) <*> Just ff
|
||||
-- f p = (p, (ref, _ffID ff))
|
||||
|
||||
-- | Looks for first collision of a circle with walls.
|
||||
-- | Looks for overlap of a circle with walls.
|
||||
-- If found, gives wall
|
||||
collideCircWallsReturnWall :: Point2 -> Float -> IM.IntMap Wall -> Maybe Wall
|
||||
collideCircWallsReturnWall p rad ws
|
||||
overlapCircWallsReturnWall :: Point2 -> Float -> IM.IntMap Wall -> Maybe Wall
|
||||
overlapCircWallsReturnWall p rad ws
|
||||
= L.fold (safeMinimumOnMaybeL (fmap (dist p) . f . _wlLine))
|
||||
ws
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user