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

Function iSphereForModel

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

Source from the content-addressed store, hash-verified

1048}
1049
1050void iSphereForModel(xSphere* o, const xModelInstance* m)
1051{
1052 RpAtomic* imodel = m->Data;
1053 RpGeometry* geom = imodel->geometry;
1054 if (geom->triangles == NULL)
1055 {
1056 o->center.x = imodel->boundingSphere.center.x;
1057 o->center.y = imodel->boundingSphere.center.y;
1058 o->center.z = imodel->boundingSphere.center.z;
1059 o->r = imodel->boundingSphere.radius;
1060 return;
1061 }
1062
1063 if (geom->numMorphTargets > 1 || geom->numMorphTargets >= 1)
1064 {
1065 RpMorphTarget* mtgt = geom->morphTarget;
1066 iSphereInitBoundVec(o, (xVec3*)mtgt->verts);
1067
1068 for (U16 idx = 1; idx < geom->numVertices; idx++)
1069 {
1070 iSphereBoundVec(o, o, (xVec3*)&mtgt->verts[idx]);
1071 }
1072 }
1073}
1074
1075void iBoxForModel(xBox* o, const xModelInstance* m)
1076{

Callers 1

InitBoundsMethod · 0.50

Calls 2

iSphereInitBoundVecFunction · 0.85
iSphereBoundVecFunction · 0.70

Tested by

no test coverage detected