Work on refactoring positioning relative to creature body

This commit is contained in:
2025-08-27 12:11:01 +01:00
parent 2e6b7a1b41
commit 9d2a2e6730
8 changed files with 168 additions and 148 deletions
+5 -5
View File
@@ -72,7 +72,7 @@ arms :: IM.IntMap Item -> Creature -> Shape
{-# INLINE arms #-}
arms m cr =
(^. _1) $
translateToRightHand m cr aHand
translateToRightHand cr aHand
<> translateToLeftHand m cr aHand
where
aHand = noPic $ translateSHz (-4) . upperPrismPolyHalfST 4 $ polyCirc 3 4
@@ -91,16 +91,16 @@ deadRot cr = overPosSH (Q.rotateToZ d)
scalp :: IM.IntMap Item -> Creature -> Shape
{-# INLINE scalp #-}
scalp m cr = overPosSH (\p -> fst (headPQ m cr `Q.comp` (p,Q.qID))) fhead
scalp m cr = overPosSH (\p -> fst (headPQ cr `Q.comp` (p,Q.qID))) fhead
-- | twists cr = translateSHxy 0 5 . rotateSH (-1) $ translateSHxy (negate 2.5) 0.25 fhead
-- | oneH cr = rotateSH 0.5 $ translateSHxy 2.5 0 fhead
-- | otherwise = translateSHxy 2.5 0 fhead
where
fhead = colorSH (greyN 0.9) . upperPrismPolyHalfST 5 $ polyCirc 3 5
torso :: IM.IntMap Item -> Creature -> Shape
torso :: Creature -> Shape
{-# INLINE torso #-}
torso m cr = overPosSH (\p -> fst (backPQ m cr `Q.comp` (p,Q.qID))) tsh
torso cr = overPosSH (\p -> fst (backPQ cr `Q.comp` (p,Q.qID))) tsh
-- | oneH cr = rotateSH 0.5 tsh
-- | twists cr =
-- translateSHxy 0 3 . rotateSH (-1.3) $ tsh
@@ -126,7 +126,7 @@ baseShoulder = translateSHz (-20) . scaleSH (V3 0.5 1 1) . upperPrismPolyHalfMI
upperBody :: IM.IntMap Item -> Creature -> Shape
{-# INLINE upperBody #-}
upperBody m cr = arms m cr <> shoulderSH (torso m cr)
upperBody m cr = arms m cr <> shoulderSH (torso cr)
shoulderSH :: Shape -> Shape
shoulderSH = translateSHz 20