Clouds are affected by (underlying) lightmap

This commit is contained in:
2021-08-31 16:04:42 +01:00
parent 90111594c0
commit f58530cbb1
3 changed files with 108 additions and 11 deletions
+26
View File
@@ -0,0 +1,26 @@
module Dodge.Creature.ShadowBox
where
import Dodge.Data
import Polyhedra
import Geometry
import qualified Data.IntMap as IM
crToBox :: Creature -> [[Point3]]
crToBox cr = map (map f . polyToTris) $ boxXYZ 10 10 15
where
f = (+ V3 (x-5) (y-5) 1)
V2 x y = _crPos cr
youBox' :: World -> [[Point3]]
youBox' w = crToBox' $ _creatures w IM.! 0
youBox :: World -> [Point3]
youBox = concat . youBox'
crToBox' :: Creature -> [[Point3]]
crToBox' cr = map (map f . polyToTris) $ boxXYZ 20 20 15
where
f = (+ V3 (x-10) (y-10) 1)
V2 x y = _crPos cr
youSil :: World -> [Point3]
youSil = constructEdgesList . youBox'