[59] | 1 | #ifndef _BspHierarchyInterface_H__
|
---|
| 2 | #define _BspHierarchyInterface_H__
|
---|
| 3 |
|
---|
| 4 | #include "OgrePlatformHierarchyInterface.h"
|
---|
| 5 |
|
---|
| 6 | namespace Ogre {
|
---|
| 7 | /**
|
---|
| 8 | This class implements the hierarchy interface for the Ogre bsp hierarchy.
|
---|
| 9 | */
|
---|
| 10 | class BspHierarchyInterface : public PlatformHierarchyInterface
|
---|
| 11 | {
|
---|
| 12 | public:
|
---|
| 13 | BspHierarchyInterface(SceneManager *sm, RenderSystem *rsys);
|
---|
| 14 |
|
---|
| 15 | /** Gets the given option for the scene traverser.
|
---|
| 16 | @remarks
|
---|
| 17 | See setOption
|
---|
| 18 | */
|
---|
| 19 | //bool getOption( const String &, void * );
|
---|
| 20 | //bool getOptionKeys( StringVector &refKeys );
|
---|
| 21 | void PullUpVisibility(GtpVisibility::HierarchyNode *node);
|
---|
| 22 | /** Traverses given node.
|
---|
| 23 | @param node current node
|
---|
| 24 | @remark pushes children on distance queue
|
---|
| 25 | */
|
---|
| 26 | void TraverseNode(GtpVisibility::HierarchyNode *node);
|
---|
| 27 | void RenderNode(GtpVisibility::HierarchyNode *node);
|
---|
[74] | 28 | bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
|
---|
| 29 | bool HasGeometry(GtpVisibility::HierarchyNode *node) const;
|
---|
[59] | 30 | bool HasGreaterDistance(GtpVisibility::HierarchyNode *node1,
|
---|
[74] | 31 | GtpVisibility::HierarchyNode *node2) const;
|
---|
[59] | 32 |
|
---|
| 33 | void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible);
|
---|
[74] | 34 | void SetLastVisited(GtpVisibility::HierarchyNode *node,
|
---|
| 35 | const unsigned int frameId);
|
---|
[59] | 36 |
|
---|
[74] | 37 | bool IsNodeVisible(GtpVisibility::HierarchyNode *node) const;
|
---|
| 38 | unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const;
|
---|
[59] | 39 |
|
---|
| 40 | protected:
|
---|
| 41 | /** Returns pointer to the bounding box of the node.
|
---|
| 42 | @param node current hierarchy node
|
---|
| 43 | @returns bounding box of current node
|
---|
| 44 | */
|
---|
| 45 | AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node);
|
---|
| 46 | /** Returns squared distance of center of box with respect to the camera .
|
---|
| 47 | @param cam current camera
|
---|
| 48 | @param box axis aligned box
|
---|
| 49 | */
|
---|
| 50 | Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const;
|
---|
| 51 | unsigned int mNumOctreeNodes;
|
---|
| 52 | };
|
---|
| 53 | } // namespace Ogre
|
---|
| 54 |
|
---|
| 55 | #endif // BspHierarchyInterface_H |
---|