Revision 3251,
567 bytes
checked in by mattausch, 16 years ago
(diff) |
played around with pvs. now using pvs without vfc or anything. using function that allows to skip tree at some point
|
Line | |
---|
1 | #include "FrustumCullingTraverser.h"
|
---|
2 | #include "SceneEntity.h"
|
---|
3 |
|
---|
4 |
|
---|
5 | namespace CHCDemoEngine
|
---|
6 | {
|
---|
7 |
|
---|
8 | FrustumCullingTraverser::FrustumCullingTraverser(): RenderTraverser()
|
---|
9 | {
|
---|
10 | }
|
---|
11 |
|
---|
12 |
|
---|
13 | void FrustumCullingTraverser::Traverse()
|
---|
14 | {
|
---|
15 | while (!mDistanceQueue.empty())
|
---|
16 | {
|
---|
17 | BvhNode *node = mDistanceQueue.top();
|
---|
18 | mDistanceQueue.pop();
|
---|
19 |
|
---|
20 | if (1 && !IsNodeVisible(node, 10))
|
---|
21 | {
|
---|
22 | node->SetVisible(false);
|
---|
23 | continue;
|
---|
24 | }
|
---|
25 |
|
---|
26 | if (mBvh->IsWithinViewFrustum(node))
|
---|
27 | {
|
---|
28 | TraverseNode(node);
|
---|
29 | }
|
---|
30 | else
|
---|
31 | {
|
---|
32 | ++ mStats.mNumFrustumCulledNodes;
|
---|
33 | }
|
---|
34 | }
|
---|
35 | }
|
---|
36 |
|
---|
37 |
|
---|
38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.