Refactor light sources

This commit is contained in:
2022-07-21 16:21:35 +01:00
parent cf5ec4a261
commit aabd8a2cb8
8 changed files with 71 additions and 45 deletions
+14 -6
View File
@@ -2,24 +2,32 @@
{-# LANGUAGE StrictData #-}
module Dodge.Data.LightSource where
import Geometry
import Picture.Data
import Control.Lens
data LightSourceDraw = DefaultLightSourceDraw
data TLSIntensity = ConstantIntensity
| TLSFade Point3 Int
data TLSUpdate = DestroyTLS
| TimerTLS
| IntensityTLS TLSIntensity
data LSParam = LSParam
{ _lsPos :: !Point3
, _lsRad :: !Float
, _lsCol :: !Point3
}
data LightSource = LS
{ _lsID :: !Int
{ _lsID :: Int
, _lsParam :: LSParam
, _lsDir :: !Float
, _lsPict :: LightSource -> Picture
, _lsDir :: Float
, _lsPict :: LightSourceDraw --LightSource -> Picture
}
data TempLightSource = TLS
{ _tlsParam :: LSParam
, _tlsUpdate :: TempLightSource -> Maybe TempLightSource
, _tlsTime :: !Int
, _tlsUpdate :: TLSUpdate --TempLightSource -> Maybe TempLightSource
, _tlsTime :: Int
}
makeLenses ''LSParam
makeLenses ''LightSource