Improve chaseCrit shape

This commit is contained in:
2026-04-03 15:31:11 +01:00
parent 921f860e83
commit 2d1cf4b371
3 changed files with 13 additions and 12 deletions
+7 -2
View File
@@ -89,8 +89,8 @@ chaseUpperBody w cr = colorSH (_skinUpper cskin)
cskin = crShape $ _crType cr
torsoq = (V3 0 0 (10 + tz + tbob),Q.qid)
mcool = 1 - min 10 (fromIntegral . _meleeCooldown $ _crType cr) / 10
neckq = torsoq `Q.comp` (V3 6 0 0,Q.axisAngle (V3 0 1 0) (-1.8*mcool))
headq = neckq `Q.comp` (V3 16 0 0, Q.axisAngle (V3 0 1 0) (2*mcool+vocaltilt) * Q.qz headrot )
neckq = torsoq `Q.comp` (V3 6 0 0, Q.qz aimrot * Q.axisAngle (V3 0 1 0) (-1.8*mcool))
headq = neckq `Q.comp` (V3 16 0 0, Q.axisAngle (V3 0 1 0) (2*mcool+vocaltilt) * Q.qz aimrot )
vocaltilt = case cr ^? crVocalization . vcTime of
Just x | x < 20 -> -pi * 0.05 * (10 - abs (fromIntegral x - 10))
_ -> 0
@@ -103,6 +103,11 @@ chaseUpperBody w cr = colorSH (_skinUpper cskin)
--tbob = 2 * oneSmooth ((sLen - 2*i) / sLen)
f i = (sLen - 2*i) / sLen
cxy = cr ^. crPos . _xy
aimrot = fromMaybe pi $ do
i <- cr ^. crIntention . targetCr
tcxy <- w ^? cWorld . lWorld . creatures . ix i . crPos . _xy
guard $ hasLOSIndirect cxy tcxy w
return . (0.5*) . nearZeroAngle $ argV (tcxy - cxy) - cr ^. crDir
headrot = fromMaybe pi $ do
i <- cr ^. crIntention . targetCr
tcxy <- w ^? cWorld . lWorld . creatures . ix i . crPos . _xy