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

Function CheckPointToPlane

editor/Erooms.cpp:1365–1374  ·  view source on GitHub ↗

Check to see if a point is in, in front of, or behind a plane Parameters: checkpoint - the point to check planepoint,normal - the plane we're checking against Returns: 0 if on the plane, -1 if behind, 1 if in front

Source from the content-addressed store, hash-verified

1363// planepoint,normal - the plane we're checking against
1364// Returns: 0 if on the plane, -1 if behind, 1 if in front
1365int CheckPointToPlane(vector *checkpoint, vector *planepoint, vector *normal) {
1366 float d = (*checkpoint - *planepoint) * *normal;
1367
1368 if (d < -POINT_TO_PLANE_EPSILON)
1369 return -1;
1370 else if (d > POINT_TO_PLANE_EPSILON)
1371 return 1;
1372 else
1373 return 0;
1374}
1375
1376// Check to see if all the points on a face are in front of a plane
1377// Parameters: rp,facenum - the face to check

Callers 4

CheckFaceToPlaneFunction · 0.85
FindTJointsFunction · 0.85
JoinAllOverlappingFacesFunction · 0.85
FixCracksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected