Marks all the faces facing us as drawable
| 523 | |
| 524 | // Marks all the faces facing us as drawable |
| 525 | void MarkFacingFaces(int roomnum, vector *world_verts) { |
| 526 | room *rp = &Rooms[roomnum]; |
| 527 | face *fp; |
| 528 | vector tvec; |
| 529 | if (Facing_visited[roomnum] == FrameCount) |
| 530 | return; |
| 531 | Facing_visited[roomnum] = FrameCount; |
| 532 | |
| 533 | fp = &rp->faces[0]; |
| 534 | // Go through and mark all non facing faces |
| 535 | if (Render_mirror_for_room) { |
| 536 | room *mirror_rp = &Rooms[Mirror_room]; |
| 537 | face *mirror_fp = &mirror_rp->faces[mirror_rp->mirror_face]; |
| 538 | for (int t = 0; t < rp->num_faces; t++, fp++) { |
| 539 | vector incident_norm; |
| 540 | ReflectRay(&incident_norm, &fp->normal, &mirror_fp->normal); |
| 541 | |
| 542 | tvec = Viewer_eye - world_verts[fp->face_verts[0]]; |
| 543 | if ((tvec * incident_norm) <= 0) |
| 544 | fp->flags |= FF_NOT_FACING; |
| 545 | } |
| 546 | } else { |
| 547 | for (int i = 0; i < rp->num_faces; i++, fp++) { |
| 548 | tvec = Viewer_eye - world_verts[fp->face_verts[0]]; |
| 549 | if ((tvec * fp->normal) <= 0) |
| 550 | fp->flags |= FF_NOT_FACING; |
| 551 | } |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | // Returns true if the external room is visible from the passed in portal |
| 556 | int ExternalRoomVisibleFromPortal(int index, clip_wnd *wnd) { |
no test coverage detected