1 | #ifndef _OctreeHierarchyInterface_H__
|
---|
2 | #define _OctreeHierarchyInterface_H__
|
---|
3 |
|
---|
4 | #include <OgreOctree.h>
|
---|
5 | #include <OgreOctreeSceneManager.h>
|
---|
6 | #include "OgreSceneNodeHierarchyInterface.h"
|
---|
7 |
|
---|
8 | namespace Ogre {
|
---|
9 | /**
|
---|
10 | This class implements the hierarchy interface for the Ogre octree hierarchy.
|
---|
11 | */
|
---|
12 | class OctreeHierarchyInterface : public SceneNodeHierarchyInterface
|
---|
13 | {
|
---|
14 | public:
|
---|
15 | OctreeHierarchyInterface(OctreeSceneManager *sm, RenderSystem *rsys);
|
---|
16 |
|
---|
17 | /** Sets the number of nodes in this octree
|
---|
18 | @remark do not confuse this with the OctreeNode class which is derived from SceneNode
|
---|
19 | @param num number of nodes in the octree
|
---|
20 | */
|
---|
21 | void SetNumOctreeNodes(unsigned int num);
|
---|
22 |
|
---|
23 | /** Gets the given option for the scene traverser.
|
---|
24 | @remarks
|
---|
25 | See setOption
|
---|
26 | */
|
---|
27 | void PullUpVisibility(GtpVisibility::HierarchyNode *node) const;
|
---|
28 |
|
---|
29 | /** Traverses and renders the given node.
|
---|
30 | @param node current node
|
---|
31 | @remark pushes children on a distance queue.
|
---|
32 | */
|
---|
33 | void TraverseNode(GtpVisibility::HierarchyNode *node);
|
---|
34 | /** @copydoc HierarchyInterface::RenderNode */
|
---|
35 | void RenderNode(GtpVisibility::HierarchyNode *node);
|
---|
36 | bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
|
---|
37 | bool HasGeometry(GtpVisibility::HierarchyNode *node) const;
|
---|
38 | float GetSquaredDistance(GtpVisibility::HierarchyNode *node) const;
|
---|
39 |
|
---|
40 | void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) const;
|
---|
41 | void SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId) const;
|
---|
42 |
|
---|
43 | bool IsNodeVisible(GtpVisibility::HierarchyNode *node) const;
|
---|
44 | unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const;
|
---|
45 |
|
---|
46 | void VisualizeCulledNode(GtpVisibility::HierarchyNode *node,
|
---|
47 | GtpVisibility::CullingType type) const;
|
---|
48 |
|
---|
49 | void GetNodeGeometryList(GtpVisibility::HierarchyNode *node,
|
---|
50 | GtpVisibility::GeometryVector *geometryList,
|
---|
51 | bool includeChildren);
|
---|
52 |
|
---|
53 | protected:
|
---|
54 | /** Returns pointer to the bounding box of the node.
|
---|
55 | @param node current hierarchy node
|
---|
56 | @returns bounding box of current node
|
---|
57 | */
|
---|
58 | AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node);
|
---|
59 | /** Returns squared distance of center of box with respect to the camera .
|
---|
60 | @param cam current camera
|
---|
61 | @param box axis aligned box
|
---|
62 | */
|
---|
63 | Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const;
|
---|
64 | };
|
---|
65 | } // namespace Ogre
|
---|
66 |
|
---|
67 | #endif // OctreeHierarchyInterface_H |
---|