Cleanup
This commit is contained in:
@@ -3,20 +3,22 @@ module Dodge.Render.Lights (
|
||||
) where
|
||||
|
||||
import Data.Maybe
|
||||
import Dodge.Data.Universe
|
||||
import Dodge.Data.LWorld
|
||||
import Dodge.Data.CamPos
|
||||
import Dodge.Data.Config
|
||||
import Geometry
|
||||
import qualified IntMapHelp as IM
|
||||
import Control.Lens
|
||||
|
||||
lightsToRender :: Configuration -> World -> [(Point3, Float, Point3)]
|
||||
lightsToRender cfig w =
|
||||
mapMaybe getLS (IM.elems $ w ^. cWorld . lWorld . lightSources)
|
||||
++ mapMaybe getTLS (w ^. cWorld . lWorld . tempLightSources)
|
||||
lightsToRender :: Configuration -> CamPos -> LWorld -> [(Point3, Float, Point3)]
|
||||
lightsToRender cfig campos w =
|
||||
mapMaybe getLS (IM.elems $ w ^. lightSources)
|
||||
++ mapMaybe getTLS (w ^. tempLightSources)
|
||||
where
|
||||
getLS = getlsparam . _lsParam
|
||||
getTLS = getlsparam . _tlsParam
|
||||
cbox = w ^. cWorld . camPos . camBoundBox
|
||||
cpos = w ^. cWorld . camPos . camCenter
|
||||
cbox = campos ^. camBoundBox
|
||||
cpos = campos ^. camCenter
|
||||
getlsparam ls
|
||||
| not (pointInPolygon lpos cbox) && extraculltest = Nothing
|
||||
| otherwise = Just (_lsPos ls, rad ^ (2 :: Int), _lsCol ls)
|
||||
|
||||
Reference in New Issue
Block a user