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