Refactor light sources
This commit is contained in:
@@ -2,6 +2,7 @@ module Dodge.Placement.Instance.Sensor
|
||||
( lightSensor
|
||||
) where
|
||||
import Color
|
||||
import Dodge.LightSource
|
||||
import Dodge.Data
|
||||
import Dodge.LevelGen.Data
|
||||
import Dodge.Default
|
||||
@@ -24,7 +25,7 @@ damageSensor damF wdth upf ps = pContID ps ( PutLS theLS)
|
||||
, _mcLSs = [lsid]
|
||||
}
|
||||
where
|
||||
theLS = defaultLS { _lsPos = V3 0 0 30 , _lsIntensity = 0.1 }
|
||||
theLS = lsPosCol (V3 0 0 30) (0.1)
|
||||
|
||||
lightSensor :: Float -> (Machine -> World -> World) -> PlacementSpot -> Placement
|
||||
lightSensor = damageSensor senseLasering
|
||||
@@ -46,7 +47,7 @@ sensorUpdate damF mc w = w & machines . ix mcid %~ upmc
|
||||
(senseData,dam) = partitionEithers $ map damF $ _mcDamage mc
|
||||
newSense = sum senseData
|
||||
ni = fromIntegral x / 1000
|
||||
upls = lsIntensity .~ V3 ni ni ni
|
||||
upls = lsParam . lsCol .~ V3 ni ni ni
|
||||
|
||||
sensorSPic :: Float -> Machine -> SPic
|
||||
sensorSPic wdth _ = ( colorSH yellow $ upperPrismPoly 25 (square wdth)
|
||||
|
||||
Reference in New Issue
Block a user