Hack together correct positioning of grenades from attached items
This commit is contained in:
@@ -5,6 +5,7 @@ module Dodge.Item.HeldOffset (
|
||||
heldItemOffset,
|
||||
heldItemRelativeOrient,
|
||||
heldItemOrient2D,
|
||||
heldItemOrient2D',
|
||||
itemRelativeOrient,
|
||||
) where
|
||||
|
||||
@@ -36,6 +37,11 @@ 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)
|
||||
|
||||
heldItemOrient2D' :: OItem -> Creature -> Point2 -> Float -> (Point2, Float)
|
||||
heldItemOrient2D' (itm,_,(p1,q1)) cr p a = (V2 x y, argV . Q.qToV2 $ q )
|
||||
where
|
||||
(V3 x y _,q) = heldItemRelativeOrient itm cr (p1 + Q.rotate q1 (p `v2z` 0), q1 * Q.axisAngle (V3 0 0 1) a)
|
||||
|
||||
heldItemRelativeOrient
|
||||
:: Item -> Creature -> (Point3, Q.Quaternion Float) -> (Point3, Q.Quaternion Float)
|
||||
heldItemRelativeOrient itm cr (p,q)
|
||||
|
||||
Reference in New Issue
Block a user