1 | #include "HierarchyInterface.h"
|
---|
2 |
|
---|
3 | #include <windows.h>
|
---|
4 |
|
---|
5 | namespace GtpVisibility {
|
---|
6 |
|
---|
7 | //-----------------------------------------------------------------------
|
---|
8 | HierarchyInterface::HierarchyInterface():
|
---|
9 | mFrameId(0), mNumTraversedNodes(0), mNumRenderedNodes(0),
|
---|
10 | mSceneRoot(0), mCurrentTestIdx(0)
|
---|
11 | {
|
---|
12 | mDistanceQueue = new DistanceQueue(GreaterDistance<HierarchyNode *>(this));
|
---|
13 | }
|
---|
14 | //-----------------------------------------------------------------------
|
---|
15 | HierarchyInterface::~HierarchyInterface()
|
---|
16 | {
|
---|
17 | delete mDistanceQueue;
|
---|
18 | }
|
---|
19 | //-----------------------------------------------------------------------
|
---|
20 | void HierarchyInterface::SetSceneRoot(HierarchyNode *root)
|
---|
21 | {
|
---|
22 | mSceneRoot = root;
|
---|
23 | }
|
---|
24 | //-----------------------------------------------------------------------
|
---|
25 | void HierarchyInterface::InitFrame(HierarchyNode *root)
|
---|
26 | {
|
---|
27 | mFrameId ++;
|
---|
28 | mNumTraversedNodes = 0;
|
---|
29 | mNumRenderedNodes = 0;
|
---|
30 |
|
---|
31 | SetSceneRoot(root);
|
---|
32 | mDistanceQueue->push(mSceneRoot);
|
---|
33 | }
|
---|
34 | //-----------------------------------------------------------------------
|
---|
35 | unsigned int HierarchyInterface::GetFrameId() const
|
---|
36 | {
|
---|
37 | return mFrameId;
|
---|
38 | }
|
---|
39 | //-----------------------------------------------------------------------
|
---|
40 | DistanceQueue *HierarchyInterface::GetQueue()
|
---|
41 | {
|
---|
42 | return mDistanceQueue;
|
---|
43 | }
|
---|
44 | //-----------------------------------------------------------------------
|
---|
45 | bool HierarchyInterface::CheckFrustumVisible(HierarchyNode *node)
|
---|
46 | {
|
---|
47 | bool intersects = false;
|
---|
48 | return CheckFrustumVisible(node, intersects);
|
---|
49 | }
|
---|
50 | //-----------------------------------------------------------------------
|
---|
51 | HierarchyNode *HierarchyInterface::GetSceneRoot() const
|
---|
52 | {
|
---|
53 | return mSceneRoot;
|
---|
54 | }
|
---|
55 | //-----------------------------------------------------------------------
|
---|
56 | unsigned int HierarchyInterface::GetNumTraversedNodes()
|
---|
57 | {
|
---|
58 | return mNumTraversedNodes;
|
---|
59 | }
|
---|
60 | //-----------------------------------------------------------------------
|
---|
61 | unsigned int HierarchyInterface::GetNumRenderedNodes()
|
---|
62 | {
|
---|
63 | return mNumRenderedNodes;
|
---|
64 | }
|
---|
65 | } // namespace GtpVisibility
|
---|