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

Function iBoxForModelLocal

src/SB/Core/gc/iCollide.cpp:1082–1107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1080}
1081
1082void iBoxForModelLocal(xBox* o, const xModelInstance* m)
1083{
1084 RpAtomic* imodel = m->Data;
1085 RpGeometry* geom = imodel->geometry;
1086 if (geom->triangles == NULL)
1087 {
1088 o->lower.x = imodel->boundingSphere.center.x - imodel->boundingSphere.radius;
1089 o->lower.y = imodel->boundingSphere.center.y - imodel->boundingSphere.radius;
1090 o->lower.z = imodel->boundingSphere.center.z - imodel->boundingSphere.radius;
1091 o->upper.x = imodel->boundingSphere.center.x + imodel->boundingSphere.radius;
1092 o->upper.y = imodel->boundingSphere.center.y + imodel->boundingSphere.radius;
1093 o->upper.z = imodel->boundingSphere.center.z + imodel->boundingSphere.radius;
1094 return;
1095 }
1096
1097 if (geom->numMorphTargets > 1 || geom->numMorphTargets >= 1)
1098 {
1099 RpMorphTarget* mtgt = geom->morphTarget;
1100 iBoxInitBoundVec(o, (xVec3*)mtgt->verts);
1101
1102 for (U16 idx = 1; idx < geom->numVertices; idx++)
1103 {
1104 iBoxBoundVec(o, o, (xVec3*)&mtgt->verts[idx]);
1105 }
1106 }
1107}

Callers 4

iBoxForModelFunction · 0.70
SwapModelFunction · 0.50
InitMethod · 0.50
xEntSetupFunction · 0.50

Calls 2

iBoxInitBoundVecFunction · 0.85
iBoxBoundVecFunction · 0.85

Tested by

no test coverage detected