Fix bug in attached item position orienting

This commit is contained in:
2024-10-02 22:57:10 +01:00
parent 6bcd5bc591
commit 49ffbfafc2
8 changed files with 105 additions and 97 deletions
+2 -3
View File
@@ -25,10 +25,9 @@ itemTreeSPic (LDT (itm, _) l r) =
<> foldMap (itemRotTreeSPic itm) (l <> r)
itemRotTreeSPic :: Item -> (ItemLink, LabelDoubleTree ItemLink ComposedItem) -> SPic
itemRotTreeSPic par (il, t) = fromMaybe mempty $ do
(p, q) <- _iatOrient il par (_iatType il) itm
return . translateSP p . overPosSP (Q.rotate q) $ itemTreeSPic t
itemRotTreeSPic par (il, t) = translateSP p . overPosSP (Q.rotate q) $ itemTreeSPic t
where
(p, q) = _iatOrient il par (_iatType il) itm
itm = t ^. ldtValue . _1
itemSPic :: Item -> SPic
+2 -2
View File
@@ -19,8 +19,8 @@ orientByLink itm lt = case (_itType itm,lt) of
(HELD _,WeaponScopeLink) -> (V3 5 0 5, Q.qID)
_ -> (0,Q.qID)
orientAttachment :: Item -> ComposeLinkType -> Item -> Maybe (Point3, Q.Quaternion Float)
orientAttachment par lnk ch = Just $ case (_itType par,lnk,_itType ch) of
orientAttachment :: Item -> ComposeLinkType -> Item -> (Point3, Q.Quaternion Float)
orientAttachment par lnk ch = case (_itType par,lnk,_itType ch) of
-- (HELD BURSTRIFLE,_,HELD TORCH) -> (V3 20 0 0, Q.qID)
-- (HELD LAUNCHER,_,HELD TORCH) -> (V3 0 20 0, Q.qID)
_ -> (t1 + Q.rotate q1 t2, q1 * q2)