Improve minigun spinning shape
This commit is contained in:
@@ -365,9 +365,14 @@ volleyGunShape i =
|
||||
|
||||
-- to get this rotating should probably add extra state to the minigun
|
||||
miniGunXPictItem :: Int -> Item -> SPic
|
||||
miniGunXPictItem i it = miniGunXPict i (_wTime (_itParams it) - 10)
|
||||
miniGunXPictItem i it = miniGunXPict i (f $ _wTime (_itParams it))
|
||||
where
|
||||
f x = y * (y + z) / (100 +z)
|
||||
where
|
||||
z = 0
|
||||
y = fromIntegral x
|
||||
|
||||
miniGunXPict :: Int -> Int -> SPic
|
||||
miniGunXPict :: Int -> Float -> SPic
|
||||
miniGunXPict i spin =
|
||||
noPic .
|
||||
colorSH red $ rotateSHx a barrels
|
||||
@@ -375,7 +380,7 @@ miniGunXPict i spin =
|
||||
where
|
||||
aBarrel = translateSH (V3 15 4 2.5) $ xCylinderST 2 25
|
||||
barrels = foldMap (\an -> aBarrel & rotateSHx (2 * pi * fromIntegral an / fromIntegral i)) [1 .. i]
|
||||
a = fromIntegral spin / 100
|
||||
a = 2 * pi * spin / 25
|
||||
|
||||
--x = fromIntegral am / 10
|
||||
-- clip y z = translateSH (V3 0 (-1) z) (rotateSHx (negate $ pi/4)
|
||||
|
||||
+3
-3
@@ -134,12 +134,12 @@ xCylinder :: Size -> Importance -> Float -> Float -> Shape
|
||||
xCylinder size shad d x =
|
||||
translateSHz r . rotateSHq (V3 0 1 0) (pi / 2) . upperCylinder size shad x $
|
||||
[ V2 r r
|
||||
, V2 (-r) (r)
|
||||
, V2 (-r) (-r)
|
||||
, V2 (-r*0.5) (r*0.5)
|
||||
, V2 (-r*0.5) (-r*0.5)
|
||||
, V2 r (- r)
|
||||
]
|
||||
where
|
||||
r = 0.5 * d
|
||||
r = d
|
||||
|
||||
upperBoxMT :: Float -> [Point2] -> Shape
|
||||
upperBoxMT = upperBox Medium Typical
|
||||
|
||||
Reference in New Issue
Block a user