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

Function vm_GetNormal

scripts/osiris_vector.h:269–273  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

267// Returns the magnitude of the normal before it was normalized.
268// The bigger this value, the better the normal.
269float vm_GetNormal(vector *n, vector *v0, vector *v1, vector *v2) {
270 vm_GetPerp(n, v0, v1, v2);
271
272 return vm_VectorNormalize(n);
273}
274
275// Does a simple dot product calculation
276float vm_DotProduct(vector *u, vector *v) { return (u->x * v->x) + (u->y * v->y) + (u->z * v->z); }

Callers

nothing calls this directly

Calls 2

vm_GetPerpFunction · 0.70
vm_VectorNormalizeFunction · 0.70

Tested by

no test coverage detected