Distinguish between selected item and root-selected item

This commit is contained in:
2024-09-21 21:59:53 +01:00
parent 2154abfb1d
commit 31b5db6e9e
33 changed files with 313 additions and 281 deletions
+5 -5
View File
@@ -23,18 +23,18 @@ transToHandle itm = fromMaybe id $ do
heldItemOffset :: Item -> Creature -> Point3 -> Point3
heldItemOffset itm cr
| isSelected && _posture (_crStance cr) == Aiming =
| isroot && _posture (_crStance cr) == Aiming =
(+.+.+ aimingWeaponZeroPos cr itm `v2z` shoulderHeight)
| isSelected && isTwoHandFlat =
| isroot && isTwoHandFlat =
(+.+.+ V3 (_crRad cr) 0 handD)
. rotate3 (twoFlatHRot cr)
. transToHandle itm
| isSelected && isOneHand =
| isroot && isOneHand =
(+.+.+ V3 0 0 handD)
. (+.+.+ V3 (_crRad cr * 0.7 + handPos) (_crRad cr * negate 0.7) 0)
. (+.+.+ V3 (-2) 0 0)
. transToHandle itm
| isSelected =
| isroot =
(+.+.+ V3 0 0 handD)
. (+.+.+ V3 (_crRad cr) 0 0)
. rotate3 (strideRot cr + 1.2)
@@ -44,7 +44,7 @@ heldItemOffset itm cr
| otherwise = id
where
handD = 15
isSelected = _itIsHeld itm
isroot = _itIsRoot itm
handPos = case cr ^? crStance . carriage of
Just (Walking x LeftForward) -> f x * 50
_ -> 0