Cleanup creature shape

This commit is contained in:
2026-03-29 11:20:57 +01:00
parent a791c44854
commit 38e2bd222e
+7 -12
View File
@@ -51,14 +51,11 @@ basicCrShape cr
feet :: Creature -> Shape
{-# INLINE feet #-}
feet cr = case cr ^? crStance . carriage of
Just (Walking sa LeftForward) ->
translateSHxy (f sa) off aFoot
<> translateSHxy (- f sa) (- off) aFoot
Just (Walking sa RightForward) ->
translateSHxy (- f sa) off aFoot
<> translateSHxy (f sa) (- off) aFoot
_ -> translateSHxy 0 off aFoot <> translateSHxy 0 (- off) aFoot
Just (Walking sa LeftForward) -> sh (f sa)
Just (Walking sa RightForward) -> sh (-f sa)
_ -> sh 0
where
sh x = translateSHxy x off aFoot <> translateSHxy (- x) (- off) aFoot
aFoot = upperPrismPolyST 10 $ polyCirc 3 4
off = 5
sLen = _strideLength $ _crStance cr
@@ -113,14 +110,12 @@ deadUpperBody cr = deadRot cr . translateSHz (negate 10) . upperBody $ cr
baseShoulder :: Shape
{-# INLINE baseShoulder #-}
baseShoulder = translateSHz (-20) . scaleSH (V3 0.5 1 1) . upperPrismPolyHalfMI 10 $ polyCirc 3 1
--baseShoulder = translateSHz (-20) . scaleSH (V3 0.5 1 1) . upperPrismPolyHalfMI 10 $ polyCirc 3 1
baseShoulder = scaleSH (V3 0.5 1 1) . upperPrismPolyHalfMI 10 $ polyCirc 3 1
upperBody :: Creature -> Shape
{-# INLINE upperBody #-}
upperBody cr = arms cr <> shoulderSH (torso cr)
shoulderSH :: Shape -> Shape
shoulderSH = translateSHz 20
upperBody cr = arms cr <> torso cr
drawEquipment :: IM.IntMap Item -> Creature -> SPic
{-# INLINE drawEquipment #-}