Mid strictifying

This commit is contained in:
jgk
2021-07-29 23:42:27 +02:00
parent 67aa5c05c7
commit bd8ef3f416
22 changed files with 359 additions and 325 deletions
+11 -11
View File
@@ -10,9 +10,9 @@ import Geometry.Data
--import qualified Data.IntMap.Strict as IM
lightAt :: Point3 -> Int -> LightSource
lightAt (x,y,z) i =
lightAt (V3 x y z) i =
LS {_lsID = i
,_lsPos = (x,y,z)
,_lsPos = (V3 x y z)
,_lsDir = 0
,_lsRad = 700
,_lsIntensity = 0.75
@@ -20,18 +20,18 @@ lightAt (x,y,z) i =
basicLS :: PSType
basicLS = PutLS ls dec
where
ls = lightAt (0,0,0) 0
ls = lightAt (V3 0 0 0) 0
dec = onLayer PtLayer $ color white $ circleSolid 8
tLightFade :: Int -> Float -> (Int -> Float) -> Point2 -> TempLightSource
tLightFade 0 rmax intensityF (x,y) = TLS
{ _tlsPos = (x,y,0)
tLightFade 0 rmax intensityF (V2 x y) = TLS
{ _tlsPos = (V3 x y 0)
, _tlsRad = rmax
, _tlsIntensity = intensityF 0
, _tlsUpdate = \w _ -> (w, Nothing)
}
tLightFade i rmax intensityF p@(x,y) = TLS
{ _tlsPos = (x,y,0)
tLightFade i rmax intensityF p@(V2 x y) = TLS
{ _tlsPos = (V3 x y 0)
, _tlsRad = rmax
, _tlsIntensity = intensityF i
, _tlsUpdate = \w _ -> (w, Just $ tLightFade (i-1) rmax intensityF p)
@@ -43,14 +43,14 @@ tLightRad
-> Float -- ^ minimal radius (unused)
-> Point2
-> TempLightSource
tLightRad 0 rmax _ (x,y) = TLS
{ _tlsPos = (x,y,0)
tLightRad 0 rmax _ (V2 x y) = TLS
{ _tlsPos = (V3 x y 0)
, _tlsRad = rmax
, _tlsIntensity = 0.5
, _tlsUpdate = \w _ -> (w, Nothing)
}
tLightRad i rmax rmin p@(x,y) = TLS
{ _tlsPos = (x,y,0)
tLightRad i rmax rmin p@(V2 x y) = TLS
{ _tlsPos = (V3 x y 0)
, _tlsRad = rmax
, _tlsIntensity = 0.5
, _tlsUpdate = \w _ -> (w, Just $ tLightRad (i-1) rmax rmin p)