Calculates the perpendicular vector given three points Parms: n - the computed perp vector (filled in) v0,v1,v2 - three clockwise vertices
| 207 | // Parms: n - the computed perp vector (filled in) |
| 208 | // v0,v1,v2 - three clockwise vertices |
| 209 | void vm_GetPerp(vector *n, vector *a, vector *b, vector *c) { |
| 210 | // Given 3 vertices, return the surface normal in n |
| 211 | // IMPORTANT: B must be the 'corner' vertex |
| 212 | |
| 213 | vector x, y; |
| 214 | |
| 215 | vm_SubVectors(&x, b, a); |
| 216 | vm_SubVectors(&y, c, b); |
| 217 | |
| 218 | vm_CrossProduct(n, &x, &y); |
| 219 | } |
| 220 | |
| 221 | // Calculates the (normalized) surface normal give three points |
| 222 | // Parms: n - the computed surface normal (filled in) |
no test coverage detected