MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / MoveEvadePos

Method MoveEvadePos

src/SB/Game/zNPCGoalRobo.cpp:755–774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753}
754
755S32 zNPCGoalAlertChomper::MoveEvadePos(const xVec3* pos, F32 dt)
756{
757 S32 arrived = 0;
758 zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner);
759 xVec3 dir_evade;
760 xVec3 dir;
761 F32 dst = npc->XZDstSqToPos(pos, &dir_evade, 0);
762 if (dst < SQ(1.0f))
763 {
764 arrived = 1;
765 }
766 else
767 {
768 dir_evade /= xsqrt(dst);
769 npc->ThrottleAdjust(dt, 2.5f, -1.0f);
770 NPCC_ang_toXZDir(npc->frame->rot.angle + npc->TurnToFace(dt, &dir_evade, -1.0f), &dir);
771 npc->ThrottleApply(dt, &dir, 0);
772 }
773 return arrived;
774}
775
776void zNPCGoalAlertFodder::MoveEvade(F32 dt)
777{

Callers

nothing calls this directly

Calls 5

xsqrtFunction · 0.85
NPCC_ang_toXZDirFunction · 0.85
ThrottleAdjustMethod · 0.80
TurnToFaceMethod · 0.80
ThrottleApplyMethod · 0.80

Tested by

no test coverage detected