Line | |
---|
1 | #include "StopAndWaitTraverser.h"
|
---|
2 | #include "SceneEntity.h"
|
---|
3 |
|
---|
4 |
|
---|
5 | namespace CHCDemoEngine
|
---|
6 | {
|
---|
7 |
|
---|
8 | using namespace std;
|
---|
9 |
|
---|
10 |
|
---|
11 |
|
---|
12 | StopAndWaitTraverser::StopAndWaitTraverser()
|
---|
13 | {
|
---|
14 | }
|
---|
15 |
|
---|
16 |
|
---|
17 | void StopAndWaitTraverser::Traverse()
|
---|
18 | {
|
---|
19 | while (!mDistanceQueue.empty())
|
---|
20 | {
|
---|
21 | BvhNode *node = mDistanceQueue.top();
|
---|
22 | mDistanceQueue.pop();
|
---|
23 |
|
---|
24 | if (0 && !IsNodeGeometryVisible(node, 10))
|
---|
25 | {
|
---|
26 | node->SetVisible(false);
|
---|
27 | continue;
|
---|
28 | }
|
---|
29 |
|
---|
30 | if (mBvh->IsWithinViewFrustum(node))
|
---|
31 | {
|
---|
32 | // if intersects near plane assume visible and don't issue test
|
---|
33 | if (mBvh->IntersectsNearPlane(node))
|
---|
34 | {
|
---|
35 | TraverseNode(node);
|
---|
36 | }
|
---|
37 | else
|
---|
38 | {
|
---|
39 | OcclusionQuery *query = IssueOcclusionQuery(node);
|
---|
40 |
|
---|
41 | const bool visible = (query->GetQueryResult() > mVisibilityThreshold);
|
---|
42 |
|
---|
43 | if (visible)
|
---|
44 | {
|
---|
45 | TraverseNode(node);
|
---|
46 | }
|
---|
47 | else
|
---|
48 | {
|
---|
49 | ++ mStats.mNumQueryCulledNodes;
|
---|
50 | }
|
---|
51 | }
|
---|
52 | }
|
---|
53 | else
|
---|
54 | {
|
---|
55 | ++ mStats.mNumFrustumCulledNodes;
|
---|
56 | }
|
---|
57 | }
|
---|
58 | }
|
---|
59 |
|
---|
60 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.