Goes through all the vertices in the room and scales them by scale_factor
| 675 | |
| 676 | // Goes through all the vertices in the room and scales them by scale_factor |
| 677 | void SizeRoomVertices(room *rp, float scale_factor) { |
| 678 | vector room_center; |
| 679 | vector vec; |
| 680 | int portal_list[MAX_VERTS_PER_ROOM]; |
| 681 | int i, t, ok_to_scale; |
| 682 | int num_portal_verts; |
| 683 | |
| 684 | ASSERT(rp->used > 0); |
| 685 | |
| 686 | num_portal_verts = BuildListOfPortalVerts(rp, portal_list); |
| 687 | |
| 688 | ComputeRoomCenter(&room_center, rp); |
| 689 | |
| 690 | for (i = 0; i < rp->num_verts; i++) { |
| 691 | for (ok_to_scale = 1, t = 0; t < num_portal_verts; t++) { |
| 692 | if (portal_list[t] == i) { |
| 693 | ok_to_scale = 0; |
| 694 | break; |
| 695 | } |
| 696 | } |
| 697 | |
| 698 | if (ok_to_scale) { |
| 699 | vec = rp->verts[i] - room_center; |
| 700 | vec *= scale_factor; |
| 701 | rp->verts[i] = vec + room_center; |
| 702 | } |
| 703 | } |
| 704 | } |
| 705 | |
| 706 | // Goes through all the vertices in a face and scales them by scale_factor |
| 707 | void SizeFaceVertices(room *rp, int facenum, float scale_factor) { |
no test coverage detected