亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? brush.c

?? quake3工具源碼。包括生成bsp文件
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
	}

	// split it by the node plane
	SplitBrush ( b, node->planenum, &front, &back );
	FreeBrush( b );

	c = 0;
	c += FilterBrushIntoTree_r( front, node->children[0] );
	c += FilterBrushIntoTree_r( back, node->children[1] );

	return c;
}

/*
=====================
FilterDetailBrushesIntoTree

Fragment all the detail brushes into the structural leafs
=====================
*/
void FilterDetailBrushesIntoTree( entity_t *e, tree_t *tree ) {
	bspbrush_t			*b, *newb;
	int					r;
	int					c_unique, c_clusters;
	int					i;

	qprintf( "----- FilterDetailBrushesIntoTree -----\n");

	c_unique = 0;
	c_clusters = 0;
	for ( b = e->brushes ; b ; b = b->next ) {
		if ( !b->detail ) {
			continue;
		}
		c_unique++;
		newb = CopyBrush( b );
		r = FilterBrushIntoTree_r( newb, tree->headnode );
		c_clusters += r;

		// mark all sides as visible so drawsurfs are created
		if ( r ) {
			for ( i = 0 ; i < b->numsides ; i++ ) {
				if ( b->sides[i].winding ) {
					b->sides[i].visible = qtrue;
				}
			}
		}
	}

	qprintf( "%5i detail brushes\n", c_unique );
	qprintf( "%5i cluster references\n", c_clusters );
}

/*
=====================
FilterStructuralBrushesIntoTree

Mark the leafs as opaque and areaportals
=====================
*/
void FilterStructuralBrushesIntoTree( entity_t *e, tree_t *tree ) {
	bspbrush_t			*b, *newb;
	int					r;
	int					c_unique, c_clusters;
	int					i;

	qprintf( "----- FilterStructuralBrushesIntoTree -----\n");

	c_unique = 0;
	c_clusters = 0;
	for ( b = e->brushes ; b ; b = b->next ) {
		if ( b->detail ) {
			continue;
		}
		c_unique++;
		newb = CopyBrush( b );
		r = FilterBrushIntoTree_r( newb, tree->headnode );
		c_clusters += r;

		// mark all sides as visible so drawsurfs are created
		if ( r ) {
			for ( i = 0 ; i < b->numsides ; i++ ) {
				if ( b->sides[i].winding ) {
					b->sides[i].visible = qtrue;
				}
			}
		}
	}

	qprintf( "%5i structural brushes\n", c_unique );
	qprintf( "%5i cluster references\n", c_clusters );
}



/*
================
AllocTree
================
*/
tree_t *AllocTree (void)
{
	tree_t	*tree;

	tree = malloc(sizeof(*tree));
	memset (tree, 0, sizeof(*tree));
	ClearBounds (tree->mins, tree->maxs);

	return tree;
}

/*
================
AllocNode
================
*/
node_t *AllocNode (void)
{
	node_t	*node;

	node = malloc(sizeof(*node));
	memset (node, 0, sizeof(*node));

	return node;
}


/*
================
WindingIsTiny

Returns true if the winding would be crunched out of
existance by the vertex snapping.
================
*/
#define	EDGE_LENGTH	0.2
qboolean WindingIsTiny (winding_t *w)
{
/*
	if (WindingArea (w) < 1)
		return qtrue;
	return qfalse;
*/
	int		i, j;
	vec_t	len;
	vec3_t	delta;
	int		edges;

	edges = 0;
	for (i=0 ; i<w->numpoints ; i++)
	{
		j = i == w->numpoints - 1 ? 0 : i+1;
		VectorSubtract (w->p[j], w->p[i], delta);
		len = VectorLength (delta);
		if (len > EDGE_LENGTH)
		{
			if (++edges == 3)
				return qfalse;
		}
	}
	return qtrue;
}

/*
================
WindingIsHuge

Returns true if the winding still has one of the points
from basewinding for plane
================
*/
qboolean WindingIsHuge (winding_t *w)
{
	int		i, j;

	for (i=0 ; i<w->numpoints ; i++)
	{
		for (j=0 ; j<3 ; j++)
			if (w->p[i][j] <= MIN_WORLD_COORD || w->p[i][j] >= MAX_WORLD_COORD)
				return qtrue;
	}
	return qfalse;
}

