| 654 | } |
| 655 | |
| 656 | void xEntReset(xEnt* ent) |
| 657 | { |
| 658 | xMat4x3 frame; |
| 659 | xModelInstance* minst; |
| 660 | |
| 661 | xBaseReset(ent, ent->asset); |
| 662 | |
| 663 | ent->baseFlags |= 0x20; |
| 664 | ent->flags = ent->asset->flags; |
| 665 | ent->miscflags = 0; |
| 666 | ent->moreFlags = ent->asset->moreFlags; |
| 667 | |
| 668 | xEntAddHittableFlag(ent); |
| 669 | xEntAddShadowRecFlag(ent); |
| 670 | |
| 671 | xMat3x3Euler(&frame, ent->asset->ang.x, ent->asset->ang.y, ent->asset->ang.z); |
| 672 | |
| 673 | xVec3SMulBy(&frame.right, ent->asset->scale.x); |
| 674 | xVec3SMulBy(&frame.up, ent->asset->scale.y); |
| 675 | xVec3SMulBy(&frame.at, ent->asset->scale.z); |
| 676 | xVec3Copy(&frame.pos, &ent->asset->pos); |
| 677 | |
| 678 | frame.flags = 0; |
| 679 | |
| 680 | if (ent->model) |
| 681 | { |
| 682 | xModelSetFrame(ent->model, &frame); |
| 683 | |
| 684 | if (ent->collModel) |
| 685 | { |
| 686 | xModelSetFrame(ent->collModel, &frame); |
| 687 | } |
| 688 | |
| 689 | if (ent->moreFlags & 0x20) |
| 690 | { |
| 691 | anim_coll::reset(*ent); |
| 692 | } |
| 693 | |
| 694 | minst = ent->model; |
| 695 | |
| 696 | while (minst) |
| 697 | { |
| 698 | minst->RedMultiplier = ent->asset->redMult; |
| 699 | minst->GreenMultiplier = ent->asset->greenMult; |
| 700 | minst->BlueMultiplier = ent->asset->blueMult; |
| 701 | |
| 702 | minst->Alpha = minst->Data->geometry->matList.materials[0]->color.alpha / 255.0f; |
| 703 | minst->Scale.x = 0.0f; |
| 704 | minst->Scale.y = 0.0f; |
| 705 | minst->Scale.z = 0.0f; |
| 706 | |
| 707 | minst = minst->Next; |
| 708 | } |
| 709 | } |
| 710 | |
| 711 | if (ent->frame) |
| 712 | { |
| 713 | xMat4x3Copy(&ent->frame->mat, &frame); |
no test coverage detected