| 619 | } |
| 620 | |
| 621 | void xSpline3_ArcInit(xSpline3* spl, U32 sample) |
| 622 | { |
| 623 | xCoef3* coef; |
| 624 | xCoef3 tempCoef; |
| 625 | |
| 626 | F32 len; |
| 627 | F32 arcsum; |
| 628 | U32 i; |
| 629 | U32 seg; |
| 630 | |
| 631 | S32 sample_sum; |
| 632 | |
| 633 | if (sample == 0) |
| 634 | { |
| 635 | sample = 1; |
| 636 | } |
| 637 | |
| 638 | spl->arcSample = sample; |
| 639 | if (spl->arcLength != (F32*)0x0) |
| 640 | { |
| 641 | i = spl->allocN * spl->arcSample; |
| 642 | } |
| 643 | else |
| 644 | { |
| 645 | i = 0; |
| 646 | } |
| 647 | |
| 648 | if (i < spl->N * sample) |
| 649 | { |
| 650 | spl->arcLength = (F32*)xMemAlloc(gActiveHeap, spl->arcSample * spl->allocN * 4, 0); |
| 651 | } |
| 652 | |
| 653 | arcsum = 0.0; |
| 654 | if (spl->N != 0) |
| 655 | { |
| 656 | sample_sum = 0; |
| 657 | for (i = 0; i < spl->N; i += 1) |
| 658 | { |
| 659 | coef = CoefSeg3(spl, i, &tempCoef); |
| 660 | if (sample != 0) |
| 661 | { |
| 662 | for (seg = 0; seg < sample; seg += 1) |
| 663 | { |
| 664 | len = ArcLength3(coef, 0.0, (F32)(seg + 1) / (F32)sample); |
| 665 | spl->arcLength[seg + sample_sum] = arcsum + len; |
| 666 | } |
| 667 | } |
| 668 | sample_sum = sample_sum + sample; |
| 669 | arcsum = arcsum + len; |
| 670 | } |
| 671 | } |
| 672 | return; |
| 673 | } |
| 674 | |
| 675 | xSpline3* AllocSpline3(xVec3* points, F32* time, U32 numpoints, U32 numalloc, U32 flags, U32 type) |
| 676 | { |
no test coverage detected