⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bspfilter.cpp

📁 3D游戏开发需要用到BSP树来经行场景渲染的管理。本代码包含完整的BSP及文件生成实现
💻 CPP
字号:
#include "bspconv.h"
#include "bspbrush.h"

void CBSPFilter::FilterBrushesAndMarkOpaqueNodes(_CBSPTree *tree) {
	int n = tree->brushes.GetNum();
	int nLeafs = 0;

	for(int i=0; i<n; i++) {
		nLeafs += tree->brushes[i]->FilterBrushAndMarkOpaqueNodes(tree);
	}

	g_CLog.Log(LOG_SYSTEM, "%4d leafs marked opaque.", nLeafs);
}

bool CBSPFilter::FilterFacesAndMarkLeaves(_CBSPTree *tree, bool doFilter) {
	int n = tree->faces.GetNum();
	int nFaces = 0;

	for(int i=0; i<n; i++) {

		tree->faces[i]->AddFaceRefencesToNodes(tree, doFilter);

		if(!tree->faces[i]->winding.Empty()) {
			nFaces++;
		}
	}

	g_CLog.Log(LOG_SYSTEM, "%4d faces visible.", nFaces);

	return nFaces > 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -