1 #include <iterator>
2 #include <algorithm>
3
4 vector<D3DXPLANE> PlaneOfTri(vector<Triangle> TriCon)
5 {
6 vector<D3DXPLANE> Plane;
7 D3DXPLANE pOut;
8 for(int i = 0; i < TriCon.size(); i++)
9 {
10 D3DXPlaneFromPoints(&pOut, &TriCon[i].p0, &TriCon[i].p1,&TriCon[i].p2);
11
12 vector<D3DXPLANE>::iterator iter;//遍历器
13 iter = find(Plane.begin(), Plane.end(), pOut);//全局方法find的应用
14 if(iter == Plane.end())
15 {
16 break;
17 }
18 else
19 {
20 Plane.push_back(pOut);
21 }
22 }
23 return Plane;
24 }
25
posted on 2008-03-21 13:14
天书 阅读(155)
评论(0) 编辑 收藏 引用