Returns true if the external room is in the view cone Else returns false
| 1010 | // Returns true if the external room is in the view cone |
| 1011 | // Else returns false |
| 1012 | bool ExternalRoomVisible(room *rp, vector *center, float *zdist) { |
| 1013 | ASSERT(rp->flags & RF_EXTERNAL); |
| 1014 | g3Point pnt; |
| 1015 | uint8_t ccode; |
| 1016 | |
| 1017 | vector corners[8]; |
| 1018 | g3_RotatePoint(&pnt, center); |
| 1019 | *zdist = pnt.p3_z; |
| 1020 | MakePointsFromMinMax(corners, &rp->min_xyz, &rp->max_xyz); |
| 1021 | uint8_t andbyte = 0xff; |
| 1022 | for (int t = 0; t < 8; t++) { |
| 1023 | g3_RotatePoint(&pnt, &corners[t]); |
| 1024 | ccode = g3_CodePoint(&pnt); |
| 1025 | if (!ccode) |
| 1026 | return true; |
| 1027 | andbyte &= ccode; |
| 1028 | } |
| 1029 | if (andbyte) |
| 1030 | return false; |
| 1031 | return true; |
| 1032 | } |
| 1033 | // Render all the rooms out on the terrain for this frame |
| 1034 | void RenderTerrainRooms() { |
| 1035 | object *obj; |
no test coverage detected