Implement randomised markings on sensors
This commit is contained in:
@@ -1,14 +1,23 @@
|
||||
module Dodge.Placement.Instance.Tank where
|
||||
module Dodge.Placement.Instance.Tank
|
||||
( tankSquareDec
|
||||
, roundTank
|
||||
, roundTankCross
|
||||
) where
|
||||
import Dodge.Data
|
||||
--import Dodge.Placement.PlaceSpot
|
||||
import Dodge.LevelGen.Data
|
||||
import Dodge.Room.Foreground
|
||||
import Dodge.Default.Wall
|
||||
--import Dodge.Placement.TopDecoration
|
||||
import Geometry
|
||||
import Shape
|
||||
import Color
|
||||
--import Quaternion
|
||||
|
||||
tankSquareDec :: (Float -> Float -> Float -> Color -> Color -> Shape)
|
||||
-> Color -> Color -> Placement
|
||||
tankSquareDec dec = tankShape (square 20) (dec 20 20 31)
|
||||
|
||||
tankShape :: [Point2] -> (Color -> Color -> Shape) -> Color -> Color -> Placement
|
||||
tankShape baseshape facade col col' = ps0jPushPS
|
||||
(PutShape $ colorSH col (upperPrismPoly 31 baseshape) <> facade col col')
|
||||
@@ -25,58 +34,3 @@ roundTankCross :: Color -> Color -> Placement
|
||||
roundTankCross = tankShape (polyCirc 4 20)
|
||||
$ \_ c -> colorSH c $ thinHighBar 31 (V2 20 0) (V2 (-20) 0)
|
||||
<> thinHighBar 31 (V2 0 20) (V2 0 (-20))
|
||||
|
||||
tankRectCross :: Float -> Float -> Color -> Color -> Placement
|
||||
tankRectCross = tankRectDecorate $ \ w h _ c -> colorSH c $
|
||||
thinHighBar 31 (V2 w 0) (V2 (-w) 0)
|
||||
<> thinHighBar 31 (V2 0 h) (V2 0 (-h))
|
||||
|
||||
tankSquareCross :: Color -> Color -> Placement
|
||||
tankSquareCross = tankRectCross 20 20
|
||||
|
||||
tankRectDecorate :: (Float -> Float -> Color -> Color -> Shape)
|
||||
-> Float -> Float -> Color -> Color -> Placement
|
||||
tankRectDecorate f w h = tankShape (rectWH w h) (f w h)
|
||||
|
||||
tankRect :: Float -> Float -> Color -> Color -> Placement
|
||||
tankRect = tankRectDecorate g
|
||||
where
|
||||
g w h _ col = colorSH col $ foldMap f
|
||||
[(w',-w',h',h')
|
||||
,(w',-w',-h',-h')
|
||||
,(w',w',h',-h')
|
||||
,(-w',-w',h',-h')
|
||||
]
|
||||
where
|
||||
w' = w - 1.5
|
||||
h' = h - 1.5
|
||||
f (a,c,b,d) = thinHighBar 31 (V2 a b) (V2 c d)
|
||||
|
||||
tankSquare :: Color -> Color -> Placement
|
||||
tankSquare = tankRect 20 20
|
||||
|
||||
tankRectEmboss :: Float -> Float -> Color -> Color -> Placement
|
||||
tankRectEmboss = tankRectDecorate f
|
||||
where
|
||||
f w h _ c = embossingR
|
||||
<> rotateSH pi embossingR
|
||||
<> colorSH c (thinHighBar 38 (V2 (-0.3*w) 0) (V2 (0.3*w) 0))
|
||||
where
|
||||
w' = 0.3 * w
|
||||
embossingR = colorSH c $ prismPoly
|
||||
[V3 w h 31,V3 w (0.3*h) 41,V3 w (-0.3*h) 41,V3 w (-h) 31]
|
||||
[V3 w' h 31,V3 w' (0.3*h) 41,V3 w' (-0.3*h) 41,V3 w' (-h) 31]
|
||||
|
||||
tankSquareEmboss :: Color -> Color -> Placement
|
||||
tankSquareEmboss = tankRectEmboss 20 20
|
||||
|
||||
tankRectEmboss4 :: Float -> Float -> Color -> Color -> Placement
|
||||
tankRectEmboss4 = tankRectDecorate g
|
||||
where
|
||||
g w h _ c = colorSH c $ foldMap f [(w,h),(-w,h),(w,-h),(-w,-h)]
|
||||
where
|
||||
f (a,b) = translateSH (V3 (a/2) (b/2) 31) embossing
|
||||
embossing = upperPrismPolyHalf 10 $ rectNSEW (h/2) (-h/2) (w/2) (-w/2)
|
||||
|
||||
tankSquareEmboss4 :: Color -> Color -> Placement
|
||||
tankSquareEmboss4 = tankRectEmboss4 20 20
|
||||
|
||||
Reference in New Issue
Block a user