Improve weapon handle offsets

This commit is contained in:
2023-05-28 13:59:58 +01:00
parent 4b35a683af
commit 7fc36ab028
8 changed files with 23 additions and 22 deletions
+3 -3
View File
@@ -14,13 +14,13 @@ turretItemOffset it tu mc =
transToHandle :: Item -> Point3 -> Point3
transToHandle itm = fromMaybe id $ do
x <- itm ^? itUse . heldAim . aimHandlePos
return (-.-.- V3 x 0 0)
V2 x y <- itm ^? itUse . heldAim . aimHandlePos
return (-.-.- V3 x y 0)
heldItemOffset :: Item -> Creature -> Point3 -> Point3
heldItemOffset itm cr
| isSelected && _posture (_crStance cr) == Aiming =
(+.+.+ V3 (aimingWeaponZeroPos cr itm) 0 shoulderHeight)
(+.+.+ aimingWeaponZeroPos cr itm `v2z` shoulderHeight)
| isSelected && isTwoHandFlat =
(+.+.+ V3 (_crRad cr) 0 handD)
. rotate3 (twoFlatHRot cr)