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

Function LassoFlyCB

src/SB/Game/zEntPlayer.cpp:3287–3317  ·  view source on GitHub ↗

Equivalent

Source from the content-addressed store, hash-verified

3285
3286// Equivalent
3287static U32 LassoFlyCB(xAnimTransition*, xAnimSingle*, void* object)
3288{
3289 xEnt* ent = (xEnt*)object;
3290
3291 zEntPlayer_SNDPlay(ePlayerSnd_LassoThrow, 0.0f);
3292 zLasso_ResetTimer(sLasso, 0.4f * sLassoInfo->dist);
3293
3294 if (sLassoInfo->targetGuide == 0)
3295 {
3296 sLasso->flags = 1;
3297 xVec3Copy(&sLasso->tgCenter, xBoundCenter(&sLassoInfo->target->bound));
3298 xVec3AddScaled(&sLasso->tgCenter, (xVec3*)&ent->model->Mat->at,
3299 sLassoInfo->target->model->Data->boundingSphere.radius * sLassoInfo->dist);
3300 xVec3AddScaled(&sLasso->tgCenter, (xVec3*)&ent->model->Mat->up,
3301 sLassoInfo->target->model->Data->boundingSphere.radius * sLassoInfo->dist);
3302 sLasso->tgRadius = 1.5f * sLassoInfo->target->model->Data->boundingSphere.radius;
3303
3304 xVec3SMul(&sLasso->tgNormal, (xVec3*)&ent->model->Mat->at, 1.0f);
3305 // Result is being subtracted from original instead of negated and added
3306 sLasso->tgNormal.y += -(4.0f * sLassoInfo->dist - 5.0f);
3307 xVec3Normalize(&sLasso->tgNormal, &sLasso->tgNormal);
3308 }
3309 else
3310 {
3311 sLasso->flags = 1;
3312 zLasso_InterpToGuide(sLasso);
3313 }
3314
3315 sLasso->tgSlack = 0.5f;
3316 return 0;
3317}
3318
3319static U32 LassoDestroyCB(xAnimTransition*, xAnimSingle*, void*)
3320{

Callers

nothing calls this directly

Calls 8

zEntPlayer_SNDPlayFunction · 0.85
zLasso_ResetTimerFunction · 0.85
xVec3CopyFunction · 0.85
xBoundCenterFunction · 0.85
xVec3AddScaledFunction · 0.85
xVec3SMulFunction · 0.85
zLasso_InterpToGuideFunction · 0.70
xVec3NormalizeFunction · 0.50

Tested by

no test coverage detected