Fix bug when forming convex hull of game room bounds
This commit is contained in:
+3
-2
@@ -25,6 +25,7 @@ import Tile
|
||||
import Polyhedra
|
||||
import Polyhedra.Data
|
||||
|
||||
import Data.List (nub)
|
||||
import Control.Monad.State
|
||||
import Control.Lens
|
||||
import System.Random
|
||||
@@ -120,9 +121,9 @@ gameRoomsFromRooms :: [Room] -> [GameRoom]
|
||||
gameRoomsFromRooms = map f
|
||||
where
|
||||
f rm = GameRoom
|
||||
{ _grViewpoints = map fst . foldl' (flip cutWalls) [] $ _rmPolys rm
|
||||
{ _grViewpoints = _rmViewpoints rm ++ (map fst . foldl' (flip cutWalls) [] $ _rmPolys rm)
|
||||
, _grViewpointsEx = map fst (_rmLinks rm)
|
||||
, _grBound = expandPolyByFixed 100 $ orderPolygon $ convexHullSafe $ concat $ _rmBound rm ++ _rmPolys rm
|
||||
, _grBound = expandPolyByFixed 100 . convexHullSafe . nub . concat $ _rmBound rm ++ _rmPolys rm
|
||||
, _grDir = snd . last $ _rmLinks rm
|
||||
, _grName = _rmName rm
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user