Move stride/footforward datatypes

This commit is contained in:
2026-04-03 11:21:09 +01:00
parent d65a4529be
commit b7b42f50a5
12 changed files with 238 additions and 248 deletions
+6 -6
View File
@@ -91,9 +91,9 @@ chaseUpperBody cr = colorSH (_skinUpper cskin)
_ -> 0
sLen = strideLength cr
tbob = 5 * (1 - oneSmooth (abs llegpos))
llegpos = case cr ^? crStance . carriage of
Just (Walking sa LeftForward) -> f sa
Just (Walking sa RightForward) -> -f sa
llegpos = case (cr ^? crType . strideAmount,cr ^? crType . footForward) of
(Just sa, Just LeftForward) -> f sa
(Just sa, Just RightForward) -> -f sa
_ -> 0
--tbob = 2 * oneSmooth ((sLen - 2*i) / sLen)
f i = (sLen - 2*i) / sLen
@@ -104,9 +104,9 @@ oneSmooth x = sin (pi * x * 0.5)
feet :: Creature -> Shape
{-# INLINE feet #-}
feet cr = case cr ^? crStance . carriage of
Just (Walking sa LeftForward) -> sh (f sa)
Just (Walking sa RightForward) -> sh (-f sa)
feet cr = case (cr ^? crType . strideAmount,cr ^? crType . footForward) of
(Just sa,Just LeftForward) -> sh (f sa)
(Just sa,Just RightForward) -> sh (-f sa)
_ -> sh 0
where
sh x = translateSHxy x off aFoot <> translateSHxy (- x) (- off) aFoot