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

Function xFuncPiece_ShiftPiece

src/SB/Core/x/xMath.cpp:575–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573}
574
575void xFuncPiece_ShiftPiece(xFuncPiece* shift, xFuncPiece* func, F32 newZero)
576
577{
578 S32 i, j;
579 xFuncPiece temp;
580
581 for (i = 0; i < func->order; i++)
582 {
583 temp.coef[i] = 0.0f;
584 }
585
586 temp.coef[func->order] = func->coef[func->order];
587
588 for (i = func->order - 1; i >= 0; i--)
589 {
590 for (j = i; j < func->order; j++)
591 {
592 temp.coef[j] += newZero * temp.coef[j + 1];
593 }
594 temp.coef[i] += func->coef[i];
595 }
596
597 shift->order = func->order;
598
599 for (i = 0; i <= shift->order; i++)
600 {
601 shift->coef[i] = temp.coef[i];
602 }
603
604 shift->end = func->end - newZero;
605}

Callers 1

xFuncPiece_EndPointsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected