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)
|
||||
|
||||
Reference in New Issue
Block a user