Revision 2802,
863 bytes
checked in by mattausch, 16 years ago
(diff) |
worked on renderqueue
|
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 (mBvh->IsWithinViewFrustum(node))
|
---|
25 | {
|
---|
26 | // if intersects near plane assume visible and don't issue test
|
---|
27 | if (IntersectsNearPlane(node))
|
---|
28 | {
|
---|
29 | TraverseNode(node);
|
---|
30 | }
|
---|
31 | else
|
---|
32 | {
|
---|
33 | OcclusionQuery *query = IssueOcclusionQuery(node);
|
---|
34 |
|
---|
35 | const bool visible = query->GetQueryResult() > mVisibilityThreshold;
|
---|
36 |
|
---|
37 | if (visible)
|
---|
38 | {
|
---|
39 | TraverseNode(node);
|
---|
40 | }
|
---|
41 | else
|
---|
42 | {
|
---|
43 | ++ mStats.mNumQueryCulledNodes;
|
---|
44 | }
|
---|
45 | }
|
---|
46 | }
|
---|
47 | else
|
---|
48 | {
|
---|
49 | ++ mStats.mNumFrustumCulledNodes;
|
---|
50 | }
|
---|
51 | }
|
---|
52 | }
|
---|
53 |
|
---|
54 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.