Computes (fills in) the surface normal of a face. Finds the best normal on this face by checking all sets of three vertices IMPORTANT: The caller should really check the return value of this function Parameters: rp,facenum - the room and face to calculate the normal for Returns: true if the normal is ok false if the normal has a very small (pre-normalization) magnitude
| 793 | // Returns: true if the normal is ok |
| 794 | // false if the normal has a very small (pre-normalization) magnitude |
| 795 | bool ComputeFaceNormal(room *rp, int facenum) { |
| 796 | face *fp = &rp->faces[facenum]; |
| 797 | bool ok; |
| 798 | |
| 799 | ok = ComputeNormal(&fp->normal, fp->num_verts, fp->face_verts, rp->verts); |
| 800 | |
| 801 | if (!ok) { |
| 802 | mprintf(1, "Warning: Low precision normal for room:face = %d:%d\n", ROOMNUM(rp), facenum); |
| 803 | } |
| 804 | |
| 805 | return ok; |
| 806 | } |
| 807 | |
| 808 | // Compute the surface normal from a list of vertices that determine a face |
| 809 | // Finds the best normal on this face by checking all sets of three vertices |
no test coverage detected