Partial implementation of more sensible muzzle position determination
This commit is contained in:
@@ -3,6 +3,7 @@ module Dodge.Item.HeldOffset (
|
||||
twoFlatHRot,
|
||||
heldItemOffset,
|
||||
heldItemRelativeOrient,
|
||||
heldItemOrient2D,
|
||||
) where
|
||||
|
||||
import qualified Quaternion as Q
|
||||
@@ -23,6 +24,11 @@ transToHandle itm = fromMaybe id $ do
|
||||
V2 x y <- itm ^? itUse . heldAim . aimHandlePos
|
||||
return (-.-.- V3 x y 0)
|
||||
|
||||
heldItemOrient2D :: Item -> Creature -> Point2 -> Float -> (Point2, Float)
|
||||
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 itm cr (p,q)
|
||||
| _posture (_crStance cr) == Aiming =
|
||||
|
||||
Reference in New Issue
Block a user