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

Function vm_GetNormal

vecmat/vector.cpp:226–230  ·  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

224// Returns the magnitude of the normal before it was normalized.
225// The bigger this value, the better the normal.
226float 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
233float vm_DotProduct(const vector *u, const vector *v) { return (u->x * v->x) + (u->y * v->y) + (u->z * v->z); }

Callers 11

ReadNewModelFileFunction · 0.50
BuildObjectLightmapUVsFunction · 0.50
TestObjectLightAdjacencyFunction · 0.50
DeleteVertFunction · 0.50
MoveVertFunction · 0.50
ComputeNormalFunction · 0.50
BuildBSPTreeFunction · 0.50
BuildSingleBSPTreeFunction · 0.50
DeformTerrainPointFunction · 0.50
BuildTerrainNormalsFunction · 0.50

Calls 2

vm_NormalizeVectorFunction · 0.85
vm_GetPerpFunction · 0.70

Tested by 1

TestObjectLightAdjacencyFunction · 0.40