Fix bug when forming convex hull of game room bounds
This commit is contained in:
@@ -4,6 +4,7 @@ Functions controlling the movement of the screen camera:
|
||||
and the position that the character sees from: '_cameraViewFrom'. -}
|
||||
module Dodge.Update.Camera
|
||||
( updateCamera
|
||||
, farWallPoints
|
||||
)
|
||||
where
|
||||
import Dodge.Data
|
||||
@@ -176,6 +177,14 @@ farWallDist p w = (winFac /) . min maxViewDistance $ ssfold (> maxViewDistance)
|
||||
grs = filter (pointInOrOnPolygon p . _grBound) (_gameRooms w)
|
||||
wos = wallsOnScreen w
|
||||
|
||||
farWallPoints :: Point2 -> World -> [Point2]
|
||||
farWallPoints p w = concatMap _grViewpoints grs ++ linkvps
|
||||
where
|
||||
grs = filter (pointInOrOnPolygon p . _grBound) (_gameRooms w)
|
||||
linkvps = map extend (concatMap _grViewpointsEx grs)
|
||||
extend :: Point2 -> Point2
|
||||
extend outp = p +.+ maxViewDistance *.* safeNormalizeV (outp -.- p)
|
||||
|
||||
--farWallDist :: Point2 -> World -> Float
|
||||
--farWallDist p w = (winFac /) $ fromMaybe maxViewDistance
|
||||
-- $ L.fold (L.premap (dist p) L.maximum) vdists
|
||||
|
||||
Reference in New Issue
Block a user