| 503 | } |
| 504 | |
| 505 | int CM_FindPlane2(float plane[4], int *flipped) { |
| 506 | int i; |
| 507 | |
| 508 | // see if the points are close enough to an existing plane |
| 509 | for ( i = 0 ; i < numPlanes ; i++ ) { |
| 510 | if (CM_PlaneEqual(&planes[i], plane, flipped)) return i; |
| 511 | } |
| 512 | |
| 513 | // add a new plane |
| 514 | if ( numPlanes == MAX_PATCH_PLANES ) { |
| 515 | Com_Error( ERR_DROP, "MAX_PATCH_PLANES reached (%d)", MAX_PATCH_PLANES ); |
| 516 | } |
| 517 | |
| 518 | VectorCopy4( plane, planes[numPlanes].plane ); |
| 519 | planes[numPlanes].signbits = CM_SignbitsForNormal( plane ); |
| 520 | |
| 521 | numPlanes++; |
| 522 | |
| 523 | *flipped = qfalse; |
| 524 | |
| 525 | return numPlanes-1; |
| 526 | } |
| 527 | |
| 528 | /* |
| 529 | ================== |
no test coverage detected