| 635 | } |
| 636 | |
| 637 | void zNPCTiki::Process(xScene* xscn, F32 dt) |
| 638 | { |
| 639 | xVec3* t0; |
| 640 | U32 i; |
| 641 | xQuat* q0; |
| 642 | |
| 643 | if (!(this->numChildren == NULL || ((this->tikiFlag & 8) != 0))) |
| 644 | { |
| 645 | return; |
| 646 | } |
| 647 | |
| 648 | this->tikiFlag &= ~8; |
| 649 | |
| 650 | if ((this->tikiFlag & 0x300) == 0x200) |
| 651 | { |
| 652 | zNPCCommon::Process(xscn, dt); |
| 653 | return; |
| 654 | } |
| 655 | |
| 656 | if (this->tikiAnim != NULL && ((this->tikiFlag & 0xC0) == 0)) |
| 657 | { |
| 658 | F32 duration = iAnimDuration(this->tikiAnim); |
| 659 | this->tikiAnimTime += dt; |
| 660 | |
| 661 | if (this->tikiAnimTime >= duration) |
| 662 | { |
| 663 | if (xrand() & 1) |
| 664 | { |
| 665 | this->tikiAnimTime -= duration; |
| 666 | } |
| 667 | else |
| 668 | { |
| 669 | this->tikiAnimTime = 0.0f; |
| 670 | this->tikiFlag &= ~0xC0; |
| 671 | this->tikiFlag |= 0x40; |
| 672 | } |
| 673 | } |
| 674 | |
| 675 | q0 = (xQuat*)giAnimScratch; |
| 676 | t0 = (xVec3*)(q0 + 0x41); |
| 677 | iAnimEval(this->tikiAnim, this->tikiAnimTime, 0, t0, q0); |
| 678 | iModelAnimMatrices(this->model->Data, q0, t0, this->model->Mat + 1); |
| 679 | } |
| 680 | |
| 681 | xVec3 pos_save; |
| 682 | xVec3Copy(&pos_save, (xVec3*)&this->model->Mat->pos); |
| 683 | |
| 684 | if (this->numParents != 0) |
| 685 | { |
| 686 | for (i = 0; i < 4; ++i) |
| 687 | { |
| 688 | if (this->parents[i] && !(this->updatedParents & (1 << i))) |
| 689 | { |
| 690 | this->parents[i]->tikiFlag |= 8; |
| 691 | this->parents[i]->Process(xscn, dt); |
| 692 | } |
| 693 | } |
| 694 | } |
nothing calls this directly
no test coverage detected