Simplify creature drawing positioning

This commit is contained in:
2025-06-19 12:15:24 +01:00
parent 3f9b76b8d0
commit 5a6144dbbd
3 changed files with 13 additions and 28 deletions
+8 -12
View File
@@ -27,30 +27,26 @@ import ShapePicture
basicCrPict :: Creature -> SPic
basicCrPict cr =
uncurryV translateSPxy (_crPos cr) (rotateSP (_crDir cr) $ drawEquipment cr)
<> noPic (basicCrShape cr)
uncurryV translateSPxy (_crPos cr) . rotateSP (_crDir cr) $ drawEquipment cr
<> noPic ( basicCrShape cr)
crCamouflage :: Creature -> CamouflageStatus
crCamouflage _ = FullyVisible
basicCrShape ::
Creature ->
Shape
basicCrShape :: Creature -> Shape
basicCrShape cr
| crCamouflage cr == Invisible = mempty
| otherwise =
tr . scaleSH (V3 crsize crsize crsize) $
scaleSH (V3 crsize crsize crsize) $
mconcat
[ rotdir . colorSH (_skinHead cskin) . translateSHz 20 $ scalp cr
, rotdir $ colorSH (_skinUpper cskin) $ upperBody cr
, rotmdir $ colorSH (_skinLower cskin) $ feet cr
[ colorSH (_skinHead cskin) . translateSHz 20 $ scalp cr
, colorSH (_skinUpper cskin) $ upperBody cr
, rotmdir $ colorSH (_skinLower cskin) $ feet cr
]
where
cskin = crShape $ _crType cr
crsize = 0.1 * crRad (cr ^. crType)
tr = uncurryV translateSHxy (_crPos cr)
rotdir = rotateSH (_crDir cr)
rotmdir = rotateSH (_crMvDir cr)
rotmdir = rotateSH (_crMvDir cr - _crDir cr)
feet :: Creature -> Shape
{-# INLINE feet #-}