Finds the center point of a room Parameters: vp - filled in with the center point rp - the room whose center to find
| 757 | // Parameters: vp - filled in with the center point |
| 758 | // rp - the room whose center to find |
| 759 | void ComputeRoomCenter(vector *vp, room *rp) { |
| 760 | int i; |
| 761 | |
| 762 | vp->x = vp->y = vp->z = 0; |
| 763 | |
| 764 | for (i = 0; i < rp->num_verts; i++) |
| 765 | *vp += rp->verts[i]; |
| 766 | |
| 767 | #ifdef NEWEDITOR |
| 768 | if (rp->num_verts) |
| 769 | #endif |
| 770 | *vp /= rp->num_verts; |
| 771 | } |
| 772 | |
| 773 | // Computes the center point on a face by averaging the points in the face |
| 774 | void ComputeCenterPointOnFace(vector *vp, room *rp, int facenum) { |
no outgoing calls
no test coverage detected