Prop reification/splitting

This commit is contained in:
2022-07-24 13:45:05 +01:00
parent 5a2f529182
commit ac069d08f6
31 changed files with 585 additions and 458 deletions
+24
View File
@@ -0,0 +1,24 @@
module Dodge.TractorBeam.Draw
where
import Dodge.Data.TractorBeam
import Geometry
import Picture
drawTractorBeam :: TractorBeam -> Picture
drawTractorBeam = tractorSPic
tractorSPic :: TractorBeam -> Picture
tractorSPic pj = setLayer BloomNoZWrite $ setDepth 20 $ color (withAlpha 0.5 col) $ polygon
[ spos -- not sure if this is anticlockwise...
, spos +.+ size *.* (d +.+ n)
, xpos +.+ size *.* n
, xpos -.- size *.* n
, spos +.+ size *.* (d -.- n)
]
where
size = fromIntegral (_tbTime pj)
spos = _tbPos pj
xpos = _tbStartPos pj
d = squashNormalizeV $ spos -.- xpos
n = vNormal d
col = mixColors 0.5 0.5 white blue