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

Function xParCmdRotateAround_Update

src/SB/Core/x/xParCmd.cpp:392–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392void xParCmdRotateAround_Update(xParCmd* c, xParGroup* ps, F32 dt)
393{
394 xPar* p = ps->m_root;
395 xParCmdRotateAround* cmd = (xParCmdRotateAround*)c->tasset;
396
397 F32 yaw = PI * (dt * cmd->yaw) / 180.0f;
398 F32 radius_growth = dt * cmd->radius_growth;
399
400 while (p)
401 {
402 xVec3 at;
403 xVec3Sub(&at, &cmd->pos, &p->m_pos);
404
405 at.y = 0.0f;
406
407 xMat3x3 lookmat;
408
409 F32 radius = xMat3x3LookVec(&lookmat, &at);
410
411 xVec3 angles;
412 xMat3x3GetEuler(&lookmat, &angles);
413
414 angles.x += yaw;
415
416 xMat3x3 rotmat;
417 xMat3x3Euler(&rotmat, angles.x, angles.y, angles.z);
418
419 xVec3 var_BC, var_C8;
420
421 // non-matching: f0 and f1 swapped
422
423 var_BC.x = 0.0f;
424 var_BC.y = 0.0f;
425 var_BC.z = radius + radius_growth;
426
427 xMat3x3RMulVec(&var_C8, &rotmat, &var_BC);
428
429 p->m_pos.x = var_C8.x + cmd->pos.x;
430 p->m_pos.z = var_C8.z + cmd->pos.z;
431
432 p = p->m_next;
433 }
434}
435
436void xParCmdTex_Update(xParCmd* c, xParGroup* ps, F32 dt)
437{

Callers

nothing calls this directly

Calls 5

xVec3SubFunction · 0.85
xMat3x3EulerFunction · 0.85
xMat3x3LookVecFunction · 0.70
xMat3x3GetEulerFunction · 0.70
xMat3x3RMulVecFunction · 0.70

Tested by

no test coverage detected