Calculates the (normalized) surface normal give three points Parms: n - the computed surface normal (filled in) v0,v1,v2 - three clockwise vertices Returns the magnitude of the normal before it was normalized. The bigger this value, the better the normal.
| 224 | // Returns the magnitude of the normal before it was normalized. |
| 225 | // The bigger this value, the better the normal. |
| 226 | float vm_GetNormal(vector *n, vector *v0, vector *v1, vector *v2) { |
| 227 | vm_GetPerp(n, v0, v1, v2); |
| 228 | |
| 229 | return vm_NormalizeVector(n); |
| 230 | } |
| 231 | |
| 232 | // Does a simple dot product calculation |
| 233 | float vm_DotProduct(const vector *u, const vector *v) { return (u->x * v->x) + (u->y * v->y) + (u->z * v->z); } |