Cleanup, move bullet spawn random offset to muzzle

This commit is contained in:
2025-07-05 20:55:24 +01:00
parent 164499fe4e
commit 7b9c1678f1
5 changed files with 34 additions and 83 deletions
+3 -15
View File
@@ -7,8 +7,7 @@ module Dodge.Item.HeldOffset (
heldItemRelativeOrient,
heldItemOrient2D,
heldItemOrient2D',
-- itemRelativeOrient,
locOrientation,
locOrient,
handHandleOrient,
) where
@@ -18,9 +17,7 @@ import Dodge.Data.ComposedItem
import Dodge.Data.Creature
import Dodge.Data.DoubleTree
import Dodge.Data.Machine
import Dodge.DoubleTree
import Dodge.Item.AimStance
import Dodge.Item.Orientation
import Geometry
import LensHelp
import qualified Quaternion as Q
@@ -95,8 +92,8 @@ handOrient cr = case cr ^. crStance . posture of
f i = 0.1 * fromIntegral (sLen - i) / fromIntegral sLen
sLen = _strideLength $ _crStance cr
locOrientation :: LocationLDT ItemLink OItem -> Creature -> Point3Q
locOrientation loc cr = handHandleOrient (fmap (\(x,y,_) -> (x,y)) loc) cr `Q.comp`
locOrient :: LocationLDT ItemLink OItem -> Creature -> Point3Q
locOrient loc cr = handHandleOrient (fmap (\(x,y,_) -> (x,y)) loc) cr `Q.comp`
(loc ^. locLDT . ldtValue . _3)
-- heldItemRelativeOrient
-- (locToTop loc ^. locLDT . ldtValue . _1)
@@ -187,12 +184,3 @@ heldHandlePos = \case
KEYCARD{} -> V2 3 0
BLINKER -> V2 3 0
BLINKERUNSAFE -> V2 3 0
itemRelativeOrient ::
LocationLDT ItemLink Item ->
Creature ->
(Point3, Q.Quaternion Float) ->
(Point3, Q.Quaternion Float)
itemRelativeOrient loc cr =
heldItemRelativeOrient (locToTop loc ^. locLDT . ldtValue) cr
. orientLocation (V3 0 0 0, Q.qID) loc