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

Function ClassifyVector

Descent3/bsp.cpp:264–275  ·  view source on GitHub ↗

Classifies whether or not a point is in front,behind, or on a plane

Source from the content-addressed store, hash-verified

262
263// Classifies whether or not a point is in front,behind, or on a plane
264int ClassifyVector(bspplane *plane, vector *vec) {
265 float dist;
266
267 dist = vec->x * plane->a + vec->y * plane->b + vec->z * plane->c + plane->d;
268
269 if (dist > BSP_EPSILON)
270 return BSP_IN_FRONT;
271 else if (dist < -BSP_EPSILON)
272 return BSP_BEHIND;
273
274 return BSP_ON_PLANE;
275}
276
277// Classifies whether or not a polygon is behind,in front, or straddles a plane
278int ClassifyPolygon(bspplane *plane, bsppolygon *poly) {

Callers 2

ClassifyPolygonFunction · 0.85
SplitPolygonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected