Tweak muzzle push out
This commit is contained in:
+4
-2
@@ -358,8 +358,10 @@ muzzleWallCheck w cr = fromMaybe cr $ do
|
|||||||
if null vs
|
if null vs
|
||||||
then cr
|
then cr
|
||||||
else
|
else
|
||||||
let (_,wl) = minimumBy (compare `on` norm . fst) vs
|
let (v,wl) = minimumBy (compare `on` norm . fst) vs
|
||||||
in cr & crPos . _xy +~ signorm (vNormal (uncurry (-) (wl ^. wlLine)))
|
v' = signorm (vNormal (uncurry (-) (wl ^. wlLine)))
|
||||||
|
x = dotV v' v
|
||||||
|
in cr & crPos . _xy +~ min 1 x *^ v'
|
||||||
where
|
where
|
||||||
f loc = map (muzzlePos loc cr) (itemMuzzles loc)
|
f loc = map (muzzlePos loc cr) (itemMuzzles loc)
|
||||||
g cp wls p = case collidePoint cp p wls of
|
g cp wls p = case collidePoint cp p wls of
|
||||||
|
|||||||
Reference in New Issue
Block a user