Simplify creature drawing positioning
This commit is contained in:
@@ -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 #-}
|
||||
|
||||
Reference in New Issue
Block a user