//=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== qboolean AAS_FindHashedPlane(vec3_t normal, float dist, int *planenum) { int i, p; aas_plane_t *plane; int hash, h; hash = (int)fabs(dist) / 8; hash &= (PLANE_HASH_SIZE-1); //search the border bins as well for (i = -1; i <= 1; i++) { h = (hash+i)&(PLANE_HASH_SIZE-1); for (p = aas_hashplanes[h]; p >= 0; p = aas_planechain[p]) { plane = &aasworld.planes[p]; if (AAS_PlaneEqual(normal, dist, p)) { *planenum = p; return true; } //end if } //end for } //end for return false; } //end of the function AAS_FindHashedPlane
//=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== qboolean AAS_FindPlane( vec3_t normal, float dist, int *planenum ) { int i; for ( i = 0; i < ( *aasworld ).numplanes; i++ ) { if ( AAS_PlaneEqual( normal, dist, i ) ) { *planenum = i; return true; } //end if } //end for return false; } //end of the function AAS_FindPlane