Cleanup
This commit is contained in:
@@ -5,8 +5,6 @@ module Dodge.Item.HeldOffset (
|
||||
twoFlatHRot,
|
||||
heldItemOffset,
|
||||
heldItemRelativeOrient,
|
||||
heldItemOrient2D,
|
||||
heldItemOrient2D',
|
||||
locOrient,
|
||||
handHandleOrient,
|
||||
) where
|
||||
@@ -32,18 +30,7 @@ transToHandle itm = (-.-.- V3 x y 0)
|
||||
where
|
||||
V2 x y = handlePos itm
|
||||
|
||||
heldItemOrient2D :: Item -> Creature -> Point2 -> Float -> (Point2, Float)
|
||||
heldItemOrient2D itm cr p a = (V2 x y, argV . Q.qToV2 $ q)
|
||||
where
|
||||
(V3 x y _, q) = heldItemRelativeOrient itm cr (p `v2z` 0, Q.axisAngle (V3 0 0 1) a)
|
||||
|
||||
heldItemOrient2D' :: OItem -> Creature -> Point2 -> Float -> (Point2, Float)
|
||||
heldItemOrient2D' (itm, _, (p1, q1)) cr p a = (V2 x y, argV . Q.qToV2 $ q)
|
||||
where
|
||||
(V3 x y _, q) = heldItemRelativeOrient itm cr (p1 + Q.rotate q1 (p `v2z` 0), q1 * Q.axisAngle (V3 0 0 1) a)
|
||||
|
||||
heldItemRelativeOrient ::
|
||||
Item -> Creature -> (Point3, Q.Quaternion Float) -> (Point3, Q.Quaternion Float)
|
||||
heldItemRelativeOrient :: Item -> Creature -> Point3Q -> Point3Q
|
||||
heldItemRelativeOrient itm cr (p, q)
|
||||
| Aiming{} <- _posture (_crStance cr) =
|
||||
(p + aimingWeaponZeroPos cr itm `v2z` shoulderHeight, Q.qID * q)
|
||||
@@ -70,7 +57,9 @@ heldItemRelativeOrient itm cr (p, q)
|
||||
sLen = _strideLength $ _crStance cr
|
||||
|
||||
handleOrient :: LocationLDT ItemLink CItem -> Point3Q
|
||||
handleOrient _ = (V3 (-3) 0 0, Q.qID)
|
||||
handleOrient loc = case loc ^. locLDT . ldtValue . _1 . itType of
|
||||
HELD FLAMETHROWER -> (V3 (-1) 0 0, Q.qID)
|
||||
_ -> (V3 (-3) 0 0, Q.qID)
|
||||
|
||||
-- note this is relative to the creature
|
||||
handOrient :: Creature -> AimStance -> Point3Q
|
||||
@@ -93,8 +82,10 @@ handOrient cr = case cr ^. crStance . posture of
|
||||
sLen = _strideLength $ _crStance cr
|
||||
|
||||
locOrient :: LocationLDT ItemLink OItem -> Creature -> Point3Q
|
||||
locOrient loc cr = handHandleOrient (fmap (\(x,y,_) -> (x,y)) loc) cr `Q.comp`
|
||||
(loc ^. locLDT . ldtValue . _3)
|
||||
locOrient loc cr =
|
||||
handHandleOrient (fmap (\(x, y, _) -> (x, y)) loc) cr
|
||||
`Q.comp` (loc ^. locLDT . ldtValue . _3)
|
||||
|
||||
-- heldItemRelativeOrient
|
||||
-- (locToTop loc ^. locLDT . ldtValue . _1)
|
||||
-- cr
|
||||
|
||||
Reference in New Issue
Block a user