Calculates the perpendicular vector given three points Parms: n - the computed perp vector (filled in) v0,v1,v2 - three clockwise vertices
| 250 | // Parms: n - the computed perp vector (filled in) |
| 251 | // v0,v1,v2 - three clockwise vertices |
| 252 | void vm_GetPerp(vector *n, vector *a, vector *b, vector *c) { |
| 253 | // Given 3 vertices, return the surface normal in n |
| 254 | // IMPORTANT: B must be the 'corner' vertex |
| 255 | |
| 256 | vector x, y; |
| 257 | |
| 258 | vm_SubVectors(&x, b, a); |
| 259 | vm_SubVectors(&y, c, b); |
| 260 | |
| 261 | vm_CrossProduct(n, &x, &y); |
| 262 | } |
| 263 | |
| 264 | // Calculates the (normalized) surface normal give three points |
| 265 | // Parms: n - the computed surface normal (filled in) |
no test coverage detected