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
| 1363 | // planepoint,normal - the plane we're checking against |
| 1364 | // Returns: 0 if on the plane, -1 if behind, 1 if in front |
| 1365 | int 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 |
no outgoing calls
no test coverage detected