Classifies whether or not a point is in front,behind, or on a plane
| 262 | |
| 263 | // Classifies whether or not a point is in front,behind, or on a plane |
| 264 | int 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 |
| 278 | int ClassifyPolygon(bspplane *plane, bsppolygon *poly) { |
no outgoing calls
no test coverage detected