Work on room generation/laser run past

This commit is contained in:
2026-03-17 21:50:28 +00:00
parent 13b12f01a8
commit 3b4cf68a15
18 changed files with 656 additions and 528 deletions
@@ -1,8 +1,11 @@
module Dodge.Placement.Instance.LightSource (
mntLSOn,
mntLSCond,
aShape,
aBar,
lShape,
jShape,
liShape,
mntLightLnkCond,
mntLS,
vShape,
+7
View File
@@ -17,11 +17,18 @@ damageSensor dt wdth mtrid ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1) $
PutMachine
(reverse $ square wdth)
( defaultMachine
& mcMaterial .~ mattype
& mcMounts . at OTTrigger .~ mtrid
& mcMounts . at OTLightSource ?~ lsid
& mcType .~ McDamSensor (DamSensor 0 dt)
)
Nothing
where
mattype = case dt of
LaserSensor -> Photovoltaic
ElectricSensor -> LightningRod
ThermalSensor -> Pyroelectric
PhysicalSensor -> Piezoelectric
lightSensor :: Float -> Maybe Int -> PlacementSpot -> Placement
lightSensor = damageSensor LaserSensor
+4 -5
View File
@@ -27,8 +27,6 @@ import LensHelp
import Linear
import NewInt
--import System.Random
-- when placing a placement, we update the world and the room and assign an id
-- to the placement. This id should be associated with the type of placement and
-- match up with the created id for the object (creature id, flitid id, etc)
@@ -199,7 +197,7 @@ plMachine ::
plMachine wallpoly mc mitm p rot gw =
( mcid
, gw & tolw . machines . at mcid ?~ themc
& gwWorld %~ placeMachineWalls wallpoly mcid wlid
& gwWorld %~ placeMachineWalls (_mcMaterial mc) wallpoly mcid wlid
& tolw %~ maybe id placeturretitm mitm
)
where
@@ -215,10 +213,11 @@ plMachine wallpoly mc mitm p rot gw =
itid = IM.newKey $ gw ^. gwWorld . cWorld . lWorld . items
itm' = itm & itID .~ NInt itid & itLocation .~ OnTurret mcid
placeMachineWalls :: [Point2] -> Int -> Int -> World -> World
placeMachineWalls poly mcid = insertStructureWalls MachinePart baseWall poly mcid
placeMachineWalls :: Material -> [Point2] -> Int -> Int -> World -> World
placeMachineWalls mat poly mcid = insertStructureWalls MachinePart baseWall poly mcid
where
baseWall = defaultMachineWall & wlStructure . wsMachine .~ mcid
& wlMaterial .~ mat
mvLS :: Point3 -> Float -> LightSource -> LightSource
mvLS (V3 x y z) rot ls = ls & lsParam . lsPos .~ V3 x y z + startPos