module Dodge.Item.Weapon.BulletGun.Clip where
import Dodge.Data
import Shape
import Geometry
import Data.Maybe
import Control.Lens

makeSingleClipAt :: Point3 -> Item -> Shape
makeSingleClipAt p it = case it ^? itConsumption . laLoaded of
    Just 0 -> mempty
    _ -> translateSH p $ upperPrismPoly 1 $ square 1.5

makeTinClipAt :: Float -> Point3 -> Item -> Shape
makeTinClipAt r p it = translateSH p . overPosSH (rotate3z r) $ upperPrismPoly 1 $ reverse 
    $ rectNSWE 0 (-y) (-2) 2
  where
    y = fromIntegral y' * 0.3
    y' = fromMaybe 0 $ it ^? itConsumption . laLoaded
