Various refactoring

This commit is contained in:
2021-08-17 19:08:18 +02:00
parent 807bc908d1
commit 9bdb9a227f
18 changed files with 313 additions and 191 deletions
+5 -2
View File
@@ -24,6 +24,7 @@ import Polyhedra
import Control.Lens
import qualified Control.Foldl as L
--import qualified Data.Vector.Fusion.Stream.Monadic as VS
defaultInanimate :: Creature
defaultInanimate = defaultCreature & crActionPlan .~ Inanimate
@@ -39,8 +40,10 @@ lamp h = defaultInanimate
-- it is not clear that any of the attempts with Foldl help at all here
lampPic :: Float -> Picture
--{-# INLINE lampPic #-}
lampPic h = setLayer 1 (setDepth h . color white $ circleSolid 3)
++ (concatMap (preTriFold f) $ boxXYZnobase 5 5 (h-1))
lampPic h = pictures
[ setLayer 1 (setDepth h . color white $ circleSolid 3)
, concatMap (polyToTris . map f) $ boxXYZnobase 5 5 (h-1)
]
where
f pos = Verx (pos -.-.- V3 2.5 2.5 0) blue [] 0 polyNum