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

Function iModelCull

src/SB/Core/gc/iModel.cpp:197–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197S32 iModelCull(RpAtomic* model, RwMatrix* mat)
198{
199 RwCamera* cam = RwCameraGetCurrentCamera();
200 RwSphere sph;
201
202 RwV3dTransformPoints(&sph.center, &model->boundingSphere.center, 1, mat);
203
204 RwReal f1 = RwV3dDotProductMacro(&mat->right, &mat->right);
205 RwReal f3 = RwV3dDotProductMacro(&mat->up, &mat->up);
206 RwReal f4 = RwV3dDotProductMacro(&mat->at, &mat->at);
207
208 sph.radius = model->boundingSphere.radius * xsqrt(MAX(f1, MAX(f3, f4)));
209
210 model->worldBoundingSphere = sph;
211
212 if (!cam)
213 {
214 return 1;
215 }
216
217 return (RwCameraFrustumTestSphere(cam, &sph) == rwSPHEREOUTSIDE);
218}
219
220S32 iModelSphereCull(xSphere* sphere)
221{

Callers 10

refresh_spheresMethod · 0.85
RenderGlobsMethod · 0.85
RenderFrozenPlayerMethod · 0.85
Jsp_ClumpRenderFunction · 0.85
xModelBucket_AddFunction · 0.85
xEntBoulder_RenderFunction · 0.85
xSkyDome_RenderFunction · 0.85
xModelRenderSingleFunction · 0.85
xEntRenderFunction · 0.85

Calls 1

xsqrtFunction · 0.85

Tested by

no test coverage detected