Remove LDTs from orientations + item shapes
This commit is contained in:
@@ -135,4 +135,4 @@ shoulderSH = translateSHz 20
|
||||
|
||||
drawEquipment :: Creature -> SPic
|
||||
{-# INLINE drawEquipment #-}
|
||||
drawEquipment cr = foldMap (itemEquipPict cr) (invLDT $ _crInv cr)
|
||||
drawEquipment cr = foldMap (itemEquipPict cr) (invDT $ _crInv cr)
|
||||
|
||||
@@ -4,7 +4,7 @@ module Dodge.Item.Draw (
|
||||
itemEquipPict,
|
||||
) where
|
||||
|
||||
import Dodge.DoubleTree
|
||||
import qualified Quaternion as Q
|
||||
import Dodge.Data.Equipment.Misc
|
||||
import Dodge.Data.ComposedItem
|
||||
import Dodge.Data.DoubleTree
|
||||
@@ -16,18 +16,18 @@ import Dodge.Item.Draw.SPic
|
||||
import Dodge.Item.HeldOffset
|
||||
import ShapePicture
|
||||
|
||||
itemEquipPict :: Creature -> LDTree ItemLink CItem -> SPic
|
||||
itemEquipPict :: Creature -> DTree CItem -> SPic
|
||||
itemEquipPict cr itmtree
|
||||
| Just i <- itm ^? itLocation . ilInvID
|
||||
, Just esite <- cr ^? crInv . ix i . itLocation . ilEquipSite . _Just
|
||||
, Just attachpos <- equipAttachPos <$> itm ^? itType . ibtEquip
|
||||
= equipPosition esite cr attachpos (itemSPic itm)
|
||||
| itm ^? itLocation . ilInvID == cr ^? crManipulation . manObject . imRootSelectedItem
|
||||
= overPosSP (heldItemOffset loc cr) (itemTreeSPic $ ldtToDT itmtree)
|
||||
= overPosSP (Q.prePos $ handHandleOrient (loc) cr) (itemTreeSPic $ itmtree)
|
||||
| otherwise = mempty
|
||||
where
|
||||
itm = itmtree ^. ldtValue . _1
|
||||
loc = LocLDT TopLDT itmtree
|
||||
itm = itmtree ^. dtValue . _1
|
||||
loc = LocDT TopDT itmtree
|
||||
|
||||
equipAttachPos :: EquipItemType -> Point3
|
||||
equipAttachPos = \case
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
module Dodge.Item.HeldOffset (
|
||||
turretItemOffset,
|
||||
twoFlatHRot,
|
||||
heldItemOffset,
|
||||
-- heldItemOffset,
|
||||
locOrient,
|
||||
handHandleOrient,
|
||||
) where
|
||||
@@ -59,11 +59,6 @@ locOrient loc cr =
|
||||
handHandleOrient (fmap (\(x, y, _) -> (x, y)) $ locToTop' loc) cr
|
||||
`Q.comp` (loc ^. locDT . dtValue . _3)
|
||||
|
||||
heldItemOffset :: LocationLDT ItemLink CItem -> Creature -> Point3 -> Point3
|
||||
heldItemOffset loc cr p = x + Q.rotate q p
|
||||
where
|
||||
(x, q) = handHandleOrient (locLDTToLocDT loc) cr
|
||||
|
||||
handHandleOrient :: LocationDT CItem -> Creature -> Point3Q
|
||||
handHandleOrient loc cr =
|
||||
handOrient cr (aimStance (loc' ^. locDT))
|
||||
|
||||
Reference in New Issue
Block a user