Work on orienting positions for attachment items
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
module Dodge.Item.Grammar (
|
||||
invLDT,
|
||||
invTrees',
|
||||
invTrees,
|
||||
invIndentIM,
|
||||
invAdj,
|
||||
@@ -168,3 +169,12 @@ invTrees = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . map (bimap _iatTy
|
||||
getindex i =
|
||||
fromMaybe (error "in invTrees try to get non-inventory item tree") $
|
||||
i ^? itLocation . ilInvID
|
||||
|
||||
-- returns an intmap with trees for all root items
|
||||
invTrees' :: IM.IntMap Item -> IM.IntMap (LabelDoubleTree ItemLink Item)
|
||||
invTrees' = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . map (bimap id (\(x, y, _) -> (x, y))) . invLDT
|
||||
where
|
||||
getindex :: Item -> Int
|
||||
getindex i =
|
||||
fromMaybe (error "in invTrees try to get non-inventory item tree") $
|
||||
i ^? itLocation . ilInvID
|
||||
|
||||
@@ -9,7 +9,7 @@ import qualified Linear.Quaternion as Q
|
||||
|
||||
orientChild :: Item -> (Point3, Q.Quaternion Float)
|
||||
orientChild itm = case _itType itm of
|
||||
HELD {} -> (0,Q.axisAngle (V3 1 0 0) 0)
|
||||
HELD TORCH -> (V3 5 0 0,Q.axisAngle (V3 1 0 0) 0)
|
||||
_ -> (0,Q.axisAngle (V3 1 0 0) 0)
|
||||
|
||||
orientByLink :: Item -> ComposeLinkType -> (Point3, Q.Quaternion Float)
|
||||
|
||||
Reference in New Issue
Block a user