Computes the center point on a face by averaging the points in the face
| 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) { |
| 775 | face *fp = &rp->faces[facenum]; |
| 776 | int i; |
| 777 | |
| 778 | vp->x = vp->y = vp->z = 0; |
| 779 | |
| 780 | for (i = 0; i < fp->num_verts; i++) |
| 781 | *vp += rp->verts[fp->face_verts[i]]; |
| 782 | |
| 783 | *vp /= fp->num_verts; |
| 784 | } |
| 785 | |
| 786 | // the minimum magnitude of a surface normal that we're willing to accept |
| 787 | #define MIN_NORMAL_MAG 0.035 |
no outgoing calls
no test coverage detected