Add battery shape/picture

This commit is contained in:
2024-10-04 00:25:44 +01:00
parent 127d85e7ce
commit ac550bc6a4
14 changed files with 241 additions and 271 deletions
+9 -17
View File
@@ -23,38 +23,30 @@ transToHandle itm = fromMaybe id $ do
V2 x y <- itm ^? itUse . heldAim . aimHandlePos
return (-.-.- V3 x y 0)
-- there is a lot of duplication going on here, and also need to check
-- rotations
heldItemRelativeOrient :: Item -> Creature -> (Point3, Q.Quaternion Float) -> (Point3, Q.Quaternion Float)
heldItemRelativeOrient itm cr (p,q)
| _posture (_crStance cr) == Aiming =
(p +.+.+ aimingWeaponZeroPos cr itm `v2z` shoulderHeight, Q.qID * q)
(p + aimingWeaponZeroPos cr itm `v2z` shoulderHeight, Q.qID * q)
| isTwoHandFlat =
( (+.+.+ V3 (_crRad cr) 0 handD)
. rotate3 (twoFlatHRot cr)
$ transToHandle itm p
( V3 (_crRad cr) 0 handD
+ rotate3 (twoFlatHRot cr) (transToHandle itm p)
, (Q.axisAngle (V3 0 0 1) (twoFlatHRot cr)) * q
)
| isOneHand =
( (+.+.+ V3 0 0 handD)
. (+.+.+ V3 (_crRad cr * 0.7 + handPos) (_crRad cr * negate 0.7) 0)
. (+.+.+ V3 (-2) 0 0)
$ transToHandle itm p
( V3 (_crRad cr * 0.7 + handPos) (_crRad cr * negate 0.7) handD
+ transToHandle itm p
, Q.qID * q
)
| otherwise =
( (+.+.+ V3 0 0 handD)
. (+.+.+ V3 (_crRad cr) 0 0)
. rotate3 (strideRot cr + 1.2)
. (+.+.+ V3 (-8) 0 0)
$ transToHandle itm p
( V3 (_crRad cr) 0 handD
+ rotate3 (strideRot cr + 1.2) (V3 (-8) 0 0 + transToHandle itm p)
, (Q.axisAngle (V3 0 0 1) (strideRot cr + 1.2)) * q
)
where
handD = 15
handPos = case cr ^? crStance . carriage of
Just (Walking x LeftForward) -> f x * 50
_ -> 0
Just (Walking x LeftForward) -> f x * 50 -2
_ -> 0 - 2
isOneHand =
itm ^? itUseAimStance == Just OneHand
|| isNothing (itm ^? itUseAimStance)