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

Function DoFacingCheck

renderer/HardwareDraw.cpp:114–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114bool DoFacingCheck(vector *norm, g3Point **vertlist, vector *p) {
115 if (norm) {
116 // have normal
117 ASSERT(norm->x || norm->y || norm->z);
118 return g3_CheckNormalFacing(p, norm);
119 } else {
120 // normal not specified, so must compute
121 vector tempv;
122 // get three points (rotated) and compute normal
123 vm_GetPerp(&tempv, &vertlist[0]->p3_vec, &vertlist[1]->p3_vec, &vertlist[2]->p3_vec);
124 return ((tempv * vertlist[1]->p3_vec) < 0);
125 }
126}
127
128// like g3_DrawPoly(), but checks to see if facing. If surface normal is
129// NULL, this routine must compute it, which will be slow. It is better to

Callers 1

g3_CheckAndDrawPolyFunction · 0.85

Calls 2

g3_CheckNormalFacingFunction · 0.85
vm_GetPerpFunction · 0.50

Tested by

no test coverage detected