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

Function vm_GetPerp

vecmat/vector.cpp:209–219  ·  view source on GitHub ↗

Calculates the perpendicular vector given three points Parms: n - the computed perp vector (filled in) v0,v1,v2 - three clockwise vertices

Source from the content-addressed store, hash-verified

207// Parms: n - the computed perp vector (filled in)
208// v0,v1,v2 - three clockwise vertices
209void 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)

Callers 9

vm_GetNormalFunction · 0.70
vm_GetCentroidFunction · 0.70
vm_GetCentroidFastFunction · 0.70
DoFacingCheckFunction · 0.50
CalculateAreaForSurfaceFunction · 0.50
CalculateAreaForElementFunction · 0.50
GetAreaForFaceFunction · 0.50
TerrainCellVisibleFunction · 0.50

Calls 2

vm_SubVectorsFunction · 0.70
vm_CrossProductFunction · 0.70

Tested by

no test coverage detected