source: trunk/VUT/GtpVisibility/src/HierarchyInterface.cpp @ 130

Revision 130, 2.4 KB checked in by mattausch, 20 years ago (diff)

added visibility queries

Line 
1#include "HierarchyInterface.h"
2
3#include <windows.h>
4
5namespace GtpVisibility {
6
7//-----------------------------------------------------------------------
8HierarchyInterface::HierarchyInterface():
9mFrameId(0), mNumTraversedNodes(0), mSceneRoot(0),
10mPreviousNode(0), mCurrentTestIdx(0), mUseOptimization(false)
11//, mIsShadowPass(false)
12{       
13        mDistanceQueue = new DistanceQueue(GreaterDistance<HierarchyNode *>(this));
14}
15//-----------------------------------------------------------------------
16HierarchyInterface::~HierarchyInterface()
17{               
18        delete mDistanceQueue;
19}
20//-----------------------------------------------------------------------
21void HierarchyInterface::SetSceneRoot(HierarchyNode *root)
22{
23        mSceneRoot = root;
24}
25//-----------------------------------------------------------------------
26void HierarchyInterface::InitFrame(HierarchyNode *root)
27{
28        ++ mFrameId;
29        mCurrentTestIdx = 0;
30        mNumTraversedNodes = 0;
31        mRenderedNodes.clear();
32
33        SetSceneRoot(root);
34        mDistanceQueue->push(mSceneRoot);
35}
36//-----------------------------------------------------------------------
37unsigned int HierarchyInterface::GetFrameId() const
38{
39        return mFrameId;
40}
41//-----------------------------------------------------------------------
42DistanceQueue *HierarchyInterface::GetQueue()
43{
44        return mDistanceQueue;
45}
46//-----------------------------------------------------------------------
47bool HierarchyInterface::CheckFrustumVisible(HierarchyNode *node)
48{
49        bool intersects = false;
50        return CheckFrustumVisible(node, intersects);
51}
52//-----------------------------------------------------------------------
53HierarchyNode *HierarchyInterface::GetSceneRoot() const
54{
55        return mSceneRoot;
56}
57//-----------------------------------------------------------------------
58unsigned int HierarchyInterface::GetNumTraversedNodes()
59{
60        return mNumTraversedNodes;
61}
62//-----------------------------------------------------------------------
63unsigned int HierarchyInterface::GetNumRenderedNodes()
64{
65        return (unsigned int)mRenderedNodes.size();
66}
67//-----------------------------------------------------------------------
68void HierarchyInterface::SetUseOptimization(bool useOptimization)
69{
70        mUseOptimization = useOptimization;
71}
72//-----------------------------------------------------------------------
73std::vector<HierarchyNode *> *HierarchyInterface::GetRenderedNodes()
74{
75        return &mRenderedNodes;
76}
77
78} // namespace GtpVisibility
Note: See TracBrowser for help on using the repository browser.