Make weapon position relative to hand positions, wonky for now
This commit is contained in:
@@ -12,6 +12,7 @@ module Dodge.Creature.HandPos (
|
|||||||
headPQ,
|
headPQ,
|
||||||
translateToES,
|
translateToES,
|
||||||
rightHandPQ,
|
rightHandPQ,
|
||||||
|
leftHandPQ,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
@@ -62,7 +63,7 @@ handWalkingPos b off cr = case cr ^. crStance . carriage of
|
|||||||
rightHandPQ :: Creature -> Point3Q
|
rightHandPQ :: Creature -> Point3Q
|
||||||
rightHandPQ cr
|
rightHandPQ cr
|
||||||
| oneH cr = (V3 11 (-3) 20, Q.qID)
|
| oneH cr = (V3 11 (-3) 20, Q.qID)
|
||||||
| twists cr = (V3 0 5 20, Q.qz (-1)) `Q.comp` (V3 4 (-10) 0, Q.qID)
|
| twists cr = (V3 0 5 20, Q.qz (-1)) `Q.comp` (V3 4 (-10) 0, Q.qz 1)
|
||||||
| twoFlat cr = (V3 4 (-8) 12, Q.qID)
|
| twoFlat cr = (V3 4 (-8) 12, Q.qID)
|
||||||
| Just p <- crRightHandWall cr = (20 & _xy .~ p, Q.qID)
|
| Just p <- crRightHandWall cr = (20 & _xy .~ p, Q.qID)
|
||||||
| otherwise = (handWalkingPos LeftForward (-8) cr, Q.qID)
|
| otherwise = (handWalkingPos LeftForward (-8) cr, Q.qID)
|
||||||
|
|||||||
@@ -34,20 +34,37 @@ handleOrient loc = case loc ^. locDT . dtValue . _1 . itType of
|
|||||||
HELD FLAMETHROWER -> (V3 (-1) 0 0, Q.qID)
|
HELD FLAMETHROWER -> (V3 (-1) 0 0, Q.qID)
|
||||||
_ -> (V3 (-3) 0 0, Q.qID)
|
_ -> (V3 (-3) 0 0, Q.qID)
|
||||||
|
|
||||||
-- note this is relative to the creature
|
---- note this is relative to the creature
|
||||||
-- the aimstance here should match any aimstance in Aiming
|
---- the aimstance here should match any aimstance in Aiming
|
||||||
|
--handOrient :: Creature -> AimStance -> Point3Q
|
||||||
|
--handOrient cr = case cr ^. crStance . posture of
|
||||||
|
-- Aiming {} -> \case
|
||||||
|
-- TwoHandUnder -> (V3 (-3) 0 shoulderHeight, Q.qID)
|
||||||
|
-- TwoHandOver -> (V3 0 0 shoulderHeight, Q.qID)
|
||||||
|
-- OneHand -> (V3 13 (-2) shoulderHeight, Q.qID)
|
||||||
|
-- TwoHandFlat -> (V3 13 0 shoulderHeight, Q.qID)
|
||||||
|
-- AtEase -> \case
|
||||||
|
-- OneHand -> rightHandPQ cr
|
||||||
|
-- TwoHandFlat -> (V3 10 0 15, Q.axisAngle (V3 0 0 1) $ twoFlatHRot cr)
|
||||||
|
-- TwoHandUnder -> (V3 7 (-8) 15, Q.axisAngle (V3 0 0 1) (strideRot cr + 1.2))
|
||||||
|
-- TwoHandOver -> (V3 10 0 15, Q.axisAngle (V3 0 0 1) (strideRot cr + 1.2))
|
||||||
|
|
||||||
handOrient :: Creature -> AimStance -> Point3Q
|
handOrient :: Creature -> AimStance -> Point3Q
|
||||||
handOrient cr = case cr ^. crStance . posture of
|
handOrient cr = \case
|
||||||
Aiming {} -> \case
|
TwoHandUnder ->
|
||||||
TwoHandUnder -> (V3 (-3) 0 shoulderHeight, Q.qID)
|
let (rp,_) = rightHandPQ cr
|
||||||
TwoHandOver -> (V3 0 0 shoulderHeight, Q.qID)
|
(lp,_) = leftHandPQ cr
|
||||||
OneHand -> (V3 13 (-2) shoulderHeight, Q.qID)
|
in (rp,Q.qz (argV $ (lp - rp) ^. _xy))
|
||||||
TwoHandFlat -> (V3 13 0 shoulderHeight, Q.qID)
|
TwoHandOver ->
|
||||||
AtEase -> \case
|
let (rp,_) = rightHandPQ cr
|
||||||
|
(lp,_) = leftHandPQ cr
|
||||||
|
in (rp,Q.qz (argV $ (lp - rp) ^. _xy))
|
||||||
OneHand -> rightHandPQ cr
|
OneHand -> rightHandPQ cr
|
||||||
TwoHandFlat -> (V3 10 0 15, Q.axisAngle (V3 0 0 1) $ twoFlatHRot cr)
|
TwoHandFlat ->
|
||||||
TwoHandUnder -> (V3 7 (-8) 15, Q.axisAngle (V3 0 0 1) (strideRot cr + 1.2))
|
let (rp,_) = rightHandPQ cr
|
||||||
TwoHandOver -> (V3 10 0 15, Q.axisAngle (V3 0 0 1) (strideRot cr + 1.2))
|
(lp,_) = leftHandPQ cr
|
||||||
|
in (0.5 *^ (rp + lp),Q.qz (argV (vNormal ((lp - rp) ^. _xy))))
|
||||||
|
|
||||||
|
|
||||||
locOrient :: LocationDT OItem -> Creature -> Point3Q
|
locOrient :: LocationDT OItem -> Creature -> Point3Q
|
||||||
locOrient loc cr =
|
locOrient loc cr =
|
||||||
|
|||||||
@@ -351,7 +351,6 @@ muzzleWallCheck w cr = fromMaybe cr $ do
|
|||||||
^? ix invid . _2
|
^? ix invid . _2
|
||||||
let ps = reduceLocDT f loc ^.. each . _1 . _xy
|
let ps = reduceLocDT f loc ^.. each . _1 . _xy
|
||||||
cp = cr ^. crPos . _xy
|
cp = cr ^. crPos . _xy
|
||||||
-- cop = cr ^. crOldPos . _xy
|
|
||||||
r <- boundPointsRect (cp : ps)
|
r <- boundPointsRect (cp : ps)
|
||||||
let wls = uncurry wlsNearRect r w & IM.elems & filter (not . _wlTouchThrough)
|
let wls = uncurry wlsNearRect r w & IM.elems & filter (not . _wlTouchThrough)
|
||||||
vs = mapMaybe (g cp wls) ps
|
vs = mapMaybe (g cp wls) ps
|
||||||
|
|||||||
Reference in New Issue
Block a user