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 | #ifndef _OgreKdTreeHierarchyInterface_H_
|
---|
11 | #define _OgreKdTreeHierarchyInterface_H_
|
---|
12 |
|
---|
13 | #include "OgrePlatformHierarchyInterface.h"
|
---|
14 |
|
---|
15 | namespace Ogre
|
---|
16 | {
|
---|
17 |
|
---|
18 | class KdTreeSceneManager;
|
---|
19 |
|
---|
20 | class KdTreeHierarchyInterface : public PlatformHierarchyInterface
|
---|
21 | {
|
---|
22 | public:
|
---|
23 | KdTreeHierarchyInterface(KdTreeSceneManager *sm, RenderSystem *rsys);
|
---|
24 |
|
---|
25 | virtual ~KdTreeHierarchyInterface() {};
|
---|
26 |
|
---|
27 | /** Returns true if current node is leaf of the hierarchy.
|
---|
28 | @param node hierarchy node
|
---|
29 | @returns true if node is leaf
|
---|
30 | */
|
---|
31 | virtual bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
|
---|
32 | /** Traverses and renders the hierarchy from the given node.
|
---|
33 | @param node the hierarchy node
|
---|
34 | */
|
---|
35 | virtual void TraverseNode(GtpVisibility::HierarchyNode *node);
|
---|
36 | /** Renders the given hierarchy node.
|
---|
37 | @param node current hierarchy node to be rendered
|
---|
38 | */
|
---|
39 | virtual void RenderNode(GtpVisibility::HierarchyNode *node);
|
---|
40 | /** Pulls up the visibility from the current node recursively to the parent nodes.
|
---|
41 | @param node the current node
|
---|
42 | */
|
---|
43 | virtual void PullUpVisibility(GtpVisibility::HierarchyNode *node) const;
|
---|
44 |
|
---|
45 | /** Returns distance of the node to the view plane.
|
---|
46 | @param node the hierarchy node
|
---|
47 | */
|
---|
48 | virtual float GetSquaredDistance(GtpVisibility::HierarchyNode *node) const;
|
---|
49 | /** Returns pointer to bounding box of node.
|
---|
50 | @param node current hierarchy node
|
---|
51 | @returns bounding box of current node
|
---|
52 | */
|
---|
53 | virtual AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node);
|
---|
54 | /** Returns true if there is renderable geometry attached to this node
|
---|
55 | @param node the current node
|
---|
56 | @returns if the node has renderable geometry
|
---|
57 | */
|
---|
58 | virtual bool HasGeometry(GtpVisibility::HierarchyNode *node) const;
|
---|
59 | /** Sets the visible flag for this node.
|
---|
60 | @param node the current node
|
---|
61 | @param visible the visible flag
|
---|
62 | */
|
---|
63 | virtual void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) const;
|
---|
64 | /** Returns true if node has the visible flag set. See set
|
---|
65 | */
|
---|
66 | virtual bool IsNodeVisible(GtpVisibility::HierarchyNode *node) const;
|
---|
67 | /** Sets the last visited frame id for this node.
|
---|
68 | @param node the current node
|
---|
69 | @param frameId the current frame id
|
---|
70 | */
|
---|
71 | virtual void SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId) const;
|
---|
72 | /** Returns frame id when this node was last visited by the traverser. See set
|
---|
73 | */
|
---|
74 | virtual unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const;
|
---|
75 |
|
---|
76 |
|
---|
77 | /** Visualization of a culled node, dependent on the culling type.
|
---|
78 | @param node the hierarchy node to be visualized
|
---|
79 | @param type can be one of FRUSTUM_CULLED, QUERY_CULLED
|
---|
80 | */
|
---|
81 | virtual void VisualizeCulledNode(GtpVisibility::HierarchyNode *node,
|
---|
82 | GtpVisibility::CullingType type) const;
|
---|
83 |
|
---|
84 |
|
---|
85 | /** Returns the geometry of a given hierarchy node.
|
---|
86 | @param node the hierarchy node containing the geometry
|
---|
87 | @param geometryList geometry is returned in this list
|
---|
88 | @param includeChildren if the geometry of the children should be taken into account
|
---|
89 | */
|
---|
90 | virtual void GetNodeGeometryList(GtpVisibility::HierarchyNode *node,
|
---|
91 | GtpVisibility::GeometryVector *geometryList,
|
---|
92 | bool includeChildren);
|
---|
93 |
|
---|
94 |
|
---|
95 | };
|
---|
96 |
|
---|
97 | } // namespace Ogre
|
---|
98 |
|
---|
99 | #endif // _OgreKdTreeHierarchyInterface_H_ |
---|