Returns true if the external room is in the view cone Else returns false
| 417 | // Returns true if the external room is in the view cone |
| 418 | // Else returns false |
| 419 | bool IsRoomVisible(room *rp, float *nearz) { |
| 420 | g3Point pnt; |
| 421 | uint8_t ccode; |
| 422 | |
| 423 | vector corners[8]; |
| 424 | |
| 425 | MakePointsFromMinMax(corners, &rp->min_xyz, &rp->max_xyz); |
| 426 | |
| 427 | *nearz = 90000000; |
| 428 | uint8_t andbyte = 0xff; |
| 429 | for (int t = 0; t < 8; t++) { |
| 430 | g3_RotatePoint(&pnt, &corners[t]); |
| 431 | |
| 432 | if (pnt.p3_z < *nearz) |
| 433 | *nearz = pnt.p3_z; |
| 434 | |
| 435 | ccode = g3_CodePoint(&pnt); |
| 436 | if (!ccode) |
| 437 | return true; |
| 438 | andbyte &= ccode; |
| 439 | } |
| 440 | |
| 441 | if (andbyte) |
| 442 | return false; |
| 443 | |
| 444 | return true; |
| 445 | } |
| 446 | |
| 447 | void TCAMRenderRoom(int roomnum) { |
| 448 | ASSERT(Rooms[roomnum].used); |
no test coverage detected