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

Method BUpdate

src/SB/Game/zNPCTypeCommon.cpp:796–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

794}
795
796void zNPCCommon::BUpdate(xVec3* pos)
797{
798 NPCConfig* cfg = this->cfg_npc;
799
800 if (cfg->useBoxBound)
801 {
802 this->bound.type = XBOUND_TYPE_BOX;
803
804 xBBox* box = &this->bound.box;
805 xVec3 half = cfg->dim_bound * 0.5f;
806
807 box->center = *pos + cfg->off_bound;
808 box->box.upper = box->center + half;
809 box->box.lower = box->center - half;
810 }
811 else
812 {
813 this->bound.type = XBOUND_TYPE_SPHERE;
814
815 xSphere* sph = &this->bound.sph;
816
817 sph->center = *pos + cfg->off_bound;
818 sph->r = cfg->dim_bound.x;
819 }
820
821 if (this->bound.type != XBOUND_TYPE_NA)
822 {
823 xQuickCullForBound(&this->bound.qcd, &this->bound);
824 }
825
826 zGridUpdateEnt(this);
827}
828
829F32 zNPCCommon::BoundAsRadius(S32 useCfg) const
830{

Callers

nothing calls this directly

Calls 2

zGridUpdateEntFunction · 0.70
xQuickCullForBoundFunction · 0.50

Tested by

no test coverage detected