MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / getFootFront

Method getFootFront

src/logic/NpcAnimationHandler.cpp:585–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

583}
584
585NpcAnimationHandler::EFootSide NpcAnimationHandler::getFootFront()
586{
587 if (isAnimationActive(getActiveSet().s_walk) || isAnimationActive(getActiveSet().s_runl))
588 {
589 float p = getAnimHandler().getActiveAnimationProgress();
590
591 if (getController().getWeaponMode() == EWeaponMode::WeaponNone)
592 {
593 // These values are tied to the original animations
594 if (p > 0.85f || p < 0.15f)
595 return EFootSide::FS_Left;
596 else if (p > 0.35f && p < 0.65f)
597 return EFootSide::FS_Right;
598 }
599 else
600 {
601 // Never return "none" when fighting, making stopping faster
602 if (p > 0.75f || p < 0.25f)
603 return EFootSide::FS_Left;
604 else
605 return EFootSide::FS_Right;
606 }
607 }
608 else if (isAnimationActive(getActiveSet().s_walk))
609 {
610 float p = getAnimHandler().getActiveAnimationProgress();
611
612 if (p > 0.90f || p < 0.10f)
613 return EFootSide::FS_Left;
614 else if (p > 0.40f && p < 0.60f)
615 return EFootSide::FS_Right;
616 }
617
618 return EFootSide::FS_None;
619}
620
621void NpcAnimationHandler::stopTurningAnimations()
622{

Callers

nothing calls this directly

Calls 2

getWeaponModeMethod · 0.80

Tested by

no test coverage detected