source:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrustumCullingTraverser.cpp
@
2795
Revision 2795, 736 bytes checked in by mattausch, 16 years ago (diff) |
---|
Rev | Line | |
---|---|---|
[2757] | 1 | #include "FrustumCullingTraverser.h" |
[2760] | 2 | #include "SceneEntity.h" |
[2757] | 3 | |
[2762] | 4 | using namespace std; |
[2760] | 5 | |
[2762] | 6 | |
[2776] | 7 | namespace CHCDemoEngine |
[2757] | 8 | { |
9 | ||
10 | FrustumCullingTraverser::FrustumCullingTraverser(): RenderTraverser() | |
11 | { | |
12 | } | |
13 | ||
14 | ||
[2767] | 15 | void FrustumCullingTraverser::Traverse() |
[2757] | 16 | { |
17 | while (!mDistanceQueue.empty()) | |
18 | { | |
19 | BvhNode *node = mDistanceQueue.top(); | |
20 | mDistanceQueue.pop(); | |
21 | ||
22 | // interesting for the visualization, so rest and set | |
23 | node->SetVisible(false); | |
24 | ||
[2763] | 25 | if (mBvh->IsWithinViewFrustum(node)) |
[2757] | 26 | { |
27 | // update node's visited flag => needed for rendering | |
28 | // so set it also here | |
29 | //node->SetLastVisited(mFrameID); | |
[2764] | 30 | node->SetVisible(true); |
[2757] | 31 | TraverseNode(node); |
32 | } | |
33 | else | |
[2763] | 34 | { |
[2764] | 35 | mStats.mNumFrustumCulledNodes ++; |
[2757] | 36 | } |
37 | } | |
38 | } | |
39 | ||
[2767] | 40 | |
[2757] | 41 | } |
Note: See TracBrowser
for help on using the repository browser.