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

Function xEntReset

src/SB/Core/x/xEnt.cpp:656–739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

654}
655
656void 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);

Callers 9

ResetMethod · 0.70
xEntBoulder_ResetFunction · 0.70
xEntMotionDebugIPadFunction · 0.70
zEntButton_InitFunction · 0.50
zEntButton_ResetFunction · 0.50
zEntHangable_ResetFunction · 0.50
zEntDestructObj_InitFunction · 0.50
zEntDestructObj_ResetFunction · 0.50
zEntResetFunction · 0.50

Calls 12

xBaseResetFunction · 0.85
xEntAddShadowRecFlagFunction · 0.85
xMat3x3EulerFunction · 0.85
xVec3SMulByFunction · 0.85
xVec3CopyFunction · 0.85
xModelSetFrameFunction · 0.85
xMat4x3CopyFunction · 0.85
xRotCopyFunction · 0.85
xrandFunction · 0.85
setup_stacked_entityFunction · 0.85
xEntAddHittableFlagFunction · 0.70
resetFunction · 0.70

Tested by

no test coverage detected