| 195 | } |
| 196 | |
| 197 | S32 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 | |
| 220 | S32 iModelSphereCull(xSphere* sphere) |
| 221 | { |
no test coverage detected