Line | |
---|
1 | #include "FrustumCullingTraverser.h"
|
---|
2 |
|
---|
3 |
|
---|
4 | namespace CHCDemoEngine
|
---|
5 | {
|
---|
6 |
|
---|
7 | FrustumCullingTraverser::FrustumCullingTraverser(): RenderTraverser()
|
---|
8 | {
|
---|
9 | }
|
---|
10 |
|
---|
11 |
|
---|
12 | void FrustumCullingTraverser::Traverse()
|
---|
13 | {
|
---|
14 | while (!mDistanceQueue.empty())
|
---|
15 | {
|
---|
16 | BvhNode *node = mDistanceQueue.top();
|
---|
17 | mDistanceQueue.pop();
|
---|
18 |
|
---|
19 | if (0 && !IsNodeGeometryVisible(node, 10))
|
---|
20 | {
|
---|
21 | node->SetVisible(false);
|
---|
22 | continue;
|
---|
23 | }
|
---|
24 |
|
---|
25 | if (mBvh->IsWithinViewFrustum(node))
|
---|
26 | {
|
---|
27 | TraverseNode(node);
|
---|
28 | }
|
---|
29 | else
|
---|
30 | {
|
---|
31 | ++ mStats.mNumFrustumCulledNodes;
|
---|
32 | }
|
---|
33 | }
|
---|
34 | }
|
---|
35 |
|
---|
36 |
|
---|
37 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.