Cleanup
This commit is contained in:
@@ -28,23 +28,23 @@ 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)
|
||||
|
||||
heldItemRelativeOrient :: Item -> Creature -> (Point3, Q.Quaternion Float) -> (Point3, Q.Quaternion Float)
|
||||
heldItemRelativeOrient
|
||||
:: Item -> Creature -> (Point3, Q.Quaternion Float) -> (Point3, Q.Quaternion Float)
|
||||
heldItemRelativeOrient itm cr (p,q)
|
||||
| Aiming {} <- _posture (_crStance cr) =
|
||||
(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 (_crRad cr * 0.7 + handPos) (_crRad cr * negate 0.7) handD
|
||||
+ transToHandle itm p
|
||||
+ transToHandle itm p
|
||||
, Q.qID * q
|
||||
)
|
||||
| otherwise =
|
||||
( V3 (_crRad cr) 0 handD
|
||||
+ 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
|
||||
@@ -74,7 +74,6 @@ aimingWeaponHandlePos _ it = case it ^? itUse . heldAim . aimStance of
|
||||
Just TwoHandFlat -> V2 10 0
|
||||
Nothing -> 0
|
||||
|
||||
|
||||
heldItemOffset :: Item -> Creature -> Point3 -> Point3
|
||||
heldItemOffset itm cr p = fst (heldItemRelativeOrient itm cr (p,Q.qID))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user