1 | /*
|
---|
2 | -----------------------------------------------------------------------------
|
---|
3 | This source file is part of the GameTools Project
|
---|
4 | http://www.gametools.org
|
---|
5 |
|
---|
6 | Author: Martin Szydlowski
|
---|
7 | -----------------------------------------------------------------------------
|
---|
8 | */
|
---|
9 |
|
---|
10 | #include "OgreKdTreeSceneManager.h"
|
---|
11 | #include "OgreKdTreeHierarchyInterface.h"
|
---|
12 |
|
---|
13 | namespace Ogre
|
---|
14 | {
|
---|
15 |
|
---|
16 | KdTreeHierarchyInterface::KdTreeHierarchyInterface(KdTreeSceneManager *sm, RenderSystem *rsys):
|
---|
17 | PlatformHierarchyInterface(sm, rsys)
|
---|
18 | {
|
---|
19 |
|
---|
20 | }
|
---|
21 |
|
---|
22 | bool KdTreeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const
|
---|
23 | {
|
---|
24 | return KDNODEPTR_CAST(node)->isLeaf();
|
---|
25 | }
|
---|
26 |
|
---|
27 | void KdTreeHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node)
|
---|
28 | {
|
---|
29 | ++ mNumTraversedNodes;
|
---|
30 |
|
---|
31 | KdTree::Node * kdnode = KDNODEPTR_CAST(node);
|
---|
32 |
|
---|
33 | // if the node is a leaf and has geometry => render it
|
---|
34 | if (kdnode->isLeaf())
|
---|
35 | {
|
---|
36 | if (!kdnode->isEmpty())
|
---|
37 | {
|
---|
38 | RenderNode(node);
|
---|
39 | }
|
---|
40 | }
|
---|
41 | else
|
---|
42 | {
|
---|
43 | KdTree::Branch * kdbranch = KDBRANCHPTR_CAST(node);
|
---|
44 | if (kdbranch->mLeft)
|
---|
45 | mDistanceQueue->push(kdbranch->mLeft);
|
---|
46 | if (kdbranch->mRight)
|
---|
47 | mDistanceQueue->push(kdbranch->mRight);
|
---|
48 | }
|
---|
49 | }
|
---|
50 |
|
---|
51 | void KdTreeHierarchyInterface::RenderNode(GtpVisibility::HierarchyNode *node)
|
---|
52 | {
|
---|
53 | /*** TODO ***/
|
---|
54 | }
|
---|
55 |
|
---|
56 | void KdTreeHierarchyInterface::PullUpVisibility(GtpVisibility::HierarchyNode *node) const
|
---|
57 | {
|
---|
58 | /*** TODO ***/
|
---|
59 | }
|
---|
60 |
|
---|
61 | float KdTreeHierarchyInterface::GetSquaredDistance(GtpVisibility::HierarchyNode *node) const
|
---|
62 | {
|
---|
63 | /*** TODO ***/
|
---|
64 | return 0.0;
|
---|
65 | }
|
---|
66 |
|
---|
67 | AxisAlignedBox * KdTreeHierarchyInterface::GetBoundingBox(GtpVisibility::HierarchyNode *node)
|
---|
68 | {
|
---|
69 | /*** TODO ***/
|
---|
70 | return new AxisAlignedBox();
|
---|
71 | }
|
---|
72 |
|
---|
73 | bool KdTreeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const
|
---|
74 | {
|
---|
75 | return KDNODEPTR_CAST(node)->hasGeometry();
|
---|
76 | }
|
---|
77 |
|
---|
78 | void KdTreeHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) const
|
---|
79 | {
|
---|
80 | /*** TODO ***/
|
---|
81 | }
|
---|
82 |
|
---|
83 | bool KdTreeHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) const
|
---|
84 | {
|
---|
85 | /*** TODO ***/
|
---|
86 | return true;
|
---|
87 | }
|
---|
88 |
|
---|
89 | void KdTreeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId) const
|
---|
90 | {
|
---|
91 | /*** TODO ***/
|
---|
92 | }
|
---|
93 |
|
---|
94 | unsigned int KdTreeHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) const
|
---|
95 | {
|
---|
96 | /*** TODO ***/
|
---|
97 | return 0;
|
---|
98 | }
|
---|
99 |
|
---|
100 | void KdTreeHierarchyInterface::VisualizeCulledNode(GtpVisibility::HierarchyNode *node,
|
---|
101 | GtpVisibility::CullingType type) const
|
---|
102 | {
|
---|
103 | /*** TODO ***/
|
---|
104 | }
|
---|
105 |
|
---|
106 | void KdTreeHierarchyInterface::GetNodeGeometryList(GtpVisibility::HierarchyNode *node,
|
---|
107 | GtpVisibility::GeometryVector *geometryList,
|
---|
108 | bool includeChildren)
|
---|
109 | {
|
---|
110 | /*** TODO ***/
|
---|
111 | }
|
---|
112 |
|
---|
113 | } // namespace Ogre |
---|