Refactor light sources
This commit is contained in:
@@ -10,11 +10,10 @@ import qualified Data.IntMap.Lazy as IM
|
||||
lightsForGloom :: World -> [(Point3,Float,Point3)]
|
||||
lightsForGloom w = mapMaybe getLS (IM.elems $ _lightSources w) ++ mapMaybe getTLS (_tempLightSources w)
|
||||
where
|
||||
getLS ls
|
||||
getLS = getlsparam . _lsParam
|
||||
getTLS = getlsparam . _tlsParam
|
||||
getlsparam ls
|
||||
| dist campos (fst2 $ _lsPos ls) > 1000 = Nothing
|
||||
| otherwise = Just ( _lsPos ls, _lsRad ls^(2::Int) , _lsIntensity ls)
|
||||
getTLS ls
|
||||
| dist campos (fst2 $ _tlsPos ls) > 1000 = Nothing
|
||||
| otherwise = Just ( _tlsPos ls, _tlsRad ls^(2::Int), _tlsIntensity ls)
|
||||
| otherwise = Just ( _lsPos ls, _lsRad ls^(2::Int) , _lsCol ls)
|
||||
campos = _cameraCenter w
|
||||
fst2 (V3 a b _) = V2 a b
|
||||
|
||||
Reference in New Issue
Block a user