Add objects based on walls, called machines
This commit is contained in:
@@ -138,9 +138,8 @@ lineOnScreen w p1 p2 = pointInPolygon p1 sp
|
||||
sp = screenPolygon w
|
||||
sps = zip sp (tail sp ++ [head sp])
|
||||
|
||||
|
||||
drawWallFloor :: Wall -> Picture
|
||||
drawWallFloor wl = if _wlIsSeeThrough wl
|
||||
drawWallFloor wl = if _wlOpacity wl == SeeThrough
|
||||
then setDepth 0.9 . color c $ polygon [x,x +.+ n2,y+.+n2, y]
|
||||
else blank
|
||||
where
|
||||
@@ -159,7 +158,8 @@ wallsAndWindows w
|
||||
= (map f wls, map f wins)
|
||||
where
|
||||
f wl = (_wlLine wl, _wlColor wl)
|
||||
(wins,wls) = partition _wlIsSeeThrough . IM.elems . IM.filter _wlDraw $ wallsDoubleScreen w
|
||||
(wins,wls) = partition theTest . IM.elems . IM.filter _wlDraw $ wallsDoubleScreen w
|
||||
theTest wl = _wlOpacity wl /= Opaque
|
||||
|
||||
lightsForGloom :: World -> [(Point3,Float,Point3)]
|
||||
lightsForGloom w = mapMaybe getLS (IM.elems $ _lightSources w) ++ mapMaybe getTLS (_tempLightSources w)
|
||||
|
||||
@@ -17,11 +17,15 @@ worldShape w = _foregroundShape w
|
||||
<> foldMap (_spShape . floorItemSPic) (IM.filter (pointIsClose . _flItPos) $ _floorItems w)
|
||||
<> foldMap (_spShape . dbArg _prDraw) (IM.filter (pointIsClose . _pjPos) $ _props w)
|
||||
<> foldMap btShape (IM.filter (pointIsClose . _btPos) $ _buttons w)
|
||||
<> foldMap mcShape (IM.filter (pointIsClose . _mcPos) $ _machines w)
|
||||
where
|
||||
pointIsClose p = dist camCen p < winSize
|
||||
winSize = 30 + max (getWindowX w) (getWindowY w)
|
||||
camCen = _cameraCenter w
|
||||
|
||||
mcShape :: Machine -> Shape
|
||||
mcShape mc = uncurryV translateSHf (_mcPos mc) $ rotateSH (_mcDir mc) $ _spShape $ _mcDraw mc mc
|
||||
|
||||
btShape :: Button -> Shape
|
||||
btShape bt = uncurryV translateSHf (_btPos bt) $ rotateSH (_btRot bt) (_spShape $ _btPict bt bt)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user