Make zoning more universal

This commit is contained in:
2022-06-28 19:04:31 +01:00
parent 4965934502
commit b1a7e1bf35
16 changed files with 152 additions and 97 deletions
+16
View File
@@ -0,0 +1,16 @@
module Dodge.Zone.Object where
import Dodge.Data
import Geometry.Zone
import Geometry.Data
import Geometry.Vector3D
import StreamingHelp
import qualified Streaming.Prelude as S
zoneOfCreature :: Float -> Creature -> StreamOf Int2
zoneOfCreature x cr = zoneInsideCirc x (_crPos cr) (_crRad cr)
zoneOfWall :: Float -> Wall -> StreamOf Int2
zoneOfWall x = uncurry (zoneOfSeg x) . _wlLine
zonePos :: (a -> Point2) -> Float -> a -> StreamOf Int2
zonePos f x = S.yield . zoneOfPoint x . f