Tweak weapon pictures

This commit is contained in:
2021-10-03 13:19:53 +01:00
parent 8c1496e140
commit 0c6fa80ce0
18 changed files with 358 additions and 287 deletions
+6
View File
@@ -11,6 +11,7 @@ module Shape
, translateSHf
, rotateSH
, rotateSHx
, polyCircx
, scaleSH
, colorSH
)
@@ -24,10 +25,15 @@ emptySH :: Shape
{-# INLINE emptySH #-}
emptySH = mempty
-- - approximate a circle by a polygon with n*2 points of radius x
polyCirc :: Int -> Float -> [Point2]
{-# INLINE polyCirc #-}
polyCirc n x = map (\a -> rotateV a (V2 x 0)) $ take (n*2) [0,pi/fromIntegral n..]
-- - approximate a circle around the x axis by a polygon with n*2 points of radius r
polyCircx :: Int -> Float -> [Point3]
polyCircx n = map (vNormaly . addZ 0) . polyCirc n
-- very "unsafe": be careful with the inputs
-- length of polys must be the same
-- points should be correctly ordered so that