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

Function ArcEvalIterate

src/SB/Core/x/xSpline.cpp:496–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494}
495
496F32 ArcEvalIterate(xSpline3* spl, F32 s, U32 deriv, xVec3* o, U32 iterations)
497{
498 xCoef3* coef;
499 xCoef3 tempCoef;
500
501 U32 seg;
502 S32 min;
503 S32 max;
504 S32 test;
505 S32 segmul;
506
507 F32 utest;
508 F32 arctest;
509 F32 umin;
510 F32 umax;
511 F32 smin;
512 F32 smax;
513 F32 arclengthmax;
514
515 min = -1;
516 max = spl->arcSample * spl->N - 1;
517 if (max != 0)
518 {
519 while (min + 1 != max)
520 {
521 test = min + max >> 1;
522 segmul = test;
523 if (s <= spl->arcLength[test])
524 {
525 segmul = min;
526 max = test;
527 }
528 min = segmul;
529 }
530 }
531
532 seg = max / spl->arcSample;
533 min = seg * spl->arcSample;
534 umin = (F32)(max - min) / (F32)spl->arcSample;
535 umax = (F32)((max + 1) - min) / (F32)spl->arcSample;
536 if (max > 1)
537 {
538 smax = spl->arcLength[max - 1];
539 }
540 else
541 {
542 smax = 0.0;
543 }
544
545 arclengthmax = spl->arcLength[max];
546 if (min - 1 > 0)
547 {
548 smin = spl->arcLength[min - 1];
549 }
550 else
551 {
552 smin = 0.0;
553 }

Callers 1

xSpline3_EvalArcApproxFunction · 0.70

Calls 3

EvalCoef3Function · 0.85
CoefSeg3Function · 0.70
ArcLength3Function · 0.70

Tested by

no test coverage detected