| 370 | } |
| 371 | |
| 372 | void SweptSphereHitsCameraEnt(xScene*, xRay3* ray, xQCData* qcd, xEnt* ent, void* data) |
| 373 | { |
| 374 | xSweptSphere* sws = (xSweptSphere*)data; |
| 375 | |
| 376 | if (ent->camcollModel && ent->chkby & 0x10 && xQuickCullIsects(qcd, &ent->bound.qcd)) |
| 377 | { |
| 378 | if (!xEntIsVisible(ent)) |
| 379 | { |
| 380 | if (ent->model->Data != sInvisWallHack) |
| 381 | { |
| 382 | return; |
| 383 | } |
| 384 | |
| 385 | if (ent->collLev != 5) |
| 386 | { |
| 387 | if (ent->bound.type == XBOUND_TYPE_BOX) |
| 388 | { |
| 389 | xSweptSphereToBox(sws, &ent->bound.box.box, NULL); |
| 390 | return; |
| 391 | } |
| 392 | else if (ent->bound.type == XBOUND_TYPE_OBB) |
| 393 | { |
| 394 | xSweptSphereToBox(sws, &ent->bound.box.box, ent->bound.mat); |
| 395 | return; |
| 396 | } |
| 397 | else |
| 398 | { |
| 399 | return; |
| 400 | } |
| 401 | } |
| 402 | } |
| 403 | |
| 404 | U32 result = 0; |
| 405 | |
| 406 | switch (ent->bound.type) |
| 407 | { |
| 408 | case XBOUND_TYPE_SPHERE: |
| 409 | { |
| 410 | F32 oldrad = ent->bound.sph.r; |
| 411 | |
| 412 | ent->bound.sph.r += sws->radius; |
| 413 | |
| 414 | result = xRayHitsSphereFast(ray, &ent->bound.sph); |
| 415 | |
| 416 | ent->bound.sph.r = oldrad; |
| 417 | |
| 418 | break; |
| 419 | } |
| 420 | case XBOUND_TYPE_BOX: |
| 421 | { |
| 422 | xBox tmpbox; |
| 423 | tmpbox.upper.x = ent->bound.box.box.upper.x + sws->radius; |
| 424 | tmpbox.upper.y = ent->bound.box.box.upper.y + sws->radius; |
| 425 | tmpbox.upper.z = ent->bound.box.box.upper.z + sws->radius; |
| 426 | tmpbox.lower.x = ent->bound.box.box.lower.x - sws->radius; |
| 427 | tmpbox.lower.y = ent->bound.box.box.lower.y - sws->radius; |
| 428 | tmpbox.lower.z = ent->bound.box.box.lower.z - sws->radius; |
| 429 |
nothing calls this directly
no test coverage detected