Improve possible manipulation of equipment

This commit is contained in:
2022-05-23 10:18:36 +01:00
parent 295c50f0d9
commit 46123de69c
9 changed files with 88 additions and 40 deletions
+15 -4
View File
@@ -1,9 +1,9 @@
module Dodge.Creature.HandPos where
import Dodge.Data
import Dodge.Creature.Test
import Shape
--import Shape
import ShapePicture
import Geometry
--import Geometry
import Control.Lens
import Data.Maybe
@@ -65,12 +65,23 @@ translateToRightLeg cr = rotateSP (_crMvDir cr - _crDir cr) . case cr ^? crStanc
Just (Walking sa RightForward) -> translateSPf ( f sa) (-off)
_ -> translateSPf 0 (-off)
where
aFoot :: Shape
aFoot = upperPrismPoly 10 $ polyCirc 3 4
off = 5
sLen = _strideLength $ _crStance cr
f i = 6 * fromIntegral (sLen - i) / fromIntegral sLen
translateToHead :: Creature -> SPic -> SPic
translateToHead cr
| twists cr = translateSPz 20 . translateSPf 0 5 . rotateSP (-1) . translateSPf (negate 2.5) 0.25
| oneH cr = translateSPz 20 . rotateSP 0.5 . translateSPf 2.5 0
| otherwise = translateSPz 20 . translateSPf 2.5 0
translateToChest :: Creature -> SPic -> SPic
translateToChest cr
| oneH cr = rotateSP 0.5
-- | twists cr = translateSPf 0 5 . rotateSP (-1)
| twists cr = rotateSP (-1)
| otherwise = id
oneH :: Creature -> Bool
oneH = crInStance OneHand