MCPcopy Create free account
hub / github.com/JACoders/OpenJK / CM_FindPlane2

Function CM_FindPlane2

code/qcommon/cm_patch.cpp:505–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505int 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==================

Callers 1

CM_AddFacetBevelsFunction · 0.70

Calls 4

VectorCopy4Function · 0.85
CM_PlaneEqualFunction · 0.70
Com_ErrorFunction · 0.70
CM_SignbitsForNormalFunction · 0.70

Tested by

no test coverage detected