MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ComputeFaceNormal

Function ComputeFaceNormal

Descent3/room.cpp:795–806  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

793// Returns: true if the normal is ok
794// false if the normal has a very small (pre-normalization) magnitude
795bool 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

Callers 15

CreateDefaultRoomFunction · 0.85
ResetRoomFaceNormalsFunction · 0.85
FixConcaveFacesFunction · 0.85
CheckNormalsFunction · 0.85
OnTrigAddFloatingMethod · 0.85
OnCreateVolumeConeMethod · 0.85
OnEdgeVolumetricMethod · 0.85
VerifyDoorModelFunction · 0.85
AddRoomFunction · 0.85
ClipFaceFunction · 0.85
TriangulateFaceFunction · 0.85
FlipFaceFunction · 0.85

Calls 1

ComputeNormalFunction · 0.85

Tested by

no test coverage detected