Refactor light sources
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
module Dodge.Default.LightSource where
|
||||
import Dodge.Data
|
||||
import Picture
|
||||
import Geometry
|
||||
import LensHelp
|
||||
|
||||
defaultLS :: LightSource
|
||||
defaultLS = LS
|
||||
@@ -13,13 +11,8 @@ defaultLS = LS
|
||||
, _lsCol = 0.6
|
||||
}
|
||||
, _lsDir = 0
|
||||
, _lsPict = defLSPic
|
||||
, _lsPict = DefaultLightSourceDraw --defLSPic
|
||||
}
|
||||
defLSPic :: LightSource -> Picture
|
||||
defLSPic ls = setLayer BloomNoZWrite . translate3 (_lsPos $ _lsParam ls) . color col $ circleSolid 4
|
||||
where
|
||||
col = V4 r g b 2
|
||||
V3 r g b = _lsCol $ _lsParam ls
|
||||
defaultTLS :: TempLightSource
|
||||
defaultTLS = TLS
|
||||
{ _tlsParam = LSParam
|
||||
@@ -27,10 +20,6 @@ defaultTLS = TLS
|
||||
, _lsRad = 0
|
||||
, _lsCol = 0.5
|
||||
}
|
||||
, _tlsUpdate = f
|
||||
, _tlsUpdate = TimerTLS
|
||||
, _tlsTime = 1
|
||||
}
|
||||
where
|
||||
f t
|
||||
| _tlsTime t <= 0 = Nothing
|
||||
| otherwise = Just $ t & tlsTime -~ 1
|
||||
|
||||
Reference in New Issue
Block a user