================== CM_PointOnPlaneSide ================== */
| 584 | ================== |
| 585 | */ |
| 586 | static int CM_PointOnPlaneSide( float *p, int planeNum ) { |
| 587 | float *plane; |
| 588 | float d; |
| 589 | |
| 590 | if ( planeNum == -1 ) { |
| 591 | return SIDE_ON; |
| 592 | } |
| 593 | plane = planes[ planeNum ].plane; |
| 594 | |
| 595 | d = DotProduct( p, plane ) - plane[3]; |
| 596 | |
| 597 | if ( d > PLANE_TRI_EPSILON ) { |
| 598 | return SIDE_FRONT; |
| 599 | } |
| 600 | |
| 601 | if ( d < -PLANE_TRI_EPSILON ) { |
| 602 | return SIDE_BACK; |
| 603 | } |
| 604 | |
| 605 | return SIDE_ON; |
| 606 | } |
| 607 | |
| 608 | |
| 609 | static int CM_GridPlane( int gridPlanes[CM_MAX_GRID_SIZE][CM_MAX_GRID_SIZE][2], int i, int j, int tri ) { |
no test coverage detected