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

Method ThrottleApply

src/SB/Game/zNPCTypeCommon.cpp:1422–1449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1420}
1421
1422F32 zNPCCommon::ThrottleApply(F32 dt, const xVec3* dir, S32 force3D)
1423{
1424 xVec3 var_30;
1425 if (xVec3Length2(dir) < 0.00001f)
1426 {
1427 var_30 = *NPCC_faceDir(this) * this->spd_throttle;
1428 }
1429 else
1430 {
1431 var_30 = *dir * this->spd_throttle;
1432 }
1433
1434 var_30 *= dt;
1435
1436 if ((this->flg_move & 0x2) && !force3D)
1437 {
1438 this->frame->dpos.x = var_30.x;
1439 this->frame->dpos.z = var_30.z;
1440 }
1441 else
1442 {
1443 this->frame->dpos = var_30;
1444 }
1445
1446 this->frame->mode |= 0x2;
1447
1448 return this->spd_throttle;
1449}
1450
1451F32 zNPCCommon::TurnToFace(F32 dt, const xVec3* dir_want, F32 useTurnRate)
1452{

Callers 12

ProcessMethod · 0.80
FlankPlayerMethod · 0.80
GetInArenaMethod · 0.80
MoveEvadePosMethod · 0.80
MoveEvadeMethod · 0.80
SonarHomingMethod · 0.80
CirclePlayerMethod · 0.80
MoveCornerMethod · 0.80
ZoomMoveMethod · 0.80
MoveToHomeMethod · 0.80
HoundPlayerMethod · 0.80
ProcessMethod · 0.80

Calls 2

xVec3Length2Function · 0.85
NPCC_faceDirFunction · 0.85

Tested by

no test coverage detected