//============================================================

/*
==================
BrushMostlyOnSide

==================
*/
int BrushMostlyOnSide (bspbrush_t *brush, plane_t *plane)
{
	int			i, j;
	winding_t	*w;
	vec_t		d, max;
	int			side;

	max = 0;
	side = PSIDE_FRONT;
	for (i=0 ; i<brush->numsides ; i++)
	{
		w = brush->sides[i].winding;
		if (!w)
			continue;
		for (j=0 ; j<w->numpoints ; j++)
		{
			d = DotProduct (w->p[j], plane->normal) - plane->dist;
			if (d > max)
			{
				max = d;
				side = PSIDE_FRONT;
			}
			if (-d > max)
			{
				max = -d;
				side = PSIDE_BACK;
			}
		}
	}
	return side;
}

/*
================
SplitBrush

Generates two new brushes, leaving the original
unchanged
================
*/
void SplitBrush (bspbrush_t *brush, int planenum,
	bspbrush_t **front, bspbrush_t **back)
{
	bspbrush_t	*b[2];
	int			i, j;
	winding_t	*w, *cw[2], *midwinding;
	plane_t		*plane, *plane2;
	side_t		*s, *cs;
	float		d, d_front, d_back;

	*front = *back = NULL;
	plane = &mapplanes[planenum];

	// check all points
	d_front = d_back = 0;
	for (i=0 ; i<brush->numsides ; i++)
	{
		w = brush->sides[i].winding;
		if (!w)
			continue;
		for (j=0 ; j<w->numpoints ; j++)
		{
			d = DotProduct (w->p[j], plane->normal) - plane->dist;
			if (d > 0 && d > d_front)
				d_front = d;
			if (d < 0 && d < d_back)
				d_back = d;
		}
	}
	if (d_front < 0.1) // PLANESIDE_EPSILON)
	{	// only on back
		*back = CopyBrush (brush);
		return;
	}
	if (d_back > -0.1) // PLANESIDE_EPSILON)
	{	// only on front
		*front = CopyBrush (brush);
		return;
	}

	// create a new winding from the split plane

	w = BaseWindingForPlane (plane->normal, plane->dist);
	for (i=0 ; i<brush->numsides && w ; i++)
	{
		if ( brush->sides[i].backSide ) {
			continue;	// fake back-sided polygons never split
		}
		plane2 = &mapplanes[brush->sides[i].planenum ^ 1];
		ChopWindingInPlace (&w, plane2->normal, plane2->dist, 0); // PLANESIDE_EPSILON);
	}

	if (!w || WindingIsTiny (w) )
	{	// the brush isn't really split
		int		side;

		side = BrushMostlyOnSide (brush, plane);
		if (side == PSIDE_FRONT)
			*front = CopyBrush (brush);
		if (side == PSIDE_BACK)
			*back = CopyBrush (brush);
		return;
	}

	if (WindingIsHuge (w))
	{
		qprintf ("WARNING: huge winding\n");
	}

	midwinding = w;

	// split it for real

	for (i=0 ; i<2 ; i++)
	{
		b[i] = AllocBrush (brush->numsides+1);
		memcpy( b[i], brush, sizeof( bspbrush_t ) - sizeof( brush->sides ) );
		b[i]->numsides = 0;
		b[i]->next = NULL;
		b[i]->original = brush->original;
	}

	// split all the current windings

	for (i=0 ; i<brush->numsides ; i++)
	{
		s = &brush->sides[i];
		w = s->winding;
		if (!w)
			continue;
		ClipWindingEpsilon (w, plane->normal, plane->dist,
			0 /*PLANESIDE_EPSILON*/, &cw[0], &cw[1]);
		for (j=0 ; j<2 ; j++)
		{
			if (!cw[j])
				continue;
/*
			if (WindingIsTiny (cw[j]))
			{
				FreeWinding (cw[j]);
				continue;
			}
*/
			cs = &b[j]->sides[b[j]->numsides];
			b[j]->numsides++;
			*cs = *s;
			cs->winding = cw[j];
		}
	}


	// see if we have valid polygons on both sides

	for (i=0 ; i<2 ; i++)
	{
		BoundBrush (b[i]);
		for (j=0 ; j<3 ; j++)
		{
			if (b[i]->mins[j] < MIN_WORLD_COORD || b[i]->maxs[j] > MAX_WORLD_COORD)
			{
				qprintf ("bogus brush after clip\n");
				break;
			}
		}

		if (b[i]->numsides < 3 || j < 3)
		{
			FreeBrush (b[i]);
			b[i] = NULL;
		}
	}

	if ( !(b[0] && b[1]) )
	{
		if (!b[0] && !b[1])
			qprintf ("split removed brush\n");
		else
			qprintf ("split not on both sides\n");
		if (b[0])
		{
			FreeBrush (b[0]);
			*front = CopyBrush (brush);
		}
		if (b[1])
		{
			FreeBrush (b[1]);
			*back = CopyBrush (brush);
		}
		return;
	}

	// add the midwinding to both sides
	for (i=0 ; i<2 ; i++)
	{
		cs = &b[i]->sides[b[i]->numsides];
		b[i]->numsides++;

		cs->planenum = planenum^i^1;
		cs->shaderInfo = NULL;
		if (i==0)
			cs->winding = CopyWinding (midwinding);
		else
			cs->winding = midwinding;
	}

{
	vec_t	v1;
	int		i;

	for (i=0 ; i<2 ; i++)
	{
		v1 = BrushVolume (b[i]);
		if (v1 < 1.0)
		{
			FreeBrush (b[i]);
			b[i] = NULL;
//			qprintf ("tiny volume after clip\n");
		}
	}
}

	*front = b[0];
	*back = b[1];
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产禁国产网站cc| 国产麻豆视频一区二区| 亚洲精品乱码久久久久久黑人| 久久精品一区二区三区四区| 久久品道一品道久久精品| 日韩免费高清视频| 精品国产1区二区| 欧美videos大乳护士334| 日韩精品专区在线影院观看| 日韩小视频在线观看专区| 日韩三级av在线播放| 精品国产露脸精彩对白| 久久午夜羞羞影院免费观看| 久久久影视传媒| 国产亚洲欧美日韩在线一区| 国产精品乱码人人做人人爱| 国产精品久久久久久户外露出| 国产精品婷婷午夜在线观看| 综合久久久久综合| 夜夜嗨av一区二区三区网页| 亚洲一区二区在线播放相泽| 天天影视涩香欲综合网| 免费在线观看精品| 国产中文字幕精品| 国产成人在线视频网址| 99久久99久久精品免费看蜜桃| 99热在这里有精品免费| 在线亚洲+欧美+日本专区| 欧美日韩免费一区二区三区 | 日韩视频永久免费| 欧美精品一区二区久久久| 国产欧美一区二区三区鸳鸯浴 | 日韩亚洲欧美成人一区| 久久精品亚洲一区二区三区浴池 | 国产精品一二三四五| www.欧美色图| 欧美日韩一区二区三区四区五区| 欧美一区二区三区在线电影 | 久久综合综合久久综合| 粉嫩aⅴ一区二区三区四区| 色屁屁一区二区| 欧美一二三区精品| 国产精品女人毛片| 亚洲国产欧美在线人成| 久久66热re国产| 不卡的看片网站| 在线成人高清不卡| 国产欧美日本一区视频| 亚洲国产一区二区三区| 韩国三级在线一区| 色屁屁一区二区| 久久久精品国产免大香伊| 亚洲国产va精品久久久不卡综合| 美腿丝袜亚洲三区| 92精品国产成人观看免费| 91精品国产综合久久久久久漫画 | 99re这里只有精品6| 91精品婷婷国产综合久久性色| 中文欧美字幕免费| 日本成人在线看| 色综合久久久久综合体桃花网| 日韩一区二区三区电影在线观看| 日韩一区在线看| 极品美女销魂一区二区三区免费| 日本韩国精品在线| 国产日韩精品一区二区三区在线| 亚洲成人先锋电影| 91在线小视频| 久久免费偷拍视频| 日韩国产一区二| 日本韩国欧美一区二区三区| 国产亚洲综合在线| 蜜乳av一区二区三区| 欧美性大战久久| 自拍视频在线观看一区二区| 国产自产视频一区二区三区| 91精品麻豆日日躁夜夜躁| 一级中文字幕一区二区| 不卡的av中国片| 久久免费看少妇高潮| 青椒成人免费视频| 一本大道久久a久久精品综合| 久久亚洲精品小早川怜子| 天堂在线亚洲视频| www.99精品| 久久久久久久精| 奇米一区二区三区| 欧美色倩网站大全免费| 亚洲视频一区二区在线观看| 高清shemale亚洲人妖| 久久久久亚洲蜜桃| 老司机午夜精品99久久| 7777精品伊人久久久大香线蕉完整版| 亚洲欧美影音先锋| 99精品视频一区二区| 久久亚洲精精品中文字幕早川悠里 | 欧美午夜精品久久久久久孕妇| 国产精品午夜在线| 国产乱淫av一区二区三区 | 国产精品第四页| 国产夫妻精品视频| 久久蜜桃av一区精品变态类天堂| 奇米亚洲午夜久久精品| 欧美一区二区三区在线| 视频一区二区中文字幕| 欧美日韩一区三区| 亚洲chinese男男1069| 欧美亚洲综合在线| 亚洲人xxxx| 一本大道久久精品懂色aⅴ| 亚洲人妖av一区二区| 97精品国产露脸对白| 亚洲乱码国产乱码精品精可以看 | 国产成人鲁色资源国产91色综| 337p日本欧洲亚洲大胆精品| 国产真实乱子伦精品视频| 久久久久久久久伊人| 国产91露脸合集magnet| 国产精品国产自产拍高清av| 色婷婷综合视频在线观看| 亚洲一卡二卡三卡四卡五卡| 884aa四虎影成人精品一区| 日韩高清欧美激情| 久久综合一区二区| 国产福利91精品| 日韩一区欧美一区| 欧美综合在线视频| 日韩avvvv在线播放| 精品久久国产老人久久综合| 国产一区二区三区最好精华液| 国产午夜精品一区二区三区视频| 成人在线视频首页| 亚洲你懂的在线视频| 欧美日本乱大交xxxxx| 蜜桃av一区二区三区电影| 久久久亚洲欧洲日产国码αv| 成人综合婷婷国产精品久久蜜臀 | 亚洲欧美国产高清| 欧美丝袜自拍制服另类| 蜜臀av一区二区| 国产欧美1区2区3区| 91小视频免费观看| 三级亚洲高清视频| 久久亚洲综合色| 99精品国产99久久久久久白柏| 亚洲午夜视频在线| 精品少妇一区二区三区在线播放| 福利视频网站一区二区三区| 一区二区三区欧美激情| 欧美一级日韩不卡播放免费| 成人午夜视频免费看| 亚洲五码中文字幕| 26uuu亚洲婷婷狠狠天堂| 91亚洲大成网污www| 免费黄网站欧美| 国产欧美一区二区在线观看| 欧美午夜精品久久久| 久久97超碰国产精品超碰| 国产精品久久久久久久裸模| 欧美三区在线视频| 国产剧情一区二区三区| 亚洲欧美日韩小说| 欧美电影免费观看高清完整版| www.亚洲色图.com| 精品中文字幕一区二区| 亚洲激情一二三区| 久久久久久久精| 欧美一区二区三区播放老司机| 99精品黄色片免费大全| 国产又黄又大久久| 午夜精品视频一区| 亚洲男同1069视频| 久久久久久久电影| 日韩一区二区视频在线观看| 色猫猫国产区一区二在线视频| 国产在线国偷精品产拍免费yy| 洋洋成人永久网站入口| 国产精品污网站| 2020国产精品| 91精品国产91久久综合桃花| 91久久久免费一区二区| 成人av电影在线观看| 激情欧美一区二区| 日韩av一区二区在线影视| 一区二区三区中文字幕在线观看| 国产日韩视频一区二区三区| 日韩欧美一卡二卡| 欧美日韩一级二级| 在线观看国产一区二区| www.亚洲在线| 成人动漫中文字幕| 国产精品亚洲а∨天堂免在线| 日本vs亚洲vs韩国一区三区| 亚洲v中文字幕| 亚洲影院理伦片| 亚洲美女精品一区| 亚洲乱码日产精品bd| 亚洲欧洲制服丝袜| 国产精品第五页| 亚洲品质自拍视频网站|