level/brush.c
/*
============
AddHullPoint

Doesn't add if duplicated
=============
*/
AddHullPoint
Doesn't add if duplicated
AddHullPoint Doesn ' t add if duplicated
int AddHullPoint (vec3_t p, int hullnum)
{
	int		i;
	vec_t	*c;
	int		x,y,z;
	for (i=0 ; i<num_hull_points ; i++)
		if (VectorCompare (p, hull_points[i]))
			return i;
	VectorCopy (p, hull_points[num_hull_points]);
	c = hull_corners[i*8];
	for (x=0 ; x<2 ; x++)
		for (y=0 ; y<2 ; y++)
			for (z=0; z<2 ; z++)
			{
				c[0] = p[0] - hullinfo.hullsizes[hullnum][x^1][0];
				c[1] = p[1] - hullinfo.hullsizes[hullnum][y^1][1];
				c[2] = p[2] - hullinfo.hullsizes[hullnum][z^1][2];
				c += 3;
			}
	if (num_hull_points == MAX_HULL_POINTS)
		Error ("AddHullPoint: MAX_HULL_POINTS");
	num_hull_points++;
	return i;
}
int AddHullPoint ( vec3_t p , int hullnum ) { int i ; vec_t * c ; int x , y , z ; for ( i = 0 ; i < num_hull_points ; i ++ ) if ( VectorCompare ( p , hull_points [ i ] ) ) return i ; VectorCopy ( p , hull_points [ num_hull_points ] ) ; c = hull_corners [ i * 8 ] ; for ( x = 0 ; x < 2 ; x ++ ) for ( y = 0 ; y < 2 ; y ++ ) for ( z = 0 ; z < 2 ; z ++ ) { c [ 0 ] = p [ 0 ] - hullinfo . hullsizes [ hullnum ] [ x ^ 1 ] [ 0 ] ; c [ 1 ] = p [ 1 ] - hullinfo . hullsizes [ hullnum ] [ y ^ 1 ] [ 1 ] ; c [ 2 ] = p [ 2 ] - hullinfo . hullsizes [ hullnum ] [ z ^ 1 ] [ 2 ] ; c += 3 ; } if ( num_hull_points == MAX_HULL_POINTS ) Error ( " " ) ; num_hull_points ++ ; return i ; }
AddHullPoint
Doesn't add if duplicated
AddHullPoint Doesn ' t add if duplicated