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

Method ZoomMove

src/SB/Game/zNPCGoalRobo.cpp:2318–2356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2316}
2317
2318S32 zNPCGoalAlertChuck::ZoomMove(F32 dt)
2319{
2320 S32 donemoving = 0;
2321 zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner);
2322 F32 dist;
2323 xVec3 dir;
2324 if (dst_zoom < 0.5f)
2325 {
2326 npc->ThrottleAdjust(dt, 0.5f, -1.0f);
2327 }
2328 else
2329 {
2330 npc->ThrottleAdjust(dt, 6.0f, -1.0f);
2331 }
2332 npc->XYZVecToPos(&dir, npc->arena.Pos());
2333 dir.x = dir_zoom.x;
2334 dir.z = dir_zoom.z;
2335 dist = xVec3Length(&dir);
2336 if (dist > dst_zoom)
2337 {
2338 dst_zoom = -1.0f;
2339 }
2340 else if (dist < 1e-5f)
2341 {
2342 dst_zoom = -1.0f;
2343 }
2344 else
2345 {
2346 xVec3SMulBy(&dir, (1.0f / dist));
2347 npc->ThrottleApply(dt, &dir, 0);
2348 dst_zoom =
2349 -((dt * npc->spd_throttle) * ((F32)__fabs(dir.x) + (F32)__fabs(dir.z)) - dst_zoom);
2350 }
2351 if (dst_zoom < 0.0f)
2352 {
2353 donemoving = 1;
2354 }
2355 return donemoving;
2356}
2357
2358S32 zNPCGoalAlertTubelet::Enter(F32 dt, void* updCtxt)
2359{

Callers

nothing calls this directly

Calls 6

xVec3LengthFunction · 0.85
xVec3SMulByFunction · 0.85
ThrottleAdjustMethod · 0.80
XYZVecToPosMethod · 0.80
ThrottleApplyMethod · 0.80
PosMethod · 0.45

Tested by

no test coverage detected