Changeset 1320 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Timestamp:
- 09/04/06 08:56:26 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Files:
-
- 8 edited
- 6 moved
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBvHierarchy.h
r1319 r1320 11 11 #define _OgreBvHierarchy_H__ 12 12 13 #define KDNODE_CAST(a) (static_cast<KdTree::Node>(a))14 #define KDBRANCH_CAST(a) (static_cast<KdTree::Branch>(a))15 #define KDLEAF_CAST(a) (static_cast<KdTree::Leaf>(a))16 #define KDNODEPTR_CAST(a) (static_cast<KdTree::Node *>(a))17 #define KDBRANCHPTR_CAST(a) (static_cast<KdTree::Branch *>(a))18 #define KDLEAFPTR_CAST(a) (static_cast<KdTree::Leaf *>(a))19 20 #define KDTREE_LOGNAME "KdTreeBuild.log"13 #define BVHNODE_CAST(a) (static_cast<BvHierarchy::Node>(a)) 14 #define BVHBRANCH_CAST(a) (static_cast<BvHierarchy::Branch>(a)) 15 #define BVHLEAF_CAST(a) (static_cast<BvHierarchy::Leaf>(a)) 16 #define BVHNODEPTR_CAST(a) (static_cast<BvHierarchy::Node *>(a)) 17 #define BVHBRANCHPTR_CAST(a) (static_cast<BvHierarchy::Branch *>(a)) 18 #define BVHLEAFPTR_CAST(a) (static_cast<BvHierarchy::Leaf *>(a)) 19 20 #define BvHierarchy_LOGNAME "BvHierarchyBuild.log" 21 21 22 22 #include <OgreAxisAlignedBox.h> … … 31 31 #include "OgreBvHierarchyCamera.h" 32 32 #include "HierarchyInterface.h" 33 33 #include "OgreKdTree.h" 34 34 35 35 namespace Ogre 36 36 { 37 37 class BvHierarchyCamera; 38 class Bv Renderable;39 struct SplitInfo;40 41 class PlaneEvent38 class BvhRenderable; 39 struct BvhSplitInfo; 40 41 class BvhPlaneEvent 42 42 { 43 43 public: … … 63 63 }; 64 64 65 PlaneEvent(): mRenderable(0), mPosition(Vector3()), mDimension(PED_X), mType(PET_ON)65 BvhPlaneEvent(): mRenderable(0), mPosition(Vector3()), mDimension(PED_X), mType(PET_ON) 66 66 { }; 67 67 68 PlaneEvent(BvRenderable *rend, const Vector3& pos, PlaneEvent::Dimension dim,PlaneEvent::Type type):68 BvhPlaneEvent(BvhRenderable *rend, const Vector3& pos, BvhPlaneEvent::Dimension dim, BvhPlaneEvent::Type type): 69 69 mRenderable(rend), mPosition(pos), mDimension(dim), mType(type) 70 70 { }; 71 71 72 ~ PlaneEvent() {};72 ~BvhPlaneEvent() {}; 73 73 74 74 // the less operator for plane events 75 75 // first sort by position, then by dimension and finally by type 76 bool operator < (const PlaneEvent& e) const76 bool operator < (const BvhPlaneEvent& e) const 77 77 { 78 78 if(mPosition[mDimension] < e.mPosition[e.mDimension]) … … 100 100 101 101 // the equals operator for tree events 102 bool operator == (const PlaneEvent& e) const102 bool operator == (const BvhPlaneEvent& e) const 103 103 { 104 104 return (mPosition[mDimension] == e.mPosition[e.mDimension]) && … … 107 107 }; 108 108 109 bool equalsType(const PlaneEvent& e,PlaneEvent::Type t)109 bool equalsType(const BvhPlaneEvent& e, BvhPlaneEvent::Type t) 110 110 { 111 111 return (mPosition[mDimension] == e.mPosition[e.mDimension]) && … … 114 114 }; 115 115 116 void classify(const PlaneEvent& e,PlaneEvent::Side side);117 118 PlaneEvent clip(AxisAlignedBox& box,PlaneEvent::Dimension dim);116 void classify(const BvhPlaneEvent& e, BvhPlaneEvent::Side side); 117 118 BvhPlaneEvent clip(AxisAlignedBox& box, BvhPlaneEvent::Dimension dim); 119 119 120 120 Plane * getSplitPlane() const … … 125 125 } 126 126 127 Bv Renderable * getRenderable() const //??127 BvhRenderable * getRenderable() const //?? 128 128 { 129 129 return mRenderable; 130 130 }; 131 131 132 PlaneEvent::Dimension getDimension() const //??132 BvhPlaneEvent::Dimension getDimension() const //?? 133 133 { 134 134 return mDimension; … … 139 139 protected: 140 140 // event info 141 Bv Renderable * mRenderable;141 BvhRenderable * mRenderable; 142 142 Vector3 mPosition; 143 PlaneEvent::Dimension mDimension;144 PlaneEvent::Type mType;143 BvhPlaneEvent::Dimension mDimension; 144 BvhPlaneEvent::Type mType; 145 145 146 146 // ------------------------------------------------------------------------------// … … 149 149 // TODO discuss if these functions really belong here, OO & SE - wise 150 150 // pros: convenient, don't have to pass internal data to the outside 151 // cons: SplitInfo ...151 // cons: BvhSplitInfo ... 152 152 public: 153 153 // compute "global" surface area heuristic (SAH) for the plane represented by this event 154 154 // use only with priority queue build method 155 void pqSAH(Real globalSA, Real parentSA, int nLeft, int nPlane, int nRight, AxisAlignedBox& parentBox, SplitInfo& split);155 void pqSAH(Real globalSA, Real parentSA, int nLeft, int nPlane, int nRight, AxisAlignedBox& parentBox, BvhSplitInfo& split); 156 156 static Real pqSplitCost(Real p, Real pl, Real pr, int nLeft, int nRight, Real mu); 157 157 158 158 // compute the surface area heuristic (SAH) for the plane represented by this event 159 void SAH(const AxisAlignedBox& parent, int nLeft, int nPlane, int nRight, SplitInfo& split);159 void SAH(const AxisAlignedBox& parent, int nLeft, int nPlane, int nRight, BvhSplitInfo& split); 160 160 // the variables determining the cost of a branch traversal (KT) and a leaf intersection (KI) 161 161 static Real KT; … … 171 171 172 172 // Holds all the important information on a split 173 struct SplitInfo173 struct BvhSplitInfo 174 174 { 175 175 AxisAlignedBox bleft; … … 178 178 int nright; 179 179 Real cost; 180 PlaneEvent::Side side;181 PlaneEvent event;180 BvhPlaneEvent::Side side; 181 BvhPlaneEvent event; 182 182 183 183 // DEBUG … … 185 185 }; 186 186 187 typedef std::list< PlaneEvent> PlaneEventList;188 typedef std::list<Bv Renderable *> BvRenderableList;187 typedef std::list<BvhRenderable *> BvhRenderableList; 188 typedef std::list<BvhPlaneEvent> BvhPlaneEventList; 189 189 190 class KdTree190 class BvHierarchy 191 191 { 192 192 protected: … … 197 197 { 198 198 public: 199 Node( KdTree* owner, int level, AxisAlignedBox& aabb, Branch * parent):199 Node(BvHierarchy * owner, int level, AxisAlignedBox& aabb, Branch * parent): 200 200 mOwner(owner), 201 201 mLevel(level), … … 217 217 218 218 // Gets this node's parent (NULL if this is the root). 219 KdTree::Node *getParent(void) const { return mParent; };219 BvHierarchy::Node *getParent(void) const { return mParent; }; 220 220 221 221 // Gets the nodes left & right child nodes, or NULL if not present or node is leaf 222 virtual KdTree::Node *getLeftChild(void) const = 0;223 virtual KdTree::Node *getRightChild(void) const = 0;222 virtual BvHierarchy::Node *getLeftChild(void) const = 0; 223 virtual BvHierarchy::Node *getRightChild(void) const = 0; 224 224 225 225 // add contained objects to render queue … … 242 242 243 243 if (mOwner->getHiLiteLevel() == mLevel) 244 mWBB->setMaterial(" KdTree/BoxHiLite");244 mWBB->setMaterial("BvHierarchy/BoxHiLite"); 245 245 else 246 246 mWBB->setMaterial("BaseWhiteNoLighting"); … … 275 275 */ 276 276 void setLastRendered(unsigned int frameid) { mLastRendered = frameid; }; 277 /** Returns real extent of the kdtree, i.e., the merged extent of the bounding boxes.277 /** Returns real extent of the BvHierarchy, i.e., the merged extent of the bounding boxes. 278 278 */ 279 279 AxisAlignedBox _getWorldAABB(void) const { return mAABB; }; 280 /** Updates bound of the real aabb of kdtree280 /** Updates bound of the real aabb of BvHierarchy 281 281 */ 282 282 virtual void _updateBounds(bool recurse = true) = 0; … … 288 288 AxisAlignedBox mWorldAABB; 289 289 protected: 290 KdTree* mOwner;290 BvHierarchy * mOwner; 291 291 Branch * mParent; 292 292 int mLevel; … … 303 303 { 304 304 public: 305 Branch( KdTree* owner, int level, AxisAlignedBox& aabb, Branch * parent,306 Plane * splitplane, PlaneEvent::Side side):305 Branch(BvHierarchy * owner, int level, AxisAlignedBox& aabb, Branch * parent, 306 Plane * splitplane, BvhPlaneEvent::Side side): 307 307 Node(owner, level, aabb, parent), 308 308 mSplitPlane(splitplane), … … 335 335 336 336 // a branch should have at least one child 337 virtual KdTree::Node * getLeftChild() const { return mLeft; };338 virtual KdTree::Node * getRightChild() const { return mRight; };337 virtual BvHierarchy::Node * getLeftChild() const { return mLeft; }; 338 virtual BvHierarchy::Node * getRightChild() const { return mRight; }; 339 339 340 340 virtual void queueVisibleObjects(unsigned long currentFrame, … … 379 379 Node * mRight; 380 380 Plane * mSplitPlane; 381 PlaneEvent::Side mPlaneSide;381 BvhPlaneEvent::Side mPlaneSide; 382 382 protected: 383 383 std::set<Leaf *> mLeaves; … … 387 387 { 388 388 public: 389 Leaf( KdTree* owner, int level, AxisAlignedBox& aabb, Branch * parent):389 Leaf(BvHierarchy * owner, int level, AxisAlignedBox& aabb, Branch * parent): 390 390 Node(owner, level, aabb, parent) 391 391 {}; … … 397 397 398 398 // a leaf is empty when it does not posses renderables 399 virtual bool isEmpty() const { return mBv Renderables.empty(); }399 virtual bool isEmpty() const { return mBvhRenderables.empty(); } 400 400 401 401 // a leaf has geometry when it has renderables 402 virtual bool hasGeometry() const { return !mBv Renderables.empty(); }402 virtual bool hasGeometry() const { return !mBvhRenderables.empty(); } 403 403 404 404 // a leaf adds itself to the leaf set … … 406 406 407 407 // a leaf never has children 408 virtual KdTree::Node * getLeftChild() const { return 0; };409 virtual KdTree::Node * getRightChild() const { return 0; };408 virtual BvHierarchy::Node * getLeftChild() const { return 0; }; 409 virtual BvHierarchy::Node * getRightChild() const { return 0; }; 410 410 411 411 virtual void queueVisibleObjects(unsigned long currentFrame, … … 417 417 virtual void _updateBounds(bool recurse = true); 418 418 419 virtual void remove(Bv Renderable * rend)420 { 421 mBv Renderables.remove(rend);422 //mBv Renderables.erase(find(mBvRenderables.begin(), mBvRenderables.end(), rend));419 virtual void remove(BvhRenderable * rend) 420 { 421 mBvhRenderables.remove(rend); 422 //mBvhRenderables.erase(find(mBvhRenderables.begin(), mBvhRenderables.end(), rend)); 423 423 }; 424 424 425 virtual void insert(Bv Renderable * rend)426 { 427 mBv Renderables.push_back(rend);425 virtual void insert(BvhRenderable * rend) 426 { 427 mBvhRenderables.push_back(rend); 428 428 }; 429 429 430 Bv RenderableList mBvRenderables;431 }; 432 433 struct SplitCandidate434 { 435 SplitCandidate(PlaneEventList * e, int n, AxisAlignedBox& a,436 KdTree::Branch * p, Real c, Real d, SplitInfo * b,PlaneEvent::Side s):430 BvhRenderableList mBvhRenderables; 431 }; 432 433 struct BvhSubdivisionCandidate 434 { 435 BvhSubdivisionCandidate(BvhPlaneEventList * e, int n, AxisAlignedBox& a, 436 BvHierarchy::Branch * p, Real c, Real d, BvhSplitInfo * b, BvhPlaneEvent::Side s): 437 437 events(e), nObjects(n), aabb(a), parent(p), cost(c), decrease(d), best(b), side(s) 438 438 { }; 439 439 440 bool operator < (const SplitCandidate& rhs) const440 bool operator < (const BvhSubdivisionCandidate& rhs) const 441 441 { 442 442 return decrease < rhs.decrease; 443 443 }; 444 444 445 void operator = (const SplitCandidate& rhs)445 void operator = (const BvhSubdivisionCandidate& rhs) 446 446 { 447 447 decrease = rhs.decrease; … … 461 461 Real cost; 462 462 int nObjects; 463 PlaneEvent::Side side;463 BvhPlaneEvent::Side side; 464 464 AxisAlignedBox aabb; 465 PlaneEventList *events;466 KdTree::Branch * parent;467 SplitInfo * best;468 }; 469 470 // typedef std::stack< SplitCandidate> SplitCandidatePQ;471 typedef std::priority_queue< SplitCandidate> SplitCandidatePQ;465 BvhPlaneEventList *events; 466 BvHierarchy::Branch * parent; 467 BvhSplitInfo * best; 468 }; 469 470 // typedef std::stack<BvhSubdivisionCandidate> SplitCandidatePQ; 471 typedef std::priority_queue<BvhSubdivisionCandidate> SplitCandidatePQ; 472 472 473 473 // nodestack for the stack-based rendering function 474 typedef std::stack< KdTree::Node *> NodeStack;474 typedef std::stack<BvHierarchy::Node *> NodeStack; 475 475 public: 476 friend class KdTreeHierarchyInterface;477 478 typedef KdTree::Node * NodePtr;479 typedef KdTree::Branch * BranchPtr;480 typedef KdTree::Leaf * LeafPtr;476 friend class BvHierarchyInterface; 477 478 typedef BvHierarchy::Node * NodePtr; 479 typedef BvHierarchy::Branch * BranchPtr; 480 typedef BvHierarchy::Leaf * LeafPtr; 481 481 482 482 typedef std::list<NodePtr> NodeList; … … 513 513 enum RenderMethod 514 514 { 515 KDRM_INTERNAL,516 KDRM_GTP_VFC,517 KDRM_GTP_SWC,518 KDRM_GTP_CHC,515 BVHRM_INTERNAL, 516 BVHRM_GTP_VFC, 517 BVHRM_GTP_SWC, 518 BVHRM_GTP_CHC, 519 519 // invalid modes, just for convenience 520 KDRM_SIZE,521 KDRM_NOTSET520 BVHRM_SIZE, 521 BVHRM_NOTSET 522 522 }; 523 523 524 524 enum BuildMethod 525 525 { 526 KDBM_RECURSIVE,527 KDBM_PRIORITYQUEUE,526 BVHBM_RECURSIVE, 527 BVHBM_PRIORITYQUEUE, 528 528 // invalid modes, just for convenience 529 KDBM_SIZE,530 KDBM_NOTSET529 BVHBM_SIZE, 530 BVHBM_NOTSET 531 531 }; 532 532 … … 534 534 const static int HILITE_OFF = -1; 535 535 536 KdTree(int maxdepth, BuildMethod bm);537 KdTree(int maxdepth, BuildMethod bm, int hilite, bool allboxes, bool shownodes);538 virtual ~ KdTree();536 BvHierarchy(int maxdepth, BuildMethod bm); 537 BvHierarchy(int maxdepth, BuildMethod bm, int hilite, bool allboxes, bool shownodes); 538 virtual ~BvHierarchy(); 539 539 540 540 // DEBUG … … 546 546 inline int getHiLiteLevel(void) { return mHiLiteLevel; }; 547 547 548 // toggles displaying the kdtreeboxes548 // toggles displaying the BvHierarchy boxes 549 549 inline void setShowAllBoxes(bool show) { mShowAllBoxes = show; }; 550 550 inline bool getShowAllBoxes(void) { return mShowAllBoxes; }; … … 559 559 bool getEnhancedVis(void); 560 560 561 NodePtr getRoot(void) const { return m KdRoot; };562 563 // insert a new scene node into an existing kd-tree564 void insert(Bv Renderable * rend);561 NodePtr getRoot(void) const { return mBvhRoot; }; 562 563 // insert a new scene node into an existing bvhierarchy 564 void insert(BvhRenderable * rend); 565 565 // remove a scene node from the tree 566 void remove(Bv Renderable * rend);566 void remove(BvhRenderable * rend); 567 567 // function to initialize a kd-tree based on the contents of the scene 568 void build(Bv Renderable * sceneRoot);568 void build(BvhRenderable * sceneRoot); 569 569 570 570 // test visibility of objects and add to render queue 571 571 void queueVisibleObjects(BvHierarchyCamera* cam, RenderQueue* queue, bool onlyShadowCasters, 572 bool showBoxes, KdTree::NodeList& visibleNodes);572 bool showBoxes, BvHierarchy::NodeList& visibleNodes); 573 573 574 574 // find visible nodes & place in list 575 575 //void findVisibleNodes(NodeList& visibleNodes, Camera * cam); 576 576 577 /** Recurses the kdtree, adding any nodes intersecting with the577 /** Recurses the BvHierarchy, adding any nodes intersecting with the 578 578 box/sphere/volume/ray into the given list. 579 579 It ignores the exclude scene node. … … 588 588 const TreeStats& getTreeStats(void) const { return mTreeStats; } 589 589 const FrameStats& getFramesStats(void) const { return mFrameStats; } 590 AxisAlignedBox getBox(void) { if (m KdRoot) return mKdRoot->mAABB; else return AxisAlignedBox(); }590 AxisAlignedBox getBox(void) { if (mBvhRoot) return mBvhRoot->mAABB; else return AxisAlignedBox(); } 591 591 void setBuildMethod(BuildMethod bm) { mBuildMethod = bm; } 592 592 protected: … … 594 594 void init(); 595 595 // recursive insert funciton 596 void recInsert( KdTree::Node * node, BvRenderable * rend);596 void recInsert(BvHierarchy::Node * node, BvhRenderable * rend); 597 597 // helper functions for insert 598 void recInsertNew( KdTree::Branch * parent, PlaneEvent::Side side, BvRenderable * rend);599 void splitBox(const KdTree::Branch& parent, AxisAlignedBox& left, AxisAlignedBox& right);600 void rebuildSubtree( KdTree::Node * node, BvRenderable * rend);598 void recInsertNew(BvHierarchy::Branch * parent, BvhPlaneEvent::Side side, BvhRenderable * rend); 599 void splitBox(const BvHierarchy::Branch& parent, AxisAlignedBox& left, AxisAlignedBox& right); 600 void rebuildSubtree(BvHierarchy::Node * node, BvhRenderable * rend); 601 601 // build scene from a list of nodes rather than a hierarchy 602 KdTree::Node * buildFromList(BvRenderableList& nodelist, KdTree::Branch * parent, AxisAlignedBox& aabb);603 void addRendToList( KdTree::Node * node, BvRenderableList& nodelist);602 BvHierarchy::Node * buildFromList(BvhRenderableList& nodelist, BvHierarchy::Branch * parent, AxisAlignedBox& aabb); 603 void addRendToList(BvHierarchy::Node * node, BvhRenderableList& nodelist); 604 604 605 605 // recursively delete empty nodes 606 void recDelete( KdTree::Node * node);606 void recDelete(BvHierarchy::Node * node); 607 607 608 608 // find the best plane for node division 609 SplitInfo * pqFindPlane(PlaneEventList * events, int nObjects, AxisAlignedBox& aabb, Real globalSA);609 BvhSplitInfo * pqFindPlane(BvhPlaneEventList * events, int nObjects, AxisAlignedBox& aabb, Real globalSA); 610 610 611 611 // priority queue based build function 612 KdTree::Node * pqBuild(PlaneEventList& events, int nObjects, AxisAlignedBox& aabb, KdTree::Branch * parent);612 BvHierarchy::Node * pqBuild(BvhPlaneEventList& events, int nObjects, AxisAlignedBox& aabb, BvHierarchy::Branch * parent); 613 613 // recursive build function 614 KdTree::Node * recBuild(PlaneEventList& events, int nObjects, AxisAlignedBox& aabb, KdTree::Branch * parent);614 BvHierarchy::Node * recBuild(BvhPlaneEventList& events, int nObjects, AxisAlignedBox& aabb, BvHierarchy::Branch * parent); 615 615 616 616 // recursive rendering function 617 void recQueueVisibleObjects( KdTree::Node * node, unsigned long currentFrame, BvHierarchyCamera* cam,617 void recQueueVisibleObjects(BvHierarchy::Node * node, unsigned long currentFrame, BvHierarchyCamera* cam, 618 618 RenderQueue* queue, bool onlyShadowCasters, bool showBoxes, 619 KdTree::NodeList& visibleNodes, bool fullVis = false);619 BvHierarchy::NodeList& visibleNodes, bool fullVis = false); 620 620 621 621 // recursively find visible nodes 622 //void recFindVisibleNodes( KdTree::Node * node, NodeList& visibleNodes, Camera * cam);623 624 /** Recurses the kdtree, adding any nodes intersecting with the622 //void recFindVisibleNodes(BvHierarchy::Node * node, NodeList& visibleNodes, Camera * cam); 623 624 /** Recurses the BvHierarchy, adding any nodes intersecting with the 625 625 box/sphere/volume/ray into the given list. 626 626 It ignores the exclude scene node. … … 631 631 void recFindNodesIn(const Ray &ray, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full = false); 632 632 633 // the root node of the kdtree634 KdTree::Node * mKdRoot;633 // the root node of the BvHierarchy 634 BvHierarchy::Node * mBvhRoot; 635 635 // Maximum depth of the tree 636 636 int mMaxDepth; … … 649 649 650 650 /** Visualization flags **/ 651 // show/highlight selected level in kdtree651 // show/highlight selected level in BvHierarchy 652 652 int mHiLiteLevel; 653 653 // show whole kd-tree … … 662 662 663 663 // DEBUG 664 void KdTree::dump(KdTree::Node * node);665 Real KdTree::calcCost(KdTree::Node * node, Real vs);666 }; // class KdTree664 void BvHierarchy::dump(BvHierarchy::Node * node); 665 Real BvHierarchy::calcCost(BvHierarchy::Node * node, Real vs); 666 }; // class BvHierarchy 667 667 668 668 } // namespace Ogre -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBvHierarchyCamera.h
r1319 r1320 13 13 #include <OgreCamera.h> 14 14 15 #define KDCAMPTR_CAST(cam) (static_cast<BvHierarchyCamera *>(cam))15 #define BVHCAMPTR_CAST(cam) (static_cast<BvHierarchyCamera *>(cam)) 16 16 17 17 namespace Ogre … … 23 23 enum NodeVisibility 24 24 { 25 KDNV_NONE,26 KDNV_PART,27 KDNV_FULL25 BVHNV_NONE, 26 BVHNV_PART, 27 BVHNV_FULL 28 28 }; 29 29 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBvHierarchyInterface.h
r1319 r1320 16 16 { 17 17 18 class KdTreeSceneManager;18 class BvHierarchySceneManager; 19 19 20 class KdTreeHierarchyInterface : public PlatformHierarchyInterface20 class BvHierarchyInterface : public PlatformHierarchyInterface 21 21 { 22 22 public: 23 KdTreeHierarchyInterface(KdTreeSceneManager *sm, RenderSystem *rsys);23 BvHierarchyInterface(BvHierarchySceneManager *sm, RenderSystem *rsys); 24 24 25 virtual ~ KdTreeHierarchyInterface() {};25 virtual ~BvHierarchyInterface() {}; 26 26 27 27 /** Returns true if current node is leaf of the hierarchy. -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBvHierarchySceneManager.h
r1319 r1320 8 8 */ 9 9 10 #ifndef _ KdTreeSceneManager_H__11 #define _ KdTreeSceneManager_H__10 #ifndef _BvHierarchySceneManager_H__ 11 #define _BvHierarchySceneManager_H__ 12 12 13 13 #include <OgreSceneManager.h> … … 19 19 #include "OgreBvHierarchyInterface.h" 20 20 21 #define KDTREE_MAX_DEPTH 1221 #define BvHierarchy_MAX_DEPTH 12 22 22 23 23 namespace Ogre 24 24 { 25 25 26 class KdTreeSceneNode;27 28 class KdTreeSceneManager : public SceneManager26 class BvHierarchySceneNode; 27 28 class BvHierarchySceneManager : public SceneManager 29 29 { 30 30 public: 31 KdTreeSceneManager(const String& name, GtpVisibility::VisibilityManager *vm);32 ~ KdTreeSceneManager(void);31 BvHierarchySceneManager(const String& name, GtpVisibility::VisibilityManager *vm); 32 ~BvHierarchySceneManager(void); 33 33 34 34 virtual const String& getTypeName(void) const; 35 35 36 //typedef std::list< KdTreeSceneNode *> NodeList;36 //typedef std::list<BvHierarchySceneNode *> NodeList; 37 37 //typedef std::list<WireBoundingBox *> BoxList; 38 38 39 39 /************************************************************************/ 40 /* Functions overridden form SceneManager for KdTree*/40 /* Functions overridden form SceneManager for BvHierarchy */ 41 41 /************************************************************************/ 42 42 … … 45 45 virtual Camera* createCamera(const String& name); 46 46 47 /** Override from SceneManager to create SceneNodes as instance of KdTreeSceneNode47 /** Override from SceneManager to create SceneNodes as instance of BvHierarchySceneNode 48 48 */ 49 49 virtual SceneNode* createSceneNode(void); 50 /** Override from SceneManager to create SceneNodes as instance of KdTreeSceneNode50 /** Override from SceneManager to create SceneNodes as instance of BvHierarchySceneNode 51 51 */ 52 52 virtual SceneNode* createSceneNode(const String& name); … … 62 62 bool getOptionKeys(StringVector &refKeys); 63 63 64 /** Overide from scene manager to destroy kdtreeproperly (before the scene graph is destroyed)64 /** Overide from scene manager to destroy BvHierarchy properly (before the scene graph is destroyed) 65 65 */ 66 66 virtual void clearScene(); … … 110 110 111 111 /************************************************************************/ 112 /* Functions which are specific to the KdTree*/112 /* Functions which are specific to the BvHierarchy */ 113 113 /************************************************************************/ 114 114 115 /** Update the KdTreewith the node (more or less disabled now)116 */ 117 virtual void _updateNode( KdTreeSceneNode *node); // TODO:118 119 /** Show or hide the bounding boxes of KdTreenodes - obsolete, use options115 /** Update the BvHierarchy with the node (more or less disabled now) 116 */ 117 virtual void _updateNode(BvHierarchySceneNode *node); // TODO: 118 119 /** Show or hide the bounding boxes of BvHierarchy nodes - obsolete, use options 120 120 */ 121 121 virtual void setShowBoxes(bool showboxes); … … 124 124 virtual bool getShowBoxes(void) const; 125 125 126 /** Recurses the kdtree, adding any nodes intersecting with the126 /** Recurses the BvHierarchy, adding any nodes intersecting with the 127 127 box/sphere/volume/ray into the given list. 128 128 It ignores the exclude scene node. … … 162 162 /** Render a list of scenenodes 163 163 */ 164 //virtual void _renderNodes(const Bv RenderableList& nodelist, Camera * cam,164 //virtual void _renderNodes(const BvhRenderableList& nodelist, Camera * cam, 165 165 // bool onlyShadowCasters, int leavePassesInQueue); 166 virtual void _renderNode( KdTree::NodePtr node, Camera * cam,166 virtual void _renderNode(BvHierarchy::NodePtr node, Camera * cam, 167 167 bool onlyShadowCasters, int leavePassesInQueue); 168 168 … … 181 181 /** Returns hierarchy interface. 182 182 */ 183 KdTreeHierarchyInterface *GetHierarchyInterface();183 BvHierarchyInterface *GetHierarchyInterface(); 184 184 185 185 protected: … … 223 223 224 224 // the hierarchy interface for CHC 225 KdTreeHierarchyInterface *mHierarchyInterface;225 BvHierarchyInterface *mHierarchyInterface; 226 226 227 227 // if hierarchical culling is currently in use … … 273 273 274 274 // remember visited scene nodes for viz 275 KdTree::NodeList mVisibleNodes;275 BvHierarchy::NodeList mVisibleNodes; 276 276 277 277 /************************************************************************/ 278 278 /* Kd-Tree specific options & members */ 279 279 /************************************************************************/ 280 // maximum depth of the kdtree280 // maximum depth of the BvHierarchy 281 281 int mMaxDepth; 282 282 283 // the kdtreewhich holds the scene284 KdTree*mBvHierarchy;285 286 // if bounding boxes of kdtreenodes are shown283 // the BvHierarchy which holds the scene 284 BvHierarchy *mBvHierarchy; 285 286 // if bounding boxes of BvHierarchy nodes are shown 287 287 bool mShowBoxes; 288 288 // bounding boxes of kd nodes will be highlighted on this level of the kd tree … … 290 290 // if all bounding boxes shall be displayed, not only the highlighted level 291 291 bool mShowAllBoxes; 292 // visualize kdtreenodes or bounding boxes of objects in nodes292 // visualize BvHierarchy nodes or bounding boxes of objects in nodes 293 293 bool mShowNodes; 294 294 … … 297 297 298 298 // the method/algorithm used when rendering the scene 299 KdTree::RenderMethod mRenderMethod;299 BvHierarchy::RenderMethod mRenderMethod; 300 300 301 301 // the method of building the tree 302 KdTree::BuildMethod mBuildMethod;302 BvHierarchy::BuildMethod mBuildMethod; 303 303 304 304 /************************************************************************/ … … 327 327 328 328 329 /// Factory for KdTreeSceneManager330 class BvHierarchySceneManagerFactory 329 /// Factory for BvHierarchySceneManager 330 class BvHierarchySceneManagerFactory: public SceneManagerFactory 331 331 { 332 332 protected: … … 337 337 { 338 338 visManager = vm; 339 } ;339 } 340 340 ~BvHierarchySceneManagerFactory(void) {}; 341 341 /// Factory type name … … 347 347 } // namespace Ogre 348 348 349 #endif // _ KdTreeSceneManager_H__349 #endif // _BvHierarchySceneManager_H__ -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBvHierarchySceneNode.h
r1319 r1320 12 12 13 13 #include <OgreSceneNode.h> 14 #include "OgreBv Renderable.h"14 #include "OgreBvhRenderable.h" 15 15 16 16 namespace Ogre 17 17 { 18 18 19 class KdTreeSceneNode : public SceneNode, public BvRenderable19 class BvHierarchySceneNode : public SceneNode, public BvhRenderable 20 20 { 21 21 public: 22 KdTreeSceneNode(SceneManager *creator):22 BvHierarchySceneNode(SceneManager *creator): 23 23 SceneNode(creator) {}; 24 24 25 KdTreeSceneNode(SceneManager *creator, const String& name):25 BvHierarchySceneNode(SceneManager *creator, const String& name): 26 26 SceneNode(creator, name) {}; 27 27 28 ~ KdTreeSceneNode() {};28 ~BvHierarchySceneNode() {}; 29 29 30 30 // gather info for kd-tree creation 31 virtual void computeScene( PlaneEventList& events, AxisAlignedBox& aabb, int& nObjects, bool includeChildren = true);31 virtual void computeScene(BvhPlaneEventList& events, AxisAlignedBox& aabb, int& nObjects, bool includeChildren = true); 32 32 33 33 // add all contained objects to render queue -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBvhRenderable.h
r1319 r1320 8 8 */ 9 9 10 #ifndef _OgreBv Renderable_H__11 #define _OgreBv Renderable_H__10 #ifndef _OgreBvhRenderable_H__ 11 #define _OgreBvhRenderable_H__ 12 12 13 13 #include "OgreBvHierarchy.h" … … 18 18 // interface which must be implemented by all objects which desire to be 19 19 // placed in the kd-tree 20 class Bv Renderable20 class BvhRenderable 21 21 { 22 22 public: 23 Bv Renderable():mSide(PlaneEvent::PES_BOTH), mClassified(false), mLastQueued(0), mBvHierarchy(0) {};24 virtual ~Bv Renderable()23 BvhRenderable():mSide(BvhPlaneEvent::PES_BOTH), mClassified(false), mLastQueued(0), mBvHierarchy(0) {}; 24 virtual ~BvhRenderable() 25 25 { 26 26 if (mBvHierarchy) … … 29 29 30 30 // gather the information required for the creation of the kd-tree 31 virtual void computeScene( PlaneEventList& events, AxisAlignedBox& aabb, int& nObjects, bool includeChildren = true) = 0;31 virtual void computeScene(BvhPlaneEventList& events, AxisAlignedBox& aabb, int& nObjects, bool includeChildren = true) = 0; 32 32 33 33 // put all objects this element holds in the renedering queue … … 50 50 }; 51 51 52 inline PlaneEvent::Side getSide()52 inline BvhPlaneEvent::Side getSide() 53 53 { 54 54 return mSide; 55 55 }; 56 inline void setSide( PlaneEvent::Side s)56 inline void setSide(BvhPlaneEvent::Side s) 57 57 { 58 58 mSide = s; … … 65 65 }; 66 66 // the following functions should work in O(log N) 67 inline bool isAttached( KdTree::LeafPtr leaf)67 inline bool isAttached(BvHierarchy::LeafPtr leaf) 68 68 { 69 69 return mLeaves.find(leaf) != mLeaves.end(); 70 70 }; 71 inline bool attachTo( KdTree::LeafPtr leaf, KdTree * kdTree)71 inline bool attachTo(BvHierarchy::LeafPtr leaf, BvHierarchy * BvHierarchy) 72 72 { 73 if (mBvHierarchy == 0 || mBvHierarchy == kdTree)74 mBvHierarchy = kdTree;73 if (mBvHierarchy == 0 || mBvHierarchy == BvHierarchy) 74 mBvHierarchy = BvHierarchy; 75 75 else 76 76 return false; 77 77 78 KdTree::LeafSet::_Pairib p = mLeaves.insert(leaf);78 BvHierarchy::LeafSet::_Pairib p = mLeaves.insert(leaf); 79 79 return p.second; 80 80 }; 81 inline bool detachFrom( KdTree::LeafPtr leaf)81 inline bool detachFrom(BvHierarchy::LeafPtr leaf) 82 82 { 83 83 bool success = (mLeaves.erase(leaf) == 1); … … 102 102 }; 103 103 104 KdTree::LeafSet& getLeaves()104 BvHierarchy::LeafSet& getLeaves() 105 105 { 106 106 return mLeaves; … … 113 113 Camera * mLastCam; 114 114 115 // kdtreeto which this renderable is attached116 KdTree* mBvHierarchy;117 // kdtreeleaves which overlap this renderable118 KdTree::LeafSet mLeaves;115 // BvHierarchy to which this renderable is attached 116 BvHierarchy * mBvHierarchy; 117 // BvHierarchy leaves which overlap this renderable 118 BvHierarchy::LeafSet mLeaves; 119 119 120 120 // Flag for the SAH determining the "cheaper" side of the split plane 121 PlaneEvent::Side mSide;121 BvhPlaneEvent::Side mSide; 122 122 // Flag for the SAH which marks if this renderable was already placed in the list after a split 123 123 bool mClassified; 124 }; // class Bv Renderable124 }; // class BvhRenderable 125 125 126 126 } // namespace Ogre 127 127 128 #endif // _OgreBv Renderable_H__128 #endif // _OgreBvhRenderable_H__ -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchy.cpp
r1319 r1320 9 9 10 10 #include "OgreBvHierarchy.h" 11 #include "OgreBv Renderable.h"11 #include "OgreBvhRenderable.h" 12 12 #include "OgreBvHierarchySceneNode.h" 13 13 #include "OgreBvHierarchySceneManager.h" … … 25 25 { 26 26 27 enum Intersection27 enum BvhIntersection 28 28 { 29 29 OUTSIDE=0, … … 32 32 }; 33 33 34 Intersection intersect( const Ray &one, const AxisAlignedBox &two )34 static BvhIntersection intersect( const Ray &one, const AxisAlignedBox &two ) 35 35 { 36 36 // Null box? … … 99 99 /** Checks how the second box intersects with the first. 100 100 */ 101 Intersection intersect( const PlaneBoundedVolume &one, const AxisAlignedBox &two )101 static BvhIntersection intersect( const PlaneBoundedVolume &one, const AxisAlignedBox &two ) 102 102 { 103 103 // Null box? … … 146 146 /** Checks how the second box intersects with the first. 147 147 */ 148 Intersection intersect( const AxisAlignedBox &one, const AxisAlignedBox &two )148 static BvhIntersection intersect( const AxisAlignedBox &one, const AxisAlignedBox &two ) 149 149 { 150 150 // Null box? … … 180 180 /** Checks how the box intersects with the sphere. 181 181 */ 182 Intersection intersect( const Sphere &one, const AxisAlignedBox &two )182 static BvhIntersection intersect( const Sphere &one, const AxisAlignedBox &two ) 183 183 { 184 184 // Null box? … … 235 235 } 236 236 237 Real PlaneEvent::KT = 2.0;238 Real PlaneEvent::KI = 1.0;237 Real BvhPlaneEvent::KT = 2.0; 238 Real BvhPlaneEvent::KI = 1.0; 239 239 240 240 //---------------------------------------------------------------------------- 241 241 // determine if this event is left or right of the reference event 242 void PlaneEvent::classify(const PlaneEvent& e,PlaneEvent::Side side)242 void BvhPlaneEvent::classify(const BvhPlaneEvent& e, BvhPlaneEvent::Side side) 243 243 { 244 244 // only classify events of the same dimension … … 271 271 //---------------------------------------------------------------------------- 272 272 // clip this event to an aabb (move it so that the plane on one of the box planes) 273 PlaneEvent PlaneEvent::clip(AxisAlignedBox& box,PlaneEvent::Dimension dim)273 BvhPlaneEvent BvhPlaneEvent::clip(AxisAlignedBox& box, BvhPlaneEvent::Dimension dim) 274 274 { 275 275 Vector3 newpos = mPosition, min = box.getMinimum(), max = box.getMaximum(); … … 279 279 newpos[dim] = max[dim]; 280 280 281 return PlaneEvent(mRenderable, newpos, mDimension, mType);281 return BvhPlaneEvent(mRenderable, newpos, mDimension, mType); 282 282 } 283 283 … … 285 285 // the surface area heuristic to determine the cost of splitting the parent aabb 286 286 // along the plane represented by this event 287 void PlaneEvent::SAH(const AxisAlignedBox& parent, int nLeft, int nPlane, int nRight,SplitInfo& split)287 void BvhPlaneEvent::SAH(const AxisAlignedBox& parent, int nLeft, int nPlane, int nRight, BvhSplitInfo& split) 288 288 { 289 289 Real mu = splitBox(parent, split.bleft, split.bright); … … 314 314 //---------------------------------------------------------------------------- 315 315 // split the parent aabb with the plane in this event 316 Real PlaneEvent::splitBox(const AxisAlignedBox& parent, AxisAlignedBox& left, AxisAlignedBox& right)316 Real BvhPlaneEvent::splitBox(const AxisAlignedBox& parent, AxisAlignedBox& left, AxisAlignedBox& right) 317 317 { 318 318 Vector3 bmin = parent.getMinimum(); … … 337 337 //---------------------------------------------------------------------------- 338 338 // compute surface area of a box ... DUH! 339 Real PlaneEvent::surfaceArea(const AxisAlignedBox& box)339 Real BvhPlaneEvent::surfaceArea(const AxisAlignedBox& box) 340 340 { 341 341 Vector3 sides = box.getMaximum() - box.getMinimum(); … … 348 348 // lookup the penalty for placing the splitting plane near to the edge of the AABB 349 349 // 0.0 <= p <= 1.0, p = 0.5 means the plane divides the aabb in half 350 Real PlaneEvent::lookupPenalty(Real p)350 Real BvhPlaneEvent::lookupPenalty(Real p) 351 351 { 352 352 // precomputed table of {x^6 + 1|0 <= x <= 1} … … 380 380 // compute cost of the split, reward splitting of empty space (lambda, const), 381 381 // penalize splitting off 'thin' slices (mu, const) 382 Real PlaneEvent::splitCost(Real pLeft, Real pRight, int nLeft, int nRight)382 Real BvhPlaneEvent::splitCost(Real pLeft, Real pRight, int nLeft, int nRight) 383 383 { 384 384 // reward splitting off chunks of empty space … … 401 401 // compute cost of the split, reward splitting of empty space (lambda, const), 402 402 // penalize splitting off 'thin' slices (mu, parameter) 403 Real PlaneEvent::splitCost(Real pLeft, Real pRight, int nLeft, int nRight, Real mu)403 Real BvhPlaneEvent::splitCost(Real pLeft, Real pRight, int nLeft, int nRight, Real mu) 404 404 { 405 405 // reward splitting off chunks of empty space … … 416 416 // surface area heuristic modified for the priority queue method of building 417 417 // the probabilities (p, pl, pr) are relative to the global (all enclosing) aabb 418 void PlaneEvent::pqSAH(Real globalSA, Real parentSA, int nLeft, int nPlane, int nRight, 419 AxisAlignedBox& parentBox, SplitInfo& split) 418 void BvhPlaneEvent::pqSAH(Real globalSA, 419 Real parentSA, 420 int nLeft, 421 int nPlane, 422 int nRight, 423 AxisAlignedBox& parentBox, 424 BvhSplitInfo& split) 420 425 { 421 426 Real mu = splitBox(parentBox, split.bleft, split.bright); … … 446 451 //---------------------------------------------------------------------------- 447 452 // compute split cost without any penalties 448 Real PlaneEvent::pqSplitCost(Real pParent, Real pLeft, Real pRight, int nLeft, int nRight, Real mu)453 Real BvhPlaneEvent::pqSplitCost(Real pParent, Real pLeft, Real pRight, int nLeft, int nRight, Real mu) 449 454 { 450 455 return pParent * KT + (KI * (pLeft * nLeft + pRight * nRight)); … … 453 458 //---------------------------------------------------------------------------- 454 459 // DEBUG 455 String PlaneEvent::print()460 String BvhPlaneEvent::print() 456 461 { 457 462 String dim, type; … … 473 478 474 479 //---------------------------------------------------------------------------- 475 String SplitInfo::print()480 String BvhSplitInfo::print() 476 481 { 477 482 String sside; 478 if (side == PlaneEvent::PES_BOTH)483 if (side == BvhPlaneEvent::PES_BOTH) 479 484 sside = "BOTH "; 480 if (side == PlaneEvent::PES_LEFT)485 if (side == BvhPlaneEvent::PES_LEFT) 481 486 sside = "LEFT "; 482 if (side == PlaneEvent::PES_RIGHT)487 if (side == BvhPlaneEvent::PES_RIGHT) 483 488 sside = "RIGHT"; 484 489 return "nLeft: " + StringConverter::toString(nleft, 4) + " nRight: " + … … 492 497 493 498 //---------------------------------------------------------------------------- 494 String KdTree::SplitCandidate::print()499 String BvHierarchy::BvhSubdivisionCandidate::print() 495 500 { 496 501 String sside; 497 if (side == PlaneEvent::PES_BOTH)502 if (side == BvhPlaneEvent::PES_BOTH) 498 503 sside = "BOTH "; 499 if (side == PlaneEvent::PES_LEFT)504 if (side == BvhPlaneEvent::PES_LEFT) 500 505 sside = "LEFT "; 501 if (side == PlaneEvent::PES_RIGHT)506 if (side == BvhPlaneEvent::PES_RIGHT) 502 507 sside = "RIGHT"; 503 508 return "List: " + StringConverter::toString(events->size(), 4) + " Objects: " + … … 513 518 //---------------------------------------------------------------------------- 514 519 515 KdTree::KdTree(int maxdepth, BuildMethod bm):520 BvHierarchy::BvHierarchy(int maxdepth, BuildMethod bm): 516 521 mMaxDepth(maxdepth), 517 522 mBuildMethod(bm), … … 519 524 mShowAllBoxes(false), 520 525 mShowNodes(true), 521 m KdRoot(0),526 mBvhRoot(0), 522 527 mBuildLog(0) 523 528 { … … 525 530 } 526 531 527 KdTree::KdTree(int maxdepth, BuildMethod bm, int hilite, bool allboxes, bool shownodes):532 BvHierarchy::BvHierarchy(int maxdepth, BuildMethod bm, int hilite, bool allboxes, bool shownodes): 528 533 mMaxDepth(maxdepth), 529 534 mBuildMethod(bm), … … 531 536 mShowAllBoxes(allboxes), 532 537 mShowNodes(shownodes), 533 m KdRoot(0),538 mBvhRoot(0), 534 539 mBuildLog(0) 535 540 { … … 537 542 } 538 543 539 KdTree::~KdTree()540 { 541 delete m KdRoot;542 } 543 544 void KdTree::init()544 BvHierarchy::~BvHierarchy() 545 { 546 delete mBvhRoot; 547 } 548 549 void BvHierarchy::init() 545 550 { 546 551 MaterialPtr mat; … … 548 553 549 554 // init visualization materials (unlit solid green/yellow) 550 mat = MaterialManager::getSingleton().getByName(" KdTree/BoxHiLite");555 mat = MaterialManager::getSingleton().getByName("BvHierarchy/BoxHiLite"); 551 556 if (mat.isNull()) 552 557 { 553 558 ColourValue green(0, 1, 0); 554 mat = MaterialManager::getSingleton().create(" KdTree/BoxHiLite", "General");559 mat = MaterialManager::getSingleton().create("BvHierarchy/BoxHiLite", "General"); 555 560 //mat->setAmbient(green); 556 561 //mat->setDiffuse(green); … … 560 565 } 561 566 562 mat = MaterialManager::getSingleton().getByName(" KdTree/BoxViz");567 mat = MaterialManager::getSingleton().getByName("BvHierarchy/BoxViz"); 563 568 if (mat.isNull()) 564 569 { 565 570 ColourValue yellow(1, 1, 0); 566 mat = MaterialManager::getSingleton().create(" KdTree/BoxViz", "General");571 mat = MaterialManager::getSingleton().create("BvHierarchy/BoxViz", "General"); 567 572 //mat->setAmbient(yellow); 568 573 //mat->setDiffuse(yellow); … … 575 580 try 576 581 { 577 mBuildLog = LogManager::getSingleton().getLog( KDTREE_LOGNAME);582 mBuildLog = LogManager::getSingleton().getLog(BvHierarchy_LOGNAME); 578 583 } 579 584 catch (Exception&) 580 585 { 581 mBuildLog = LogManager::getSingleton().createLog( KDTREE_LOGNAME);586 mBuildLog = LogManager::getSingleton().createLog(BvHierarchy_LOGNAME); 582 587 } 583 588 … … 586 591 587 592 /************************************************************************/ 588 /* KdTreeinsert/delete functions */593 /* BvHierarchy insert/delete functions */ 589 594 /************************************************************************/ 590 595 591 void KdTree::remove(BvRenderable * rend)596 void BvHierarchy::remove(BvhRenderable * rend) 592 597 { 593 598 // DEBUG 594 //LogManager::getSingleton().logMessage("-- Removing SceneNode: " + (static_cast< KdTreeSceneNode *>(rend))->getName());599 //LogManager::getSingleton().logMessage("-- Removing SceneNode: " + (static_cast<BvHierarchySceneNode *>(rend))->getName()); 595 600 std::queue<LeafPtr> cleanup; 596 601 LeafPtr leaf; … … 616 621 } 617 622 618 void KdTree::recDelete(KdTree::Node * node)623 void BvHierarchy::recDelete(BvHierarchy::Node * node) 619 624 { 620 625 if (node == 0) // DEBUG 621 626 { 622 627 OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 623 "SNAFU while inserting Bv Renderable into KdTree.",624 " KdTree::recInsert" );628 "SNAFU while inserting BvhRenderable into BvHierarchy.", 629 "BvHierarchy::recInsert" ); 625 630 return; 626 631 } … … 628 633 if (node->isEmpty()) 629 634 { 630 if (node == m KdRoot)631 { 632 OGRE_DELETE(m KdRoot);635 if (node == mBvhRoot) 636 { 637 OGRE_DELETE(mBvhRoot); 633 638 } 634 639 else 635 640 { 636 KdTree::Branch * parent = KDBRANCHPTR_CAST(node->getParent());641 BvHierarchy::Branch * parent = BVHBRANCHPTR_CAST(node->getParent()); 637 642 if (node == parent->mLeft) 638 643 { … … 648 653 } 649 654 650 void KdTree::insert(BvRenderable * rend)655 void BvHierarchy::insert(BvhRenderable * rend) 651 656 { 652 657 // make sure the tree exists 653 if (m KdRoot)658 if (mBvhRoot) 654 659 { 655 660 // make sure the renderable is inside the world bounding box 656 661 AxisAlignedBox aabb = rend->getBoundingBox(); 657 AxisAlignedBox isect = m KdRoot->mAABB.intersection(aabb);662 AxisAlignedBox isect = mBvhRoot->mAABB.intersection(aabb); 658 663 if (isect.getMinimum() == aabb.getMinimum() && isect.getMaximum() == aabb.getMaximum()) 659 664 { 660 recInsert(m KdRoot, rend);665 recInsert(mBvhRoot, rend); 661 666 } 662 667 else 663 668 { 664 669 //LogManager::getSingleton().logMessage("Inserted node outside of world AABB."); 665 Bv RenderableList nodelist;670 BvhRenderableList nodelist; 666 671 nodelist.push_back(rend); 667 addRendToList(m KdRoot, nodelist);668 OGRE_DELETE(m KdRoot);669 m KdRoot = buildFromList(nodelist, 0, AxisAlignedBox());672 addRendToList(mBvhRoot, nodelist); 673 OGRE_DELETE(mBvhRoot); 674 mBvhRoot = buildFromList(nodelist, 0, AxisAlignedBox()); 670 675 } 671 676 } … … 677 682 } 678 683 679 void KdTree::recInsert(KdTree::Node * node, BvRenderable * rend)684 void BvHierarchy::recInsert(BvHierarchy::Node * node, BvhRenderable * rend) 680 685 { 681 686 if (node == 0) // DEBUG 682 687 { 683 688 OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 684 "SNAFU while inserting Bv Renderable into KdTree.",685 " KdTree::recInsert" );689 "SNAFU while inserting BvhRenderable into BvHierarchy.", 690 "BvHierarchy::recInsert" ); 686 691 return; 687 692 } … … 695 700 else 696 701 { 697 KdTree::Branch * branch = KDBRANCHPTR_CAST(node);702 BvHierarchy::Branch * branch = BVHBRANCHPTR_CAST(node); 698 703 AxisAlignedBox aabb = rend->getBoundingBox(); 699 704 Plane::Side smin = branch->mSplitPlane->getSide(aabb.getMinimum()); … … 702 707 { 703 708 if (smax == Plane::NEGATIVE_SIDE || 704 (smax == Plane::NO_SIDE && branch->mPlaneSide == PlaneEvent::PES_LEFT))709 (smax == Plane::NO_SIDE && branch->mPlaneSide == BvhPlaneEvent::PES_LEFT)) 705 710 { 706 711 if (branch->mLeft) 707 712 recInsert(branch->mLeft, rend); 708 713 else 709 recInsertNew(branch, PlaneEvent::PES_LEFT, rend);714 recInsertNew(branch, BvhPlaneEvent::PES_LEFT, rend); 710 715 } 711 716 else if (smin == Plane::POSITIVE_SIDE || 712 (smin == Plane::NO_SIDE && branch->mPlaneSide == PlaneEvent::PES_RIGHT))717 (smin == Plane::NO_SIDE && branch->mPlaneSide == BvhPlaneEvent::PES_RIGHT)) 713 718 { 714 719 if (branch->mRight) 715 720 recInsert(branch->mRight, rend); 716 721 else 717 recInsertNew(branch, PlaneEvent::PES_RIGHT, rend);722 recInsertNew(branch, BvhPlaneEvent::PES_RIGHT, rend); 718 723 } 719 724 } … … 725 730 recInsert(branch->mLeft, rend); 726 731 else 727 recInsertNew(branch, PlaneEvent::PES_LEFT, rend);732 recInsertNew(branch, BvhPlaneEvent::PES_LEFT, rend); 728 733 } 729 734 else if (smax == Plane::POSITIVE_SIDE && smin == Plane::NO_SIDE) … … 732 737 recInsert(branch->mRight, rend); 733 738 else 734 recInsertNew(branch, PlaneEvent::PES_RIGHT, rend);739 recInsertNew(branch, BvhPlaneEvent::PES_RIGHT, rend); 735 740 } 736 741 else … … 744 749 } 745 750 746 void KdTree::recInsertNew(KdTree::Branch * parent, PlaneEvent::Side side, BvRenderable * rend)751 void BvHierarchy::recInsertNew(BvHierarchy::Branch * parent, BvhPlaneEvent::Side side, BvhRenderable * rend) 747 752 { 748 753 //LogManager::getSingleton().logMessage("## Inserting into new subtree"); 749 754 750 755 AxisAlignedBox left, rigth, aabb; 751 PlaneEventList events;756 BvhPlaneEventList events; 752 757 int nObjects; 753 758 … … 756 761 // override aabb 757 762 splitBox(*parent, left, rigth); 758 if (side == PlaneEvent::PES_LEFT)763 if (side == BvhPlaneEvent::PES_LEFT) 759 764 { 760 765 aabb = left; 761 if (mBuildMethod == KDBM_RECURSIVE)766 if (mBuildMethod == BVHBM_RECURSIVE) 762 767 parent->mLeft = recBuild(events, nObjects, aabb, parent); 763 else if (mBuildMethod == KDBM_PRIORITYQUEUE)768 else if (mBuildMethod == BVHBM_PRIORITYQUEUE) 764 769 parent->mLeft = pqBuild(events, nObjects, aabb, parent); 765 770 else 766 771 { 767 772 OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 768 "Invalid build method for the KdTree.",769 " KdTree::buildFromList");773 "Invalid build method for the BvHierarchy.", 774 "BvHierarchy::buildFromList"); 770 775 parent->mLeft = 0; 771 776 } 772 777 773 778 } 774 else if (side == PlaneEvent::PES_RIGHT)779 else if (side == BvhPlaneEvent::PES_RIGHT) 775 780 { 776 781 aabb = rigth; 777 if (mBuildMethod == KDBM_RECURSIVE)782 if (mBuildMethod == BVHBM_RECURSIVE) 778 783 parent->mRight = recBuild(events, nObjects, aabb, parent); 779 else if (mBuildMethod == KDBM_PRIORITYQUEUE)784 else if (mBuildMethod == BVHBM_PRIORITYQUEUE) 780 785 parent->mRight = pqBuild(events, nObjects, aabb, parent); 781 786 else 782 787 { 783 788 OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 784 "Invalid build method for the KdTree.",785 " KdTree::buildFromList");789 "Invalid build method for the BvHierarchy.", 790 "BvHierarchy::buildFromList"); 786 791 parent->mRight = 0; 787 792 } … … 789 794 } 790 795 791 void KdTree::rebuildSubtree(KdTree::Node * node, BvRenderable * rend)796 void BvHierarchy::rebuildSubtree(BvHierarchy::Node * node, BvhRenderable * rend) 792 797 { 793 798 //LogManager::getSingleton().logMessage("## Rebuilding subtree"); … … 795 800 AxisAlignedBox aabb = node->mAABB; 796 801 797 Bv RenderableList nodelist;802 BvhRenderableList nodelist; 798 803 nodelist.push_back(rend); 799 804 addRendToList(node, nodelist); 800 805 801 if (node == m KdRoot)802 { 803 OGRE_DELETE(m KdRoot);804 m KdRoot = buildFromList(nodelist, 0, aabb);806 if (node == mBvhRoot) 807 { 808 OGRE_DELETE(mBvhRoot); 809 mBvhRoot = buildFromList(nodelist, 0, aabb); 805 810 } 806 811 else 807 812 { 808 KdTree::Branch * parent = KDBRANCHPTR_CAST(node->getParent());813 BvHierarchy::Branch * parent = BVHBRANCHPTR_CAST(node->getParent()); 809 814 810 815 if (node == parent->mLeft) … … 821 826 { 822 827 OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 823 "SNAFU while inserting Bv Renderable into KdTree.",824 " KdTree::recInsert" );828 "SNAFU while inserting BvhRenderable into BvHierarchy.", 829 "BvHierarchy::recInsert" ); 825 830 } 826 831 } … … 828 833 829 834 // compute both AABB then return the requested one. 830 void KdTree::splitBox(const KdTree::Branch& parent, AxisAlignedBox& left, AxisAlignedBox& right)835 void BvHierarchy::splitBox(const BvHierarchy::Branch& parent, AxisAlignedBox& left, AxisAlignedBox& right) 831 836 { 832 837 Vector3 bmin = parent.mAABB.getMinimum(); … … 845 850 } 846 851 847 void KdTree::addRendToList(KdTree::Node * node, BvRenderableList& nodelist)852 void BvHierarchy::addRendToList(BvHierarchy::Node * node, BvhRenderableList& nodelist) 848 853 { 849 854 if (node->isLeaf()) 850 855 { 851 KdTree::Leaf * leaf = KDLEAFPTR_CAST(node);852 Bv RenderableList::iterator it = leaf->mBvRenderables.begin();853 Bv RenderableList::iterator end = leaf->mBvRenderables.end();856 BvHierarchy::Leaf * leaf = BVHLEAFPTR_CAST(node); 857 BvhRenderableList::iterator it = leaf->mBvhRenderables.begin(); 858 BvhRenderableList::iterator end = leaf->mBvhRenderables.end(); 854 859 while (it != end) 855 860 { … … 860 865 else 861 866 { 862 KdTree::Branch * branch = KDBRANCHPTR_CAST(node);867 BvHierarchy::Branch * branch = BVHBRANCHPTR_CAST(node); 863 868 if (branch->mLeft) 864 869 addRendToList(branch->mLeft, nodelist); … … 869 874 870 875 /************************************************************************/ 871 /* KdTreebuild functions */876 /* BvHierarchy build functions */ 872 877 /************************************************************************/ 873 878 874 void KdTree::build(BvRenderable * sceneRoot)879 void BvHierarchy::build(BvhRenderable * sceneRoot) 875 880 { 876 881 Timer *timer = Root::getSingleton().getTimer(); … … 880 885 881 886 // data we want to collect 882 PlaneEventList events;887 BvhPlaneEventList events; 883 888 AxisAlignedBox aabb; 884 889 int nObjects = 0; … … 897 902 aabb.merge(aabb.getMinimum()+Vector3(-1,-1,-1)); 898 903 899 if (mBuildMethod == KDBM_RECURSIVE)900 m KdRoot = recBuild(events, nObjects, aabb, 0);901 else if (mBuildMethod == KDBM_PRIORITYQUEUE)902 m KdRoot = pqBuild(events, nObjects, aabb, 0);904 if (mBuildMethod == BVHBM_RECURSIVE) 905 mBvhRoot = recBuild(events, nObjects, aabb, 0); 906 else if (mBuildMethod == BVHBM_PRIORITYQUEUE) 907 mBvhRoot = pqBuild(events, nObjects, aabb, 0); 903 908 else 904 909 { 905 910 OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 906 "Invalid build method for the KdTree.",907 " KdTree::build");908 m KdRoot = 0;911 "Invalid build method for the BvHierarchy.", 912 "BvHierarchy::build"); 913 mBvhRoot = 0; 909 914 } 910 915 … … 912 917 913 918 String method = "Invalid"; 914 if (mBuildMethod == KDBM_RECURSIVE)919 if (mBuildMethod == BVHBM_RECURSIVE) 915 920 method = "Recursive"; 916 else if (mBuildMethod == KDBM_PRIORITYQUEUE)921 else if (mBuildMethod == BVHBM_PRIORITYQUEUE) 917 922 method = "Priority Queue"; 918 923 … … 931 936 } 932 937 933 KdTree::Node * KdTree::buildFromList(BvRenderableList& nodelist, KdTree::Branch * parent, AxisAlignedBox& aabb)938 BvHierarchy::Node * BvHierarchy::buildFromList(BvhRenderableList& nodelist, BvHierarchy::Branch * parent, AxisAlignedBox& aabb) 934 939 { 935 940 // data we want to collect 936 PlaneEventList events;941 BvhPlaneEventList events; 937 942 AxisAlignedBox nodeaabb; 938 943 int nObjects = 0; 939 944 940 Bv RenderableList::iterator it = nodelist.begin();941 Bv RenderableList::iterator end = nodelist.end();945 BvhRenderableList::iterator it = nodelist.begin(); 946 BvhRenderableList::iterator end = nodelist.end(); 942 947 while (it != end) 943 948 { … … 954 959 } 955 960 956 if (mBuildMethod == KDBM_RECURSIVE)961 if (mBuildMethod == BVHBM_RECURSIVE) 957 962 return recBuild(events, nObjects, aabb, parent); 958 else if (mBuildMethod == KDBM_PRIORITYQUEUE)963 else if (mBuildMethod == BVHBM_PRIORITYQUEUE) 959 964 return pqBuild(events, nObjects, aabb, parent); 960 965 else 961 966 { 962 967 OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 963 "Invalid build method for the KdTree.",964 " KdTree::buildFromList");968 "Invalid build method for the BvHierarchy.", 969 "BvHierarchy::buildFromList"); 965 970 return 0; 966 971 } 967 972 } 968 973 969 KdTree::Node * KdTree::recBuild(PlaneEventList& events, int nObjects, AxisAlignedBox& aabb, KdTree::Branch * parent)974 BvHierarchy::Node * BvHierarchy::recBuild(BvhPlaneEventList& events, int nObjects, AxisAlignedBox& aabb, BvHierarchy::Branch * parent) 970 975 { 971 976 // determine the depth we are on … … 990 995 } 991 996 992 SplitInfo split, best;997 BvhSplitInfo split, best; 993 998 best.cost = Math::POS_INFINITY; 994 999 995 PlaneEventList::iterator begin = events.begin();996 PlaneEventList::iterator end = events.end();997 PlaneEventList::iterator it = begin;1000 BvhPlaneEventList::iterator begin = events.begin(); 1001 BvhPlaneEventList::iterator end = events.end(); 1002 BvhPlaneEventList::iterator it = begin; 998 1003 // try all planes to find the best one for the given set of objects 999 1004 while (it != end) 1000 1005 { 1001 PlaneEventList::iterator p = it;1006 BvhPlaneEventList::iterator p = it; 1002 1007 pStart = pOn = pEnd = 0; 1003 while (it != end && p->equalsType(*it, PlaneEvent::PET_END))1008 while (it != end && p->equalsType(*it, BvhPlaneEvent::PET_END)) 1004 1009 { 1005 1010 it++; pEnd++; 1006 1011 } 1007 while (it != end && p->equalsType(*it, PlaneEvent::PET_ON))1012 while (it != end && p->equalsType(*it, BvhPlaneEvent::PET_ON)) 1008 1013 { 1009 1014 it++; pOn++; 1010 1015 } 1011 while (it != end && p->equalsType(*it, PlaneEvent::PET_START))1016 while (it != end && p->equalsType(*it, BvhPlaneEvent::PET_START)) 1012 1017 { 1013 1018 it++; pStart++; … … 1027 1032 /************************************************/ 1028 1033 // check terminating condition 1029 if (best.cost > PlaneEvent::KI*nObjects || level >= mMaxDepth)1034 if (best.cost > BvhPlaneEvent::KI*nObjects || level >= mMaxDepth) 1030 1035 { 1031 1036 // Terminating condition reached, create leaf and add renderables to list 1032 KdTree::Leaf * leaf = new KdTree::Leaf(this, level, aabb, parent);1033 Bv Renderable *rend;1037 BvHierarchy::Leaf * leaf = new BvHierarchy::Leaf(this, level, aabb, parent); 1038 BvhRenderable *rend; 1034 1039 it = begin; 1035 1040 while (it != end) … … 1057 1062 else 1058 1063 { 1059 PlaneEventList eventsRight, eventsLeft;1064 BvhPlaneEventList eventsRight, eventsLeft; 1060 1065 it = begin; 1061 1066 // slightly redundant, since we mark each renderable up to 6 times 1062 1067 while (it != end) 1063 1068 { 1064 it->getRenderable()->setSide( PlaneEvent::PES_BOTH);1069 it->getRenderable()->setSide(BvhPlaneEvent::PES_BOTH); 1065 1070 it->getRenderable()->setClassified(false); 1066 1071 it++; … … 1079 1084 { 1080 1085 // right-only nodes go in right list 1081 if (it->getRenderable()->getSide() == PlaneEvent::PES_RIGHT)1086 if (it->getRenderable()->getSide() == BvhPlaneEvent::PES_RIGHT) 1082 1087 { 1083 1088 if (!it->getRenderable()->isClassified()) … … 1089 1094 } 1090 1095 // left-only nodes go in left list 1091 else if (it->getRenderable()->getSide() == PlaneEvent::PES_LEFT)1096 else if (it->getRenderable()->getSide() == BvhPlaneEvent::PES_LEFT) 1092 1097 { 1093 1098 if (!it->getRenderable()->isClassified()) … … 1114 1119 1115 1120 // create a new branch node and continue recursion 1116 KdTree::Branch * branch = new KdTree::Branch(this, level, aabb, parent,1121 BvHierarchy::Branch * branch = new BvHierarchy::Branch(this, level, aabb, parent, 1117 1122 best.event.getSplitPlane(), best.side); 1118 1123 … … 1137 1142 } 1138 1143 1139 KdTree::Node * KdTree::pqBuild(PlaneEventList& events, int nObjects, AxisAlignedBox& aabb, KdTree::Branch * parent)1144 BvHierarchy::Node * BvHierarchy::pqBuild(BvhPlaneEventList& events, int nObjects, AxisAlignedBox& aabb, BvHierarchy::Branch * parent) 1140 1145 { 1141 1146 SplitCandidatePQ pqueue; … … 1143 1148 Real globalSA; 1144 1149 1145 KdTree::Node * newNode = 0, * topNode = 0;1150 BvHierarchy::Node * newNode = 0, * topNode = 0; 1146 1151 // init global tree cost 1147 globalTreeCost = PlaneEvent::KI * nObjects;1148 globalSA = PlaneEvent::surfaceArea(aabb);1149 1150 PlaneEventList * e = newPlaneEventList(events);1152 globalTreeCost = BvhPlaneEvent::KI * nObjects; 1153 globalSA = BvhPlaneEvent::surfaceArea(aabb); 1154 1155 BvhPlaneEventList * e = new BvhPlaneEventList(events); 1151 1156 1152 1157 // inital split candidate 1153 SplitInfo * best = pqFindPlane(e, nObjects, aabb, globalSA);1154 SplitCandidate splitcandidate(e, nObjects, aabb, parent, globalTreeCost,1155 globalTreeCost - best->cost, best, PlaneEvent::PES_BOTH);1158 BvhSplitInfo * best = pqFindPlane(e, nObjects, aabb, globalSA); 1159 BvhSubdivisionCandidate splitcandidate(e, nObjects, aabb, parent, globalTreeCost, 1160 globalTreeCost - best->cost, best, BvhPlaneEvent::PES_BOTH); 1156 1161 pqueue.push(splitcandidate); 1157 1162 … … 1160 1165 while (!pqueue.empty()) 1161 1166 { 1162 SplitCandidate sc = pqueue.top();1167 BvhSubdivisionCandidate sc = pqueue.top(); 1163 1168 pqueue.pop(); 1164 1169 … … 1177 1182 { 1178 1183 // Terminating condition reached, create leaf and add renderables to list 1179 KdTree::Leaf * leaf = new KdTree::Leaf(this, level, sc.aabb, sc.parent);1180 Bv Renderable *rend;1181 PlaneEventList::iterator begin = sc.events->begin();1182 PlaneEventList::iterator end = sc.events->end();1183 PlaneEventList::iterator it = begin;1184 BvHierarchy::Leaf * leaf = new BvHierarchy::Leaf(this, level, sc.aabb, sc.parent); 1185 BvhRenderable *rend; 1186 BvhPlaneEventList::iterator begin = sc.events->begin(); 1187 BvhPlaneEventList::iterator end = sc.events->end(); 1188 BvhPlaneEventList::iterator it = begin; 1184 1189 while (it != end) 1185 1190 { … … 1205 1210 else 1206 1211 { 1207 PlaneEventList * eventsLeft = newPlaneEventList();1208 PlaneEventList * eventsRight = newPlaneEventList();1209 PlaneEventList::iterator begin = sc.events->begin();1210 PlaneEventList::iterator end = sc.events->end();1211 PlaneEventList::iterator it = begin;1212 BvhPlaneEventList * eventsLeft = new BvhPlaneEventList(); 1213 BvhPlaneEventList * eventsRight = new BvhPlaneEventList(); 1214 BvhPlaneEventList::iterator begin = sc.events->begin(); 1215 BvhPlaneEventList::iterator end = sc.events->end(); 1216 BvhPlaneEventList::iterator it = begin; 1212 1217 // slightly redundant, since we mark each renderable up to 6 times 1213 1218 while (it != end) 1214 1219 { 1215 it->getRenderable()->setSide( PlaneEvent::PES_BOTH);1220 it->getRenderable()->setSide(BvhPlaneEvent::PES_BOTH); 1216 1221 it->getRenderable()->setClassified(false); 1217 1222 it++; … … 1232 1237 { 1233 1238 // right-only events go in the right list 1234 if (it->getRenderable()->getSide() == PlaneEvent::PES_RIGHT)1239 if (it->getRenderable()->getSide() == BvhPlaneEvent::PES_RIGHT) 1235 1240 { 1236 1241 if (!it->getRenderable()->isClassified()) … … 1243 1248 } 1244 1249 // left-only events go in the left list 1245 else if (it->getRenderable()->getSide() == PlaneEvent::PES_LEFT)1250 else if (it->getRenderable()->getSide() == BvhPlaneEvent::PES_LEFT) 1246 1251 { 1247 1252 if (!it->getRenderable()->isClassified()) … … 1268 1273 1269 1274 // create a new branch node 1270 KdTree::Branch * branch = new KdTree::Branch(this, level, sc.aabb, sc.parent,1275 BvHierarchy::Branch * branch = new BvHierarchy::Branch(this, level, sc.aabb, sc.parent, 1271 1276 sc.best->event.getSplitPlane(), sc.best->side); 1272 1277 … … 1279 1284 { 1280 1285 best = pqFindPlane(eventsLeft, nLeftS + nBothS, sc.best->bleft, globalSA); 1281 Real old = PlaneEvent::surfaceArea(sc.best->bleft)/globalSA*PlaneEvent::KI*(nLeftS + nBothS);1282 SplitCandidate scleft(eventsLeft, nLeftS + nBothS, sc.best->bleft,1283 branch, old, old - best->cost, best, PlaneEvent::PES_LEFT);1286 Real old = BvhPlaneEvent::surfaceArea(sc.best->bleft)/globalSA*BvhPlaneEvent::KI*(nLeftS + nBothS); 1287 BvhSubdivisionCandidate scleft(eventsLeft, nLeftS + nBothS, sc.best->bleft, 1288 branch, old, old - best->cost, best, BvhPlaneEvent::PES_LEFT); 1284 1289 pqueue.push(scleft); 1285 1290 } … … 1293 1298 { 1294 1299 best = pqFindPlane(eventsRight, nBothS + nRightS, sc.best->bright, globalSA); 1295 Real old = PlaneEvent::surfaceArea(sc.best->bright)/globalSA*PlaneEvent::KI*(nBothS + nRightS);1296 SplitCandidate scright(eventsRight, nBothS + nRightS, sc.best->bright,1297 branch, old, old - best->cost, best, PlaneEvent::PES_RIGHT);1300 Real old = BvhPlaneEvent::surfaceArea(sc.best->bright)/globalSA*BvhPlaneEvent::KI*(nBothS + nRightS); 1301 BvhSubdivisionCandidate scright(eventsRight, nBothS + nRightS, sc.best->bright, 1302 branch, old, old - best->cost, best, BvhPlaneEvent::PES_RIGHT); 1298 1303 pqueue.push(scright); 1299 1304 } … … 1316 1321 if (sc.parent) 1317 1322 { 1318 if (sc.side == PlaneEvent::PES_LEFT)1323 if (sc.side == BvhPlaneEvent::PES_LEFT) 1319 1324 { 1320 1325 sc.parent->mLeft = newNode; 1321 1326 } 1322 else if (sc.side == PlaneEvent::PES_RIGHT)1327 else if (sc.side == BvhPlaneEvent::PES_RIGHT) 1323 1328 { 1324 1329 sc.parent->mRight = newNode; … … 1327 1332 { 1328 1333 OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 1329 "PQBUILD SNAFU - CHILD I AM NOT LEFT NOR RIGHT"," KdTree::pqBuild");1334 "PQBUILD SNAFU - CHILD I AM NOT LEFT NOR RIGHT","BvHierarchy::pqBuild"); 1330 1335 } 1331 1336 } … … 1344 1349 1345 1350 //------------------------------------------------------------------------- 1346 SplitInfo * KdTree::pqFindPlane(PlaneEventList * events, int nObjects, AxisAlignedBox& aabb, Real globalSA)1351 BvhSplitInfo * BvHierarchy::pqFindPlane(BvhPlaneEventList * events, int nObjects, AxisAlignedBox& aabb, Real globalSA) 1347 1352 { 1348 1353 static const int dim = 3; … … 1354 1359 } 1355 1360 1356 SplitInfo split, best;1361 BvhSplitInfo split, best; 1357 1362 best.cost = Math::POS_INFINITY; 1358 1363 1359 Real parentSA = PlaneEvent::surfaceArea(aabb);1360 1361 PlaneEventList::iterator begin = events->begin();1362 PlaneEventList::iterator end = events->end();1363 PlaneEventList::iterator it = begin;1364 Real parentSA = BvhPlaneEvent::surfaceArea(aabb); 1365 1366 BvhPlaneEventList::iterator begin = events->begin(); 1367 BvhPlaneEventList::iterator end = events->end(); 1368 BvhPlaneEventList::iterator it = begin; 1364 1369 // try all planes to find the best one for the given set of objects 1365 1370 while (it != end) 1366 1371 { 1367 PlaneEventList::iterator p = it;1372 BvhPlaneEventList::iterator p = it; 1368 1373 pStart = pOn = pEnd = 0; 1369 while (it != end && p->equalsType(*it, PlaneEvent::PET_END))1374 while (it != end && p->equalsType(*it, BvhPlaneEvent::PET_END)) 1370 1375 { 1371 1376 it++; pEnd++; 1372 1377 } 1373 while (it != end && p->equalsType(*it, PlaneEvent::PET_ON))1378 while (it != end && p->equalsType(*it, BvhPlaneEvent::PET_ON)) 1374 1379 { 1375 1380 it++; pOn++; 1376 1381 } 1377 while (it != end && p->equalsType(*it, PlaneEvent::PET_START))1382 while (it != end && p->equalsType(*it, BvhPlaneEvent::PET_START)) 1378 1383 { 1379 1384 it++; pStart++; … … 1388 1393 nLeft[d] += pStart; nLeft[d] += pOn; nPlane[d] = 0; 1389 1394 } 1390 return new SplitInfo(best);1395 return new BvhSplitInfo(best); 1391 1396 } 1392 1397 1393 1398 /************************************************************************/ 1394 /* KdTreerendering functions */1399 /* BvHierarchy rendering functions */ 1395 1400 /************************************************************************/ 1396 1401 1397 1402 //------------------------------------------------------------------------- 1398 void KdTree::queueVisibleObjects(BvHierarchyCamera* cam, RenderQueue* queue, bool onlyShadowCasters,1399 bool showBoxes, KdTree::NodeList& visibleNodes)1403 void BvHierarchy::queueVisibleObjects(BvHierarchyCamera* cam, RenderQueue* queue, bool onlyShadowCasters, 1404 bool showBoxes, BvHierarchy::NodeList& visibleNodes) 1400 1405 { 1401 1406 mFrameStats.clear(); 1402 1407 cam->mNumVisQueries = 0; 1403 1408 1404 if (m KdRoot)1405 recQueueVisibleObjects(m KdRoot, Root::getSingleton().getCurrentFrameNumber(),1409 if (mBvhRoot) 1410 recQueueVisibleObjects(mBvhRoot, Root::getSingleton().getCurrentFrameNumber(), 1406 1411 cam, queue, onlyShadowCasters, showBoxes, visibleNodes); 1407 1412 … … 1410 1415 1411 1416 //------------------------------------------------------------------------- 1412 void KdTree::recQueueVisibleObjects(KdTree::Node * node, unsigned long currentFrame,1417 void BvHierarchy::recQueueVisibleObjects(BvHierarchy::Node * node, unsigned long currentFrame, 1413 1418 BvHierarchyCamera* cam, RenderQueue* queue, bool onlyShadowCasters, bool showBoxes, 1414 KdTree::NodeList& visibleNodes, bool fullVis)1415 { 1416 BvHierarchyCamera::NodeVisibility vis = BvHierarchyCamera:: KDNV_PART;1419 BvHierarchy::NodeList& visibleNodes, bool fullVis) 1420 { 1421 BvHierarchyCamera::NodeVisibility vis = BvHierarchyCamera::BVHNV_PART; 1417 1422 // test visibility 1418 1423 //if (cam->isVisible(node->mAABB)) 1419 1424 if (fullVis || 1420 ((vis = (cam->*getVisibility)(node->mAABB)) != BvHierarchyCamera:: KDNV_NONE))1425 ((vis = (cam->*getVisibility)(node->mAABB)) != BvHierarchyCamera::BVHNV_NONE)) 1421 1426 { 1422 1427 visibleNodes.push_back(node); 1423 1428 1424 bool v = (fullVis || vis == BvHierarchyCamera:: KDNV_FULL);1429 bool v = (fullVis || vis == BvHierarchyCamera::BVHNV_FULL); 1425 1430 1426 1431 node->queueVisibleObjects(currentFrame, cam, queue, onlyShadowCasters, showBoxes, v); … … 1447 1452 1448 1453 //------------------------------------------------------------------------- 1449 void KdTree::setEnhancedVis(bool enh)1454 void BvHierarchy::setEnhancedVis(bool enh) 1450 1455 { 1451 1456 if (enh) … … 1456 1461 1457 1462 //------------------------------------------------------------------------- 1458 bool KdTree::getEnhancedVis()1463 bool BvHierarchy::getEnhancedVis() 1459 1464 { 1460 1465 return getVisibility == &BvHierarchyCamera::getVisibilityEnhanced; … … 1462 1467 1463 1468 //------------------------------------------------------------------------- 1464 //void KdTree::findVisibleNodes(NodeList& visibleNodes, Camera * cam)1469 //void BvHierarchy::findVisibleNodes(NodeList& visibleNodes, Camera * cam) 1465 1470 //{ 1466 // if (m KdRoot)1467 // recFindVisibleNodes(m KdRoot, visibleNodes, cam);1471 // if (mBvhRoot) 1472 // recFindVisibleNodes(mBvhRoot, visibleNodes, cam); 1468 1473 //} 1469 1474 1470 1475 ////------------------------------------------------------------------------- 1471 //void KdTree::recFindVisibleNodes(KdTree::Node * node, NodeList& visibleNodes, Camera * cam)1476 //void BvHierarchy::recFindVisibleNodes(BvHierarchy::Node * node, NodeList& visibleNodes, Camera * cam) 1472 1477 //{ 1473 1478 // // test visibility … … 1483 1488 //} 1484 1489 1485 void KdTree::findNodesIn(const AxisAlignedBox &box, std::list<SceneNode *> &list, SceneNode *exclude)1486 { 1487 if (m KdRoot)1488 recFindNodesIn(box, list, exclude, m KdRoot);1489 } 1490 1491 void KdTree::findNodesIn(const Sphere &sphere, std::list<SceneNode *> &list, SceneNode *exclude)1492 { 1493 if (m KdRoot)1494 recFindNodesIn(sphere, list, exclude, m KdRoot);1495 } 1496 1497 void KdTree::findNodesIn(const PlaneBoundedVolume &volume, std::list<SceneNode *> &list, SceneNode *exclude)1498 { 1499 if (m KdRoot)1500 recFindNodesIn(volume, list, exclude, m KdRoot);1501 } 1502 1503 void KdTree::findNodesIn(const Ray &ray, std::list<SceneNode *> &list, SceneNode *exclude)1504 { 1505 if (m KdRoot)1506 recFindNodesIn(ray, list, exclude, m KdRoot);1507 } 1508 1509 void KdTree::recFindNodesIn(const AxisAlignedBox &box, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full)1490 void BvHierarchy::findNodesIn(const AxisAlignedBox &box, std::list<SceneNode *> &list, SceneNode *exclude) 1491 { 1492 if (mBvhRoot) 1493 recFindNodesIn(box, list, exclude, mBvhRoot); 1494 } 1495 1496 void BvHierarchy::findNodesIn(const Sphere &sphere, std::list<SceneNode *> &list, SceneNode *exclude) 1497 { 1498 if (mBvhRoot) 1499 recFindNodesIn(sphere, list, exclude, mBvhRoot); 1500 } 1501 1502 void BvHierarchy::findNodesIn(const PlaneBoundedVolume &volume, std::list<SceneNode *> &list, SceneNode *exclude) 1503 { 1504 if (mBvhRoot) 1505 recFindNodesIn(volume, list, exclude, mBvhRoot); 1506 } 1507 1508 void BvHierarchy::findNodesIn(const Ray &ray, std::list<SceneNode *> &list, SceneNode *exclude) 1509 { 1510 if (mBvhRoot) 1511 recFindNodesIn(ray, list, exclude, mBvhRoot); 1512 } 1513 1514 void BvHierarchy::recFindNodesIn(const AxisAlignedBox &box, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full) 1510 1515 { 1511 1516 // check intersection 1512 1517 if ( !full ) 1513 1518 { 1514 Intersection isect = intersect(box, node->_getWorldAABB());1519 BvhIntersection isect = intersect(box, node->_getWorldAABB()); 1515 1520 1516 1521 if ( isect == OUTSIDE ) … … 1522 1527 if (node->isLeaf()) 1523 1528 { 1524 LeafPtr leaf = KDLEAFPTR_CAST(node);1525 for (Bv RenderableList::iterator it = leaf->mBvRenderables.begin();1526 it != leaf->mBv Renderables.end(); it ++)1529 LeafPtr leaf = BVHLEAFPTR_CAST(node); 1530 for (BvhRenderableList::iterator it = leaf->mBvhRenderables.begin(); 1531 it != leaf->mBvhRenderables.end(); it ++) 1527 1532 { 1528 1533 SceneNode *sn = dynamic_cast<SceneNode *>(*it); … … 1536 1541 else 1537 1542 { 1538 Intersection nsect = intersect(box, sn->_getWorldAABB());1543 BvhIntersection nsect = intersect(box, sn->_getWorldAABB()); 1539 1544 1540 1545 if ( nsect != OUTSIDE ) … … 1555 1560 } 1556 1561 1557 void KdTree::recFindNodesIn(const Sphere &sphere, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full)1562 void BvHierarchy::recFindNodesIn(const Sphere &sphere, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full) 1558 1563 { 1559 1564 // TODO 1560 1565 } 1561 1566 1562 void KdTree::recFindNodesIn(const PlaneBoundedVolume &volume, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full)1567 void BvHierarchy::recFindNodesIn(const PlaneBoundedVolume &volume, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full) 1563 1568 { 1564 1569 // TODO 1565 1570 } 1566 1571 1567 void KdTree::recFindNodesIn(const Ray &ray, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full)1572 void BvHierarchy::recFindNodesIn(const Ray &ray, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full) 1568 1573 { 1569 1574 // TODO … … 1571 1576 1572 1577 /************************************************************************/ 1573 /* KdTreedebug & helper functions */1578 /* BvHierarchy debug & helper functions */ 1574 1579 /************************************************************************/ 1575 1580 1576 1581 //------------------------------------------------------------------------- 1577 void KdTree::dump()1578 { 1579 //LogManager::getSingleton().logMessage("#@#@#@#@ Dumping KdTree#@#@#@#@");1580 mBuildLog->logMessage("#@#@#@#@ Dumping KdTree#@#@#@#@");1581 if (m KdRoot)1582 dump(m KdRoot);1582 void BvHierarchy::dump() 1583 { 1584 //LogManager::getSingleton().logMessage("#@#@#@#@ Dumping BvHierarchy #@#@#@#@"); 1585 mBuildLog->logMessage("#@#@#@#@ Dumping BvHierarchy #@#@#@#@"); 1586 if (mBvhRoot) 1587 dump(mBvhRoot); 1583 1588 } 1584 1589 1585 1590 //------------------------------------------------------------------------- 1586 void KdTree::dump(KdTree::Node * node)1591 void BvHierarchy::dump(BvHierarchy::Node * node) 1587 1592 { 1588 1593 //LogManager * log = LogManager::getSingletonPtr(); 1589 KdTreeSceneNode * scenenode;1594 BvHierarchySceneNode * scenenode; 1590 1595 String pad; 1591 1596 int p; … … 1599 1604 if (node->isLeaf()) 1600 1605 { 1601 KdTree::Leaf * leaf = KDLEAFPTR_CAST(node);1602 Bv RenderableList::iterator it = leaf->mBvRenderables.begin();1603 Bv RenderableList::iterator end = leaf->mBvRenderables.end();1606 BvHierarchy::Leaf * leaf = BVHLEAFPTR_CAST(node); 1607 BvhRenderableList::iterator it = leaf->mBvhRenderables.begin(); 1608 BvhRenderableList::iterator end = leaf->mBvhRenderables.end(); 1604 1609 while (it != end) 1605 1610 { 1606 scenenode = dynamic_cast< KdTreeSceneNode *>(*it);1611 scenenode = dynamic_cast<BvHierarchySceneNode *>(*it); 1607 1612 mBuildLog->logMessage(pad + "# Leaf level " + 1608 1613 StringConverter::toString(node->getLevel()) + … … 1614 1619 else 1615 1620 { 1616 KdTree::Branch * branch = KDBRANCHPTR_CAST(node);1621 BvHierarchy::Branch * branch = BVHBRANCHPTR_CAST(node); 1617 1622 if (branch->mLeft) 1618 1623 { … … 1631 1636 1632 1637 //------------------------------------------------------------------------- 1633 Real KdTree::calcCost()1634 { 1635 if (m KdRoot)1636 return calcCost(m KdRoot, PlaneEvent::surfaceArea(mKdRoot->mAABB));1638 Real BvHierarchy::calcCost() 1639 { 1640 if (mBvhRoot) 1641 return calcCost(mBvhRoot, BvhPlaneEvent::surfaceArea(mBvhRoot->mAABB)); 1637 1642 else 1638 1643 return 0; … … 1640 1645 1641 1646 //------------------------------------------------------------------------- 1642 Real KdTree::calcCost(KdTree::Node * node, Real vs)1647 Real BvHierarchy::calcCost(BvHierarchy::Node * node, Real vs) 1643 1648 { 1644 1649 if (node == 0) … … 1647 1652 if (node->isLeaf()) 1648 1653 { 1649 KdTree::Leaf * leaf = KDLEAFPTR_CAST(node);1650 return ( PlaneEvent::surfaceArea(node->mAABB)/vs) *1651 PlaneEvent::KI * leaf->mBvRenderables.size();1654 BvHierarchy::Leaf * leaf = BVHLEAFPTR_CAST(node); 1655 return (BvhPlaneEvent::surfaceArea(node->mAABB)/vs) * 1656 BvhPlaneEvent::KI * leaf->mBvhRenderables.size(); 1652 1657 } 1653 1658 else 1654 1659 { 1655 KdTree::Branch * branch = KDBRANCHPTR_CAST(node);1656 return ( PlaneEvent::surfaceArea(node->mAABB)/vs) *PlaneEvent::KT +1660 BvHierarchy::Branch * branch = BVHBRANCHPTR_CAST(node); 1661 return (BvhPlaneEvent::surfaceArea(node->mAABB)/vs) * BvhPlaneEvent::KT + 1657 1662 calcCost(branch->mLeft, vs) + calcCost(branch->mRight, vs); 1658 1663 } … … 1660 1665 1661 1666 /************************************************************************/ 1662 /* KdTree::Node/Branch/Leaf functions */1667 /* BvHierarchy::Node/Branch/Leaf functions */ 1663 1668 /************************************************************************/ 1664 1669 1665 1670 //------------------------------------------------------------------------- 1666 KdTree::Leaf::~Leaf()1671 BvHierarchy::Leaf::~Leaf() 1667 1672 { 1668 1673 // detach all scene nodes in the case that we are rebuilding 1669 1674 // the tree but not the scene 1670 Bv RenderableList::iterator it = mBvRenderables.begin();1671 Bv RenderableList::iterator end = mBvRenderables.end();1675 BvhRenderableList::iterator it = mBvhRenderables.begin(); 1676 BvhRenderableList::iterator end = mBvhRenderables.end(); 1672 1677 while (it != end) 1673 1678 { … … 1675 1680 it++; 1676 1681 } 1677 mBv Renderables.clear();1682 mBvhRenderables.clear(); 1678 1683 } 1679 1684 1680 1685 //------------------------------------------------------------------------- 1681 void KdTree::Leaf::queueVisibleObjects(unsigned long currentFrame,1686 void BvHierarchy::Leaf::queueVisibleObjects(unsigned long currentFrame, 1682 1687 Camera* cam, RenderQueue* queue, bool onlyShadowCasters, bool showBoxes, bool fullVis) 1683 1688 { 1684 Bv RenderableList::iterator it = mBvRenderables.begin();1685 Bv RenderableList::iterator end = mBvRenderables.end();1689 BvhRenderableList::iterator it = mBvhRenderables.begin(); 1690 BvhRenderableList::iterator end = mBvhRenderables.end(); 1686 1691 while (it != end) 1687 1692 { … … 1699 1704 1700 1705 //------------------------------------------------------------------------- 1701 void KdTree::Leaf::getGeometryList(GtpVisibility::GeometryVector *geometryList)1702 { 1703 Bv RenderableList::iterator it = mBvRenderables.begin();1704 Bv RenderableList::iterator end = mBvRenderables.end();1706 void BvHierarchy::Leaf::getGeometryList(GtpVisibility::GeometryVector *geometryList) 1707 { 1708 BvhRenderableList::iterator it = mBvhRenderables.begin(); 1709 BvhRenderableList::iterator end = mBvhRenderables.end(); 1705 1710 while (it != end) 1706 1711 { … … 1712 1717 //------------------------------------------------------------------------- 1713 1718 // update the world aabb based on the contained geometry 1714 void KdTree::Leaf::_updateBounds(bool recurse)1719 void BvHierarchy::Leaf::_updateBounds(bool recurse) 1715 1720 { 1716 1721 // reset box … … 1718 1723 1719 1724 // merge boxes from attached geometry 1720 Bv RenderableList::iterator it = mBvRenderables.begin();1721 Bv RenderableList::iterator end = mBvRenderables.end();1725 BvhRenderableList::iterator it = mBvhRenderables.begin(); 1726 BvhRenderableList::iterator end = mBvhRenderables.end(); 1722 1727 while (it != end) 1723 1728 { -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchyCamera.cpp
r1319 r1320 32 32 // Null boxes always invisible 33 33 if ( box.isNull() ) 34 return KDNV_NONE;34 return BVHNV_NONE; 35 35 36 36 // Make any pending updates to the calculated frustum planes … … 75 75 76 76 if ( all_outside ) 77 return KDNV_NONE;77 return BVHNV_NONE; 78 78 } 79 79 80 80 if ( all_inside ) 81 return KDNV_FULL;81 return BVHNV_FULL; 82 82 else 83 return KDNV_PART;83 return BVHNV_PART; 84 84 } 85 85 … … 94 94 if (mCullFrustum) 95 95 { 96 return mCullFrustum->isVisible(box, culledBy) ? KDNV_PART : KDNV_NONE;96 return mCullFrustum->isVisible(box, culledBy) ? BVHNV_PART : BVHNV_NONE; 97 97 } 98 98 else 99 99 { 100 return Frustum::isVisible(box, culledBy) ? KDNV_PART : KDNV_NONE;100 return Frustum::isVisible(box, culledBy) ? BVHNV_PART : BVHNV_NONE; 101 101 } 102 102 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchyInterface.cpp
r1319 r1320 8 8 */ 9 9 10 #include "OgreBv Renderable.h"10 #include "OgreBvhRenderable.h" 11 11 #include "OgreBvHierarchySceneManager.h" 12 12 #include "OgreBvHierarchyInterface.h" … … 15 15 { 16 16 17 KdTreeHierarchyInterface::KdTreeHierarchyInterface(KdTreeSceneManager *sm, RenderSystem *rsys):17 BvHierarchyInterface::BvHierarchyInterface(BvHierarchySceneManager *sm, RenderSystem *rsys): 18 18 PlatformHierarchyInterface(sm, rsys) 19 19 { … … 21 21 } 22 22 23 bool KdTreeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const23 bool BvHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const 24 24 { 25 return KDNODEPTR_CAST(node)->isLeaf();25 return BVHNODEPTR_CAST(node)->isLeaf(); 26 26 } 27 27 28 void KdTreeHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node)28 void BvHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node) 29 29 { 30 30 ++ mNumTraversedNodes; 31 31 32 KdTree::Node * kdnode = KDNODEPTR_CAST(node);32 BvHierarchy::Node * kdnode = BVHNODEPTR_CAST(node); 33 33 34 34 // if the node is a leaf and has geometry => render it … … 49 49 } 50 50 51 void KdTreeHierarchyInterface::RenderNode(GtpVisibility::HierarchyNode *node)51 void BvHierarchyInterface::RenderNode(GtpVisibility::HierarchyNode *node) 52 52 { 53 KdTree::Node * kdnode = KDNODEPTR_CAST(node);53 BvHierarchy::Node * kdnode = BVHNODEPTR_CAST(node); 54 54 if (kdnode->lastRendered() != mFrameId) 55 55 { 56 56 kdnode->setLastRendered(mFrameId); 57 KdTreeSceneManager * ksm = static_cast<KdTreeSceneManager *>(mSceneManager);57 BvHierarchySceneManager * ksm = static_cast<BvHierarchySceneManager *>(mSceneManager); 58 58 59 59 ksm->_renderNode(kdnode, mCamera, mOnlyShadowCasters, mLeavePassesInQueue); … … 63 63 } 64 64 65 void KdTreeHierarchyInterface::PullUpVisibility(GtpVisibility::HierarchyNode *node) const65 void BvHierarchyInterface::PullUpVisibility(GtpVisibility::HierarchyNode *node) const 66 66 { 67 KdTree::Node * kdnode = KDNODEPTR_CAST(node);67 BvHierarchy::Node * kdnode = BVHNODEPTR_CAST(node); 68 68 69 69 while (kdnode && !kdnode->isNodeVisible()) … … 74 74 } 75 75 76 float KdTreeHierarchyInterface::GetSquaredDistance(GtpVisibility::HierarchyNode *node) const76 float BvHierarchyInterface::GetSquaredDistance(GtpVisibility::HierarchyNode *node) const 77 77 { 78 const Vector3 pos = KDNODEPTR_CAST(node)->mAABB.getCenter();78 const Vector3 pos = BVHNODEPTR_CAST(node)->mAABB.getCenter(); 79 79 return (mCameraPosition - pos).squaredLength(); 80 80 } 81 81 82 AxisAlignedBox * KdTreeHierarchyInterface::GetBoundingBox(GtpVisibility::HierarchyNode *node)82 AxisAlignedBox * BvHierarchyInterface::GetBoundingBox(GtpVisibility::HierarchyNode *node) 83 83 { 84 84 // reuse box if node is the same … … 87 87 { 88 88 mSavedNode = node; 89 mBox = KDNODEPTR_CAST(node)->_getWorldAABB();89 mBox = BVHNODEPTR_CAST(node)->_getWorldAABB(); 90 90 } 91 91 … … 93 93 } 94 94 95 bool KdTreeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const95 bool BvHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const 96 96 { 97 return KDNODEPTR_CAST(node)->hasGeometry();97 return BVHNODEPTR_CAST(node)->hasGeometry(); 98 98 } 99 99 100 void KdTreeHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) const100 void BvHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) const 101 101 { 102 KDNODEPTR_CAST(node)->setNodeVisible(visible);102 BVHNODEPTR_CAST(node)->setNodeVisible(visible); 103 103 } 104 104 105 bool KdTreeHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) const105 bool BvHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) const 106 106 { 107 return KDNODEPTR_CAST(node)->isNodeVisible();107 return BVHNODEPTR_CAST(node)->isNodeVisible(); 108 108 } 109 109 110 void KdTreeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId) const110 void BvHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId) const 111 111 { 112 KDNODEPTR_CAST(node)->setLastVisited(frameId);112 BVHNODEPTR_CAST(node)->setLastVisited(frameId); 113 113 } 114 114 115 unsigned int KdTreeHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) const115 unsigned int BvHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) const 116 116 { 117 return KDNODEPTR_CAST(node)->lastVisited();117 return BVHNODEPTR_CAST(node)->lastVisited(); 118 118 } 119 119 120 void KdTreeHierarchyInterface::VisualizeCulledNode(GtpVisibility::HierarchyNode *node,120 void BvHierarchyInterface::VisualizeCulledNode(GtpVisibility::HierarchyNode *node, 121 121 GtpVisibility::CullingType type) const 122 122 { 123 WireBoundingBox *box = KDNODEPTR_CAST(node)->getWireBoundingBox();123 WireBoundingBox *box = BVHNODEPTR_CAST(node)->getWireBoundingBox(); 124 124 125 125 if (type == GtpVisibility::FRUSTUM_CULLED) … … 132 132 } 133 133 134 dynamic_cast< KdTreeSceneManager *>(mSceneManager)->getRenderQueue()->addRenderable(box);134 dynamic_cast<BvHierarchySceneManager *>(mSceneManager)->getRenderQueue()->addRenderable(box); 135 135 } 136 136 137 void KdTreeHierarchyInterface::GetNodeGeometryList(GtpVisibility::HierarchyNode *node,137 void BvHierarchyInterface::GetNodeGeometryList(GtpVisibility::HierarchyNode *node, 138 138 GtpVisibility::GeometryVector *geometryList, 139 139 bool includeChildren) 140 140 { 141 KDNODEPTR_CAST(node)->getGeometryList(geometryList);141 BVHNODEPTR_CAST(node)->getGeometryList(geometryList); 142 142 } 143 143 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchySceneManager.cpp
r1319 r1320 27 27 { 28 28 29 KdTreeSceneManager::KdTreeSceneManager(const String& name, GtpVisibility::VisibilityManager *vm):29 BvHierarchySceneManager::BvHierarchySceneManager(const String& name, GtpVisibility::VisibilityManager *vm): 30 30 SceneManager(name), 31 31 mVisibilityManager(vm), 32 32 mBvHierarchy(0), 33 mMaxDepth( KDTREE_MAX_DEPTH),33 mMaxDepth(BvHierarchy_MAX_DEPTH), 34 34 mShowBoxes(false), 35 35 mHiLiteLevel(0), 36 36 mShowAllBoxes(false), 37 37 mEnhancedVisiblity(true), 38 mBuildMethod( KdTree::KDBM_RECURSIVE),39 mRenderMethod( KdTree::KDRM_INTERNAL),38 mBuildMethod(BvHierarchy::BVHBM_RECURSIVE), 39 mRenderMethod(BvHierarchy::BVHRM_INTERNAL), 40 40 mShowVisualization(false), 41 41 mRenderNodesForViz(false), … … 64 64 // Replace root node with my node 65 65 OGRE_DELETE(mSceneRoot); 66 mSceneRoot = new KdTreeSceneNode(this, "root node");66 mSceneRoot = new BvHierarchySceneNode(this, "root node"); 67 67 mSceneRoot->_notifyRootNode(); 68 68 69 69 // init heirarchy interface 70 mHierarchyInterface = new KdTreeHierarchyInterface(this, mDestRenderSystem);71 } 72 73 KdTreeSceneManager::~KdTreeSceneManager(void)70 mHierarchyInterface = new BvHierarchyInterface(this, mDestRenderSystem); 71 } 72 73 BvHierarchySceneManager::~BvHierarchySceneManager(void) 74 74 { 75 75 delete mHierarchyInterface; … … 77 77 } 78 78 79 void KdTreeSceneManager::clearScene()79 void BvHierarchySceneManager::clearScene() 80 80 { 81 81 // DEBUG … … 90 90 91 91 92 const String& KdTreeSceneManager::getTypeName(void) const92 const String& BvHierarchySceneManager::getTypeName(void) const 93 93 { 94 94 return BvHierarchySceneManagerFactory::FACTORY_TYPE_NAME; 95 95 } 96 96 97 void KdTreeSceneManager::setShowBoxes(bool showboxes)97 void BvHierarchySceneManager::setShowBoxes(bool showboxes) 98 98 { 99 99 mShowBoxes = showboxes; 100 100 } 101 101 102 bool KdTreeSceneManager::getShowBoxes(void) const102 bool BvHierarchySceneManager::getShowBoxes(void) const 103 103 { 104 104 return mShowBoxes; 105 105 } 106 106 107 bool KdTreeSceneManager::setOption(const String& strKey, const void* pValue)108 { 109 // change max depth of the kdtree107 bool BvHierarchySceneManager::setOption(const String& strKey, const void* pValue) 108 { 109 // change max depth of the BvHierarchy 110 110 // rebuild the tree if already exists 111 if (strKey == " KdTreeMaxDepth")111 if (strKey == "BvHierarchyMaxDepth") 112 112 { 113 113 int maxdepth = *static_cast<const int *>(pValue); … … 132 132 if (kt > 0) 133 133 { 134 PlaneEvent::KT = kt;134 BvhPlaneEvent::KT = kt; 135 135 return true; 136 136 } … … 145 145 if (ki > 0) 146 146 { 147 PlaneEvent::KI = ki;147 BvhPlaneEvent::KI = ki; 148 148 return true; 149 149 } … … 153 153 } 154 154 } 155 else if (strKey == "Rebuild KdTree")155 else if (strKey == "RebuildBvHierarchy") 156 156 { 157 157 OGRE_DELETE(mBvHierarchy); 158 mBvHierarchy = new KdTree(mMaxDepth, mBuildMethod, mHiLiteLevel, mShowAllBoxes, mShowNodes);159 mBvHierarchy->build(static_cast< KdTreeSceneNode *>(mSceneRoot));158 mBvHierarchy = new BvHierarchy(mMaxDepth, mBuildMethod, mHiLiteLevel, mShowAllBoxes, mShowNodes); 159 mBvHierarchy->build(static_cast<BvHierarchySceneNode *>(mSceneRoot)); 160 160 mBvHierarchy->setEnhancedVis(mEnhancedVisiblity); 161 161 return true; … … 172 172 else if (strKey == "BuildMethod") 173 173 { 174 KdTree::BuildMethod bm = *static_cast<const KdTree::BuildMethod *>(pValue);175 if (bm == KdTree::KDBM_RECURSIVE || bm == KdTree::KDBM_PRIORITYQUEUE)174 BvHierarchy::BuildMethod bm = *static_cast<const BvHierarchy::BuildMethod *>(pValue); 175 if (bm == BvHierarchy::BVHBM_RECURSIVE || bm == BvHierarchy::BVHBM_PRIORITYQUEUE) 176 176 { 177 177 mBuildMethod = bm; … … 185 185 else if (strKey == "RenderMethod") 186 186 { 187 KdTree::RenderMethod rm = *static_cast<const KdTree::RenderMethod *>(pValue);188 if (rm == KdTree::KDRM_INTERNAL)187 BvHierarchy::RenderMethod rm = *static_cast<const BvHierarchy::RenderMethod *>(pValue); 188 if (rm == BvHierarchy::BVHRM_INTERNAL) 189 189 { 190 190 mRenderMethod = rm; 191 191 return true; 192 192 } 193 else if (rm == KdTree::KDRM_GTP_VFC)193 else if (rm == BvHierarchy::BVHRM_GTP_VFC) 194 194 { 195 195 mRenderMethod = rm; … … 198 198 .setOption("Algorithm", &cmt); 199 199 } 200 else if (rm == KdTree::KDRM_GTP_SWC)200 else if (rm == BvHierarchy::BVHRM_GTP_SWC) 201 201 { 202 202 mRenderMethod = rm; … … 205 205 .setOption("Algorithm", &cmt); 206 206 } 207 else if (rm == KdTree::KDRM_GTP_CHC)207 else if (rm == BvHierarchy::BVHRM_GTP_CHC) 208 208 { 209 209 mRenderMethod = rm; … … 227 227 int val = *static_cast<const int *>(pValue); 228 228 if (val == GtpVisibility::VisibilityEnvironment::FRUSTUM_CULLING) 229 mRenderMethod = KdTree::KDRM_GTP_VFC;229 mRenderMethod = BvHierarchy::BVHRM_GTP_VFC; 230 230 else if (val == GtpVisibility::VisibilityEnvironment::STOP_AND_WAIT_CULLING) 231 mRenderMethod = KdTree::KDRM_GTP_SWC;231 mRenderMethod = BvHierarchy::BVHRM_GTP_SWC; 232 232 else if (val == GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING) 233 mRenderMethod = KdTree::KDRM_GTP_CHC;233 mRenderMethod = BvHierarchy::BVHRM_GTP_CHC; 234 234 // default, should never happen 235 235 else 236 mRenderMethod = KdTree::KDRM_INTERNAL;236 mRenderMethod = BvHierarchy::BVHRM_INTERNAL; 237 237 } 238 238 else 239 239 { 240 mRenderMethod = KdTree::KDRM_INTERNAL;240 mRenderMethod = BvHierarchy::BVHRM_INTERNAL; 241 241 } 242 242 return success; 243 243 } 244 else if (strKey == "Show KdTree")244 else if (strKey == "ShowBvHierarchy") 245 245 { 246 246 bool sk = *static_cast<const bool *>(pValue); … … 406 406 } 407 407 408 bool KdTreeSceneManager::getOption(const String& strKey, void* pDestValue)409 { 410 if (strKey == " KdTreeMaxDepth")408 bool BvHierarchySceneManager::getOption(const String& strKey, void* pDestValue) 409 { 410 if (strKey == "BvHierarchyMaxDepth") 411 411 { 412 412 *static_cast<int *>(pDestValue) = mMaxDepth; … … 415 415 else if (strKey == "KT") 416 416 { 417 *static_cast<Real *>(pDestValue) = PlaneEvent::KT;417 *static_cast<Real *>(pDestValue) = BvhPlaneEvent::KT; 418 418 return true; 419 419 } 420 420 else if (strKey == "KI") 421 421 { 422 *static_cast<Real *>(pDestValue) = PlaneEvent::KI;422 *static_cast<Real *>(pDestValue) = BvhPlaneEvent::KI; 423 423 return true; 424 424 } … … 433 433 else if (strKey == "BuildMethod") 434 434 { 435 *static_cast< KdTree::BuildMethod *>(pDestValue) = mBuildMethod;435 *static_cast<BvHierarchy::BuildMethod *>(pDestValue) = mBuildMethod; 436 436 return true; 437 437 } 438 438 else if (strKey == "RenderMethod") 439 439 { 440 *static_cast< KdTree::RenderMethod *>(pDestValue) = mRenderMethod;441 return true; 442 } 443 else if (strKey == "Show KdTree")440 *static_cast<BvHierarchy::RenderMethod *>(pDestValue) = mRenderMethod; 441 return true; 442 } 443 else if (strKey == "ShowBvHierarchy") 444 444 { 445 445 *static_cast<bool *>(pDestValue) = mShowBoxes; … … 464 464 else if (strKey == "NumFrustumCulledNodes") 465 465 { 466 if (mRenderMethod == KdTree::KDRM_INTERNAL)466 if (mRenderMethod == BvHierarchy::BVHRM_INTERNAL) 467 467 { 468 468 unsigned int numnodes = 0; … … 477 477 else if (strKey == "NumQueryCulledNodes") 478 478 { 479 if (mRenderMethod == KdTree::KDRM_INTERNAL)479 if (mRenderMethod == BvHierarchy::BVHRM_INTERNAL) 480 480 { 481 481 * static_cast<unsigned int *>(pDestValue) = 0; … … 495 495 else if (strKey == "NumRenderedNodes") 496 496 { 497 if (mRenderMethod == KdTree::KDRM_INTERNAL)497 if (mRenderMethod == BvHierarchy::BVHRM_INTERNAL) 498 498 { 499 499 unsigned int numnodes = 0; … … 508 508 else if (strKey == "NumQueriesIssued") 509 509 { 510 if (mRenderMethod == KdTree::KDRM_INTERNAL)510 if (mRenderMethod == BvHierarchy::BVHRM_INTERNAL) 511 511 { 512 512 * static_cast<unsigned int *>(pDestValue) = 0; … … 517 517 else if (strKey == "NumTraversedNodes") 518 518 { 519 if (mRenderMethod == KdTree::KDRM_INTERNAL)519 if (mRenderMethod == BvHierarchy::BVHRM_INTERNAL) 520 520 { 521 521 unsigned int numnodes = 0; … … 557 557 } 558 558 559 bool KdTreeSceneManager::getOptionKeys(StringVector &refKeys)559 bool BvHierarchySceneManager::getOptionKeys(StringVector &refKeys) 560 560 { 561 561 refKeys.push_back("Algorithm"); … … 570 570 refKeys.push_back("KI"); 571 571 refKeys.push_back("KT"); 572 refKeys.push_back(" KdTreeMaxDepth");572 refKeys.push_back("BvHierarchyMaxDepth"); 573 573 refKeys.push_back("LoadViewCells"); 574 574 refKeys.push_back("NumHierarchyNodes"); 575 575 refKeys.push_back("PrepareVisualization"); 576 refKeys.push_back("Rebuild KdTree");576 refKeys.push_back("RebuildBvHierarchy"); 577 577 refKeys.push_back("RenderMethod"); 578 578 refKeys.push_back("RenderNodesContentForViz"); … … 580 580 refKeys.push_back("RenderTransparentsForItemBuffer"); 581 581 refKeys.push_back("ShowAllBoxes"); 582 refKeys.push_back("Show KdTree");582 refKeys.push_back("ShowBvHierarchy"); 583 583 refKeys.push_back("ShowNodes"); 584 584 refKeys.push_back("SkyBoxEnabled"); … … 595 595 } 596 596 597 bool KdTreeSceneManager::getOptionValues(const String & key, StringVector &refValueList)597 bool BvHierarchySceneManager::getOptionValues(const String & key, StringVector &refValueList) 598 598 { 599 599 return SceneManager::getOptionValues(key, refValueList); 600 600 } 601 601 602 void KdTreeSceneManager::setVisibilityManager(GtpVisibility::VisibilityManager *visManager)602 void BvHierarchySceneManager::setVisibilityManager(GtpVisibility::VisibilityManager *visManager) 603 603 { 604 604 mVisibilityManager = visManager; 605 605 } 606 606 607 GtpVisibility::VisibilityManager * KdTreeSceneManager::getVisibilityManager()607 GtpVisibility::VisibilityManager * BvHierarchySceneManager::getVisibilityManager() 608 608 { 609 609 return mVisibilityManager; 610 610 } 611 611 612 GtpVisibility::VisibilityManager * KdTreeSceneManager::GetVisibilityManager()612 GtpVisibility::VisibilityManager * BvHierarchySceneManager::GetVisibilityManager() 613 613 { 614 614 return mVisibilityManager; 615 615 } 616 616 617 KdTreeHierarchyInterface * KdTreeSceneManager::GetHierarchyInterface()617 BvHierarchyInterface * BvHierarchySceneManager::GetHierarchyInterface() 618 618 { 619 619 return mHierarchyInterface; 620 620 } 621 621 622 Camera* KdTreeSceneManager::createCamera(const String& name)622 Camera* BvHierarchySceneManager::createCamera(const String& name) 623 623 { 624 624 // Check name not used … … 637 637 } 638 638 639 SceneNode* KdTreeSceneManager::createSceneNode(void)640 { 641 SceneNode* sn = new KdTreeSceneNode(this);639 SceneNode* BvHierarchySceneManager::createSceneNode(void) 640 { 641 SceneNode* sn = new BvHierarchySceneNode(this); 642 642 assert(mSceneNodes.find(sn->getName()) == mSceneNodes.end()); 643 643 mSceneNodes[sn->getName()] = sn; … … 645 645 } 646 646 647 SceneNode* KdTreeSceneManager::createSceneNode(const String& name)647 SceneNode* BvHierarchySceneManager::createSceneNode(const String& name) 648 648 { 649 649 // Check name not used … … 653 653 Exception::ERR_DUPLICATE_ITEM, 654 654 "A scene node with the name " + name + " already exists", 655 " KdTreeSceneManager::createSceneNode" );656 } 657 658 SceneNode* sn = new KdTreeSceneNode(this, name);655 "BvHierarchySceneManager::createSceneNode" ); 656 } 657 658 SceneNode* sn = new BvHierarchySceneNode(this, name); 659 659 mSceneNodes[sn->getName()] = sn; 660 660 return sn; 661 661 } 662 662 663 Entity * KdTreeSceneManager::createEntity(const String& entityName, const String& meshName)663 Entity * BvHierarchySceneManager::createEntity(const String& entityName, const String& meshName) 664 664 { 665 665 Entity *ent = SceneManager::createEntity(entityName, meshName); … … 677 677 678 678 // make sure it's called only for non-empty nodes .. avoids one uneccessary funciton call 679 void KdTreeSceneManager::_updateNode(KdTreeSceneNode *node)679 void BvHierarchySceneManager::_updateNode(BvHierarchySceneNode *node) 680 680 { 681 681 //LogManager::getSingleton().logMessage("### _updateNode called for " + node->getName()); 682 682 683 /* Rebuild kdtreewhen it was wiped out683 /* Rebuild BvHierarchy when it was wiped out 684 684 * Usually this happens only before the first frame 685 685 * The initial AABB shall enclose all objects present … … 691 691 if (!mBvHierarchy) 692 692 { 693 mBvHierarchy = new KdTree(mMaxDepth, mBuildMethod);694 mBvHierarchy->build(static_cast< KdTreeSceneNode *>(mSceneRoot));693 mBvHierarchy = new BvHierarchy(mMaxDepth, mBuildMethod); 694 mBvHierarchy->build(static_cast<BvHierarchySceneNode *>(mSceneRoot)); 695 695 mBvHierarchy->setEnhancedVis(mEnhancedVisiblity); 696 696 } … … 713 713 714 714 //delete mBvHierarchy; 715 //mBvHierarchy = new KdTree(mMaxDepth);716 //mBvHierarchy->build(static_cast< KdTreeSceneNode *>(mSceneRoot));717 } 718 719 } 720 721 void KdTreeSceneManager::_updateSceneGraph(Camera* cam)715 //mBvHierarchy = new BvHierarchy(mMaxDepth); 716 //mBvHierarchy->build(static_cast<BvHierarchySceneNode *>(mSceneRoot)); 717 } 718 719 } 720 721 void BvHierarchySceneManager::_updateSceneGraph(Camera* cam) 722 722 { 723 723 mVisibilityManager->GetCullingManager()->SetHierarchyInterface(mHierarchyInterface); … … 727 727 } 728 728 729 void KdTreeSceneManager::_findVisibleObjects(Camera *cam, bool onlyShadowCasters)730 { 731 if (mRenderMethod == KdTree::KDRM_INTERNAL)729 void BvHierarchySceneManager::_findVisibleObjects(Camera *cam, bool onlyShadowCasters) 730 { 731 if (mRenderMethod == BvHierarchy::BVHRM_INTERNAL) 732 732 { 733 733 getRenderQueue()->clear(); … … 742 742 { 743 743 // determine visibility 744 mBvHierarchy->queueVisibleObjects( KDCAMPTR_CAST(cam), getRenderQueue(), onlyShadowCasters, mShowBoxes, mVisibleNodes);744 mBvHierarchy->queueVisibleObjects(BVHCAMPTR_CAST(cam), getRenderQueue(), onlyShadowCasters, mShowBoxes, mVisibleNodes); 745 745 // apply view cell pvs 746 746 updatePvs(cam); … … 767 767 getRenderQueue()->clear(); 768 768 if (mBvHierarchy) 769 mBvHierarchy->queueVisibleObjects( KDCAMPTR_CAST(cam), getRenderQueue(), onlyShadowCasters, mShowBoxes, mVisibleNodes);769 mBvHierarchy->queueVisibleObjects(BVHCAMPTR_CAST(cam), getRenderQueue(), onlyShadowCasters, mShowBoxes, mVisibleNodes); 770 770 } 771 771 … … 781 781 } 782 782 783 void KdTreeSceneManager::_renderVisibleObjects()784 { 785 if (mRenderMethod == KdTree::KDRM_INTERNAL)783 void BvHierarchySceneManager::_renderVisibleObjects() 784 { 785 if (mRenderMethod == BvHierarchy::BVHRM_INTERNAL) 786 786 { 787 787 SceneManager::_renderVisibleObjects(); … … 884 884 if (mUseDepthPass) 885 885 { 886 KdTree::NodeList::const_iterator it, end = mVisibleNodes.end();886 BvHierarchy::NodeList::const_iterator it, end = mVisibleNodes.end(); 887 887 for (it = mVisibleNodes.begin(); it != end; it++) 888 888 { … … 917 917 918 918 919 void KdTreeSceneManager::_renderNode(KdTree::NodePtr node, Camera * cam,919 void BvHierarchySceneManager::_renderNode(BvHierarchy::NodePtr node, Camera * cam, 920 920 bool onlyShadowCasters, int leavePassesInQueue) 921 921 { … … 932 932 933 933 //----------------------------------------------------------------------- 934 const Pass * KdTreeSceneManager::_setPass(const Pass* pass, bool evenIfSuppressed)935 { 936 if (mRenderMethod == KdTree::KDRM_INTERNAL)934 const Pass *BvHierarchySceneManager::_setPass(const Pass* pass, bool evenIfSuppressed) 935 { 936 if (mRenderMethod == BvHierarchy::BVHRM_INTERNAL) 937 937 { 938 938 return SceneManager::_setPass(pass); … … 1007 1007 } 1008 1008 //----------------------------------------------------------------------- 1009 void KdTreeSceneManager::renderBasicQueueGroupObjects(RenderQueueGroup* pGroup,1009 void BvHierarchySceneManager::renderBasicQueueGroupObjects(RenderQueueGroup* pGroup, 1010 1010 QueuedRenderableCollection::OrganisationMode om) 1011 1011 { … … 1028 1028 1029 1029 // Do transparents (always descending) 1030 if (mRenderMethod == KdTree::KDRM_INTERNAL || !mSkipTransparents)1030 if (mRenderMethod == BvHierarchy::BVHRM_INTERNAL || !mSkipTransparents) 1031 1031 { 1032 1032 renderObjects(pPriorityGrp->getTransparents(), … … 1038 1038 } 1039 1039 //----------------------------------------------------------------------- 1040 bool KdTreeSceneManager::validatePassForRendering(Pass* pass)1041 { 1042 if (mRenderMethod == KdTree::KDRM_INTERNAL)1040 bool BvHierarchySceneManager::validatePassForRendering(Pass* pass) 1041 { 1042 if (mRenderMethod == BvHierarchy::BVHRM_INTERNAL) 1043 1043 { 1044 1044 return SceneManager::validatePassForRendering(pass); … … 1059 1059 } 1060 1060 //----------------------------------------------------------------------- 1061 void KdTreeSceneManager::_renderQueueGroupObjects(RenderQueueGroup* pGroup,1061 void BvHierarchySceneManager::_renderQueueGroupObjects(RenderQueueGroup* pGroup, 1062 1062 QueuedRenderableCollection::OrganisationMode om) 1063 1063 { 1064 if (mRenderMethod == KdTree::KDRM_INTERNAL || !mIsItemBufferPhase)1064 if (mRenderMethod == BvHierarchy::BVHRM_INTERNAL || !mIsItemBufferPhase) 1065 1065 { 1066 1066 SceneManager::_renderQueueGroupObjects(pGroup, om); … … 1081 1081 } 1082 1082 //----------------------------------------------------------------------- 1083 void KdTreeSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(1083 void BvHierarchySceneManager::renderAdditiveStencilShadowedQueueGroupObjects( 1084 1084 RenderQueueGroup* pGroup, QueuedRenderableCollection::OrganisationMode om) 1085 1085 { … … 1115 1115 } 1116 1116 //----------------------------------------------------------------------- 1117 void KdTreeSceneManager::renderModulativeStencilShadowedQueueGroupObjects(1117 void BvHierarchySceneManager::renderModulativeStencilShadowedQueueGroupObjects( 1118 1118 RenderQueueGroup* pGroup, QueuedRenderableCollection::OrganisationMode om) 1119 1119 { … … 1140 1140 } 1141 1141 //----------------------------------------------------------------------- 1142 void KdTreeSceneManager::InitDepthPass()1142 void BvHierarchySceneManager::InitDepthPass() 1143 1143 { 1144 1144 MaterialPtr depthMat = MaterialManager::getSingleton().getByName("Visibility/DepthPass"); … … 1161 1161 } 1162 1162 //----------------------------------------------------------------------- 1163 void KdTreeSceneManager::InitItemBufferPass()1163 void BvHierarchySceneManager::InitItemBufferPass() 1164 1164 { 1165 1165 MaterialPtr itemBufferMat = MaterialManager::getSingleton(). … … 1185 1185 } 1186 1186 //----------------------------------------------------------------------- 1187 void KdTreeSceneManager::PrepareVisualization(Camera *cam)1187 void BvHierarchySceneManager::PrepareVisualization(Camera *cam) 1188 1188 { 1189 1189 // add player camera for visualization purpose … … 1206 1206 unsigned long frameid = 0; 1207 1207 1208 if (mRenderMethod == KdTree::KDRM_INTERNAL)1208 if (mRenderMethod == BvHierarchy::BVHRM_INTERNAL) 1209 1209 frameid = Root::getSingleton().getCurrentFrameNumber(); 1210 1210 else 1211 1211 frameid = mHierarchyInterface->GetFrameId(); 1212 1212 1213 for ( KdTree::NodeList::iterator it = mVisibleNodes.begin(); it != mVisibleNodes.end(); ++it)1213 for (BvHierarchy::NodeList::iterator it = mVisibleNodes.begin(); it != mVisibleNodes.end(); ++it) 1214 1214 { 1215 1215 if (mRenderNodesForViz && (*it)->isLeaf()) 1216 1216 { 1217 1217 WireBoundingBox * wirebox = (*it)->getWireBoundingBox(); 1218 wirebox->setMaterial(" KdTree/BoxViz");1218 wirebox->setMaterial("BvHierarchy/BoxViz"); 1219 1219 getRenderQueue()->addRenderable(wirebox); 1220 1220 } … … 1228 1228 } 1229 1229 //----------------------------------------------------------------------- 1230 void KdTreeSceneManager::InitVisibilityCulling(Camera *cam)1230 void BvHierarchySceneManager::InitVisibilityCulling(Camera *cam) 1231 1231 { 1232 1232 // reset culling manager stats … … 1300 1300 1301 1301 //------------------------------------------------------------------------- 1302 void KdTreeSceneManager::SetObjectsVisible(const bool visible)1302 void BvHierarchySceneManager::SetObjectsVisible(const bool visible) 1303 1303 { 1304 1304 GtpVisibilityPreprocessor::ObjectContainer::iterator it, it_end = mObjects.end(); … … 1313 1313 } 1314 1314 //----------------------------------------------------------------------- 1315 bool KdTreeSceneManager::LoadViewCells(const String &filename)1315 bool BvHierarchySceneManager::LoadViewCells(const String &filename) 1316 1316 { 1317 1317 // objects are set to invisible initially 1318 1318 SetObjectsVisible(false); 1319 1319 1320 const string bboxesFilename = mVisibilityManager->GetVisibilityEnvironment()->getViewCellsFileName(); 1320 const string bboxesFilename = 1321 mVisibilityManager->GetVisibilityEnvironment()->getViewCellsFileName(); 1321 1322 1322 1323 // converter between view cell ids and Ogre entites 1323 1324 GtpVisibilityPreprocessor::IndexedBoundingBoxContainer iboxes; 1325 #if 0 1324 1326 OgreBoundingBoxConverter bconverter(this); 1325 1327 … … 1329 1331 1330 1332 return (mViewCellsManager != NULL); 1333 #endif 1331 1334 } 1332 1335 //------------------------------------------------------------------------- 1333 void KdTreeSceneManager::applyViewCellPvs(GtpVisibilityPreprocessor::ViewCell *vc,1336 void BvHierarchySceneManager::applyViewCellPvs(GtpVisibilityPreprocessor::ViewCell *vc, 1334 1337 const bool load) 1335 1338 { // NOTE: should not happen, rather apply view cell representing unbounded space then … … 1356 1359 } 1357 1360 //------------------------------------------------------------------------- 1358 void KdTreeSceneManager::updatePvs(Camera *cam)1361 void BvHierarchySceneManager::updatePvs(Camera *cam) 1359 1362 { 1360 1363 if (!(mViewCellsLoaded && mUseViewCells)) … … 1406 1409 1407 1410 //----------------------------------------------------------------------- 1408 void KdTreeSceneManager::WriteLog()1411 void BvHierarchySceneManager::WriteLog() 1409 1412 { 1410 1413 std::stringstream d; … … 1427 1430 1428 1431 /************************************************************************/ 1429 /* Factory for KdTreeSceneManager */1432 /* Factory for BvHierarchySceneManager */ 1430 1433 /************************************************************************/ 1431 1434 //----------------------------------------------------------------------- 1432 1435 //----------------------------------------------------------------------- 1433 const String BvHierarchySceneManagerFactory::FACTORY_TYPE_NAME = " KdTreeSceneManager";1436 const String BvHierarchySceneManagerFactory::FACTORY_TYPE_NAME = "BvHierarchySceneManager"; 1434 1437 //----------------------------------------------------------------------- 1435 1438 void BvHierarchySceneManagerFactory::initMetaData(void) const … … 1444 1447 const String& instanceName) 1445 1448 { 1446 return new KdTreeSceneManager(instanceName, visManager);1449 return new BvHierarchySceneManager(instanceName, visManager); 1447 1450 } 1448 1451 //----------------------------------------------------------------------- -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchySceneNode.cpp
r1319 r1320 18 18 // TRIVIA: this function is _not_ called for nodes which did not change since the last frame 19 19 // only exception: the root node ... it's aabb should be null however, so we don't care 20 void KdTreeSceneNode::_updateBounds(void)20 void BvHierarchySceneNode::_updateBounds(void) 21 21 { 22 22 // Reset bounds first … … 33 33 if (!mWorldAABB.isNull()) 34 34 { 35 static_cast< KdTreeSceneManager *>(mCreator)->_updateNode(this);35 static_cast<BvHierarchySceneManager *>(mCreator)->_updateNode(this); 36 36 } 37 37 } 38 38 39 void KdTreeSceneNode::computeScene(PlaneEventList& events, AxisAlignedBox& aabb, int& nObjects, bool includeChildren)39 void BvHierarchySceneNode::computeScene(BvhPlaneEventList& events, AxisAlignedBox& aabb, int& nObjects, bool includeChildren) 40 40 { 41 41 /**************************************************************************************/ 42 42 /* HACK: do not include camera node, FUCKS UP world AABB really BAD, dunno why */ 43 /* TODO: find a generic solution where MOVABLE nodes are NOT INSERTED into the KDTREE*/43 /* TODO: find a generic solution where MOVABLE nodes are NOT INSERTED into the BvHierarchy */ 44 44 /**************************************************************************************/ 45 45 //if (mName == "PlayerCamNode") … … 55 55 if (getExcludedMovables().find(i->second->getMovableType()) == getExcludedMovables().end()) 56 56 { 57 //LogManager::getSingleton().getLog( KDTREE_LOGNAME)->logMessage("Adding movable type " + i->second->getMovableType() + " to KdTree");57 //LogManager::getSingleton().getLog(BvHierarchy_LOGNAME)->logMessage("Adding movable type " + i->second->getMovableType() + " to BvHierarchy"); 58 58 // Merge world bounds of each object 59 59 mWorldAABB.merge(i->second->getWorldBoundingBox(true)); … … 61 61 } 62 62 63 // create information for KdTree/SAH63 // create information for BvHierarchy/SAH 64 64 if (!mWorldAABB.isNull()) 65 65 { … … 71 71 72 72 // generate events 73 PlaneEvent::Dimension axes[] =74 { PlaneEvent::PED_X, PlaneEvent::PED_Y,PlaneEvent::PED_Z};73 BvhPlaneEvent::Dimension axes[] = 74 {BvhPlaneEvent::PED_X, BvhPlaneEvent::PED_Y, BvhPlaneEvent::PED_Z}; 75 75 Vector3 min = mWorldAABB.getMinimum(); 76 76 Vector3 max = mWorldAABB.getMaximum(); … … 80 80 if (min[i] == max[i]) 81 81 { 82 //e = new PlaneEvent(this, min, axes[i],PlaneEvent::PET_ON);82 //e = new BvhPlaneEvent(this, min, axes[i], BvhPlaneEvent::PET_ON); 83 83 //sceneinfo.events.push_back(*e); 84 events.push_back( PlaneEvent(this, min, axes[i],PlaneEvent::PET_ON));84 events.push_back(BvhPlaneEvent(this, min, axes[i], BvhPlaneEvent::PET_ON)); 85 85 } 86 86 else 87 87 { 88 //e = new PlaneEvent(this, min, axes[i],PlaneEvent::PET_START);88 //e = new BvhPlaneEvent(this, min, axes[i], BvhPlaneEvent::PET_START); 89 89 //sceneinfo.events.push_back(*e); 90 //e = new PlaneEvent(this, max, axes[i],PlaneEvent::PET_END);90 //e = new BvhPlaneEvent(this, max, axes[i], BvhPlaneEvent::PET_END); 91 91 //sceneinfo.events.push_back(*e); 92 events.push_back( PlaneEvent(this, min, axes[i],PlaneEvent::PET_START));93 events.push_back( PlaneEvent(this, max, axes[i],PlaneEvent::PET_END));92 events.push_back(BvhPlaneEvent(this, min, axes[i], BvhPlaneEvent::PET_START)); 93 events.push_back(BvhPlaneEvent(this, max, axes[i], BvhPlaneEvent::PET_END)); 94 94 } 95 95 } … … 102 102 for (child = mChildren.begin(); child != mChildren.end(); ++child) 103 103 { 104 KdTreeSceneNode* sceneChild = static_cast<KdTreeSceneNode*>(child->second);104 BvHierarchySceneNode* sceneChild = static_cast<BvHierarchySceneNode*>(child->second); 105 105 sceneChild->computeScene(events, aabb, nObjects); 106 106 } … … 108 108 } 109 109 110 //void KdTreeSceneNode::_findVisibleObjects(Camera* cam, RenderQueue* queue,110 //void BvHierarchySceneNode::_findVisibleObjects(Camera* cam, RenderQueue* queue, 111 111 // bool includeChildren, bool displayNodes, bool onlyShadowCasters) 112 void KdTreeSceneNode::queueObjects(Camera* cam, RenderQueue* queue, bool onlyShadowCasters)112 void BvHierarchySceneNode::queueObjects(Camera* cam, RenderQueue* queue, bool onlyShadowCasters) 113 113 { 114 114 //SceneNode::_findVisibleObjects(cam, queue, includeChildren, displayNodes, onlyShadowCasters); … … 136 136 } 137 137 138 void KdTreeSceneNode::getGeometryList(GtpVisibility::GeometryVector *geometryList)138 void BvHierarchySceneNode::getGeometryList(GtpVisibility::GeometryVector *geometryList) 139 139 { 140 140 SceneNode::ObjectIterator objIt = getAttachedObjectIterator(); … … 154 154 155 155 // recalculate the world aabb 156 AxisAlignedBox KdTreeSceneNode::getBoundingBox(void) const156 AxisAlignedBox BvHierarchySceneNode::getBoundingBox(void) const 157 157 { 158 158 return mWorldAABB; 159 159 } 160 160 161 KdTreeSceneNode::StringSet& KdTreeSceneNode::getExcludedMovables(void)161 BvHierarchySceneNode::StringSet& BvHierarchySceneNode::getExcludedMovables(void) 162 162 { 163 163 static StringSet sExluded; … … 175 175 176 176 // DEBUG 177 String KdTreeSceneNode::dumpToString(void)177 String BvHierarchySceneNode::dumpToString(void) 178 178 { 179 179 String objects; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp
r1312 r1320 25 25 { 26 26 27 enum Intersection27 enum BvhIntersection 28 28 { 29 29 OUTSIDE=0, … … 32 32 }; 33 33 34 Intersection intersect( const Ray &one, const AxisAlignedBox &two )34 static BvhIntersection intersect( const Ray &one, const AxisAlignedBox &two ) 35 35 { 36 36 // Null box? … … 99 99 /** Checks how the second box intersects with the first. 100 100 */ 101 Intersection intersect( const PlaneBoundedVolume &one, const AxisAlignedBox &two )101 static BvhIntersection intersect( const PlaneBoundedVolume &one, const AxisAlignedBox &two ) 102 102 { 103 103 // Null box? … … 146 146 /** Checks how the second box intersects with the first. 147 147 */ 148 Intersection intersect( const AxisAlignedBox &one, const AxisAlignedBox &two )148 static BvhIntersection intersect( const AxisAlignedBox &one, const AxisAlignedBox &two ) 149 149 { 150 150 // Null box? … … 180 180 /** Checks how the box intersects with the sphere. 181 181 */ 182 Intersection intersect( const Sphere &one, const AxisAlignedBox &two )182 static BvhIntersection intersect( const Sphere &one, const AxisAlignedBox &two ) 183 183 { 184 184 // Null box? … … 1512 1512 if ( !full ) 1513 1513 { 1514 Intersection isect = intersect(box, node->_getWorldAABB());1514 BvhIntersection isect = intersect(box, node->_getWorldAABB()); 1515 1515 1516 1516 if ( isect == OUTSIDE ) … … 1536 1536 else 1537 1537 { 1538 Intersection nsect = intersect(box, sn->_getWorldAABB());1538 BvhIntersection nsect = intersect(box, sn->_getWorldAABB()); 1539 1539 1540 1540 if ( nsect != OUTSIDE ) -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilitySceneManagerDll.cpp
r1273 r1320 30 30 #include <OgreLogManager.h> 31 31 32 #include "OgreBvHierarchySceneManager.h" 32 33 #include "VisibilityManager.h" 33 34 #include "VisibilityEnvironment.h" … … 39 40 40 41 41 OcclusionCullingSceneManagerFactory *occlusionCulling Plugin;42 OcclusionCullingSceneManagerFactory *occlusionCullingFactory; 42 43 KdTreeSceneManagerFactory *kdTreeFactory; 43 44 KdTerrainSceneManagerFactory *kdTerrainFactory; 45 BvHierarchySceneManagerFactory *bvHierarchyFactory; 44 46 45 47 //----------------------------------------------------------------------- … … 51 53 52 54 // Create new scene manager 53 occlusionCulling Plugin= new OcclusionCullingSceneManagerFactory(visManager);55 occlusionCullingFactory = new OcclusionCullingSceneManagerFactory(visManager); 54 56 kdTreeFactory = new KdTreeSceneManagerFactory(visManager); 55 57 kdTerrainFactory = new KdTerrainSceneManagerFactory(visManager); 58 bvHierarchyFactory = new BvHierarchySceneManagerFactory(visManager); 59 56 60 // Construct listener manager singleton 57 61 new TerrainPageSourceListenerManager(); … … 59 63 60 64 // Register 61 Root::getSingleton().addSceneManagerFactory(occlusionCulling Plugin);65 Root::getSingleton().addSceneManagerFactory(occlusionCullingFactory); 62 66 Root::getSingleton().addSceneManagerFactory(kdTreeFactory); 63 67 Root::getSingleton().addSceneManagerFactory(kdTerrainFactory); 68 Root::getSingleton().addSceneManagerFactory(bvHierarchyFactory); 64 69 } 65 70 //----------------------------------------------------------------------- 66 71 extern "C" void __declspec(dllexport) dllShutdownPlugin() 67 72 { 68 Root::getSingleton().removeSceneManagerFactory(occlusionCulling Plugin);73 Root::getSingleton().removeSceneManagerFactory(occlusionCullingFactory); 69 74 Root::getSingleton().removeSceneManagerFactory(kdTreeFactory); 70 75 Root::getSingleton().removeSceneManagerFactory(kdTerrainFactory); 76 Root::getSingleton().removeSceneManagerFactory(bvHierarchyFactory); 77 71 78 // destroy listener manager 72 79 delete TerrainPageSourceListenerManager::getSingletonPtr(); … … 78 85 //delete heightmapTerrainPageSource; 79 86 // BUG: crashes on delete!!!! FIX this 80 delete occlusionCulling Plugin;87 delete occlusionCullingFactory; 81 88 delete kdTreeFactory; 82 89 delete kdTerrainFactory; 90 delete bvHierarchyFactory; 83 91 84 92 delete visManager; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj
r1296 r1320 352 352 <Files> 353 353 <Filter 354 Name=" SceneManager_Plugins"354 Name="OcclusionCullingSceneManager" 355 355 Filter=""> 356 356 <Filter … … 382 382 </Filter> 383 383 <Filter 384 Name=" VisibilitySceneManager"384 Name="BvHierarchySceneManager" 385 385 Filter=""> 386 386 <Filter 387 Name="Header Files" 388 Filter="h;hpp;hxx;hm;inl;inc"> 389 <File 390 RelativePath="..\include\OgreBoundingBoxConverter.h"> 391 </File> 392 <File 393 RelativePath="..\include\OgreMeshInstance.h"> 394 </File> 395 <File 396 RelativePath="..\include\OgreOcclusionQueriesQueryManager.h"> 397 </File> 398 <File 399 RelativePath="..\include\OgrePlatformHierarchyInterface.h"> 400 </File> 401 <File 402 RelativePath="..\include\OgrePlatformOcclusionQuery.h"> 403 </File> 404 <File 405 RelativePath="..\include\OgrePlatformQueryManager.h"> 406 </File> 407 <File 408 RelativePath="..\include\OgreSceneContentGenerator.h"> 409 </File> 410 <File 411 RelativePath="..\include\OgreSceneNodeHierarchyInterface.h"> 412 </File> 413 <File 414 RelativePath="..\include\OgreSolidBoundingBox.h"> 415 </File> 416 <File 417 RelativePath="..\include\OgreSolidHalfBoundingBox.h"> 418 </File> 419 <File 420 RelativePath="..\include\OgreTypeConverter.h"> 421 </File> 422 <File 423 RelativePath="..\include\OgreVisibilityOptionsManager.h"> 424 </File> 425 </Filter> 426 <Filter 427 Name="Source Files" 428 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> 429 <File 430 RelativePath="..\src\OgreBoundingBoxConverter.cpp"> 431 </File> 432 <File 433 RelativePath="..\src\OgreMeshInstance.cpp"> 434 </File> 435 <File 436 RelativePath="..\src\OgreOcclusionQueriesQueryManager.cpp"> 437 </File> 438 <File 439 RelativePath="..\src\OgrePlatformHierarchyInterface.cpp"> 440 </File> 441 <File 442 RelativePath="..\src\OgrePlatformOcclusionQuery.cpp"> 443 </File> 444 <File 445 RelativePath="..\src\OgrePlatformQueryManager.cpp"> 446 </File> 447 <File 448 RelativePath="..\src\OgreSceneContentGenerator.cpp"> 449 </File> 450 <File 451 RelativePath="..\src\OgreSceneNodeHierarchyInterface.cpp"> 452 </File> 453 <File 454 RelativePath="..\src\OgreSolidBoundingBox.cpp"> 455 </File> 456 <File 457 RelativePath="..\src\OgreSolidHalfBoundingBox.cpp"> 458 </File> 459 <File 460 RelativePath="..\src\OgreTypeConverter.cpp"> 461 </File> 462 <File 463 RelativePath="..\src\OgreVisibilityOptionsManager.cpp"> 464 </File> 465 <File 466 RelativePath="..\src\OgreVisibilitySceneManagerDll.cpp"> 387 Name="src" 388 Filter=""> 389 <File 390 RelativePath=".\OgreBvHierarchy.cpp"> 391 </File> 392 <File 393 RelativePath=".\OgreBvHierarchyCamera.cpp"> 394 </File> 395 <File 396 RelativePath=".\OgreBvHierarchyInterface.cpp"> 397 </File> 398 <File 399 RelativePath=".\OgreBvHierarchySceneManager.cpp"> 400 </File> 401 <File 402 RelativePath=".\OgreBvHierarchySceneNode.cpp"> 403 </File> 404 </Filter> 405 <Filter 406 Name="include" 407 Filter=""> 408 <File 409 RelativePath="..\include\OgreBvHierarchy.h"> 410 </File> 411 <File 412 RelativePath="..\include\OgreBvHierarchyCamera.h"> 413 </File> 414 <File 415 RelativePath="..\include\OgreBvHierarchyInterface.h"> 416 </File> 417 <File 418 RelativePath="..\include\OgreBvHierarchySceneManager.h"> 419 </File> 420 <File 421 RelativePath="..\include\OgreBvHierarchySceneNode.h"> 422 </File> 423 <File 424 RelativePath="..\include\OgreBvhRenderable.h"> 467 425 </File> 468 426 </Filter> … … 563 521 </File> 564 522 </Filter> 523 </Filter> 524 <Filter 525 Name="Header Files" 526 Filter="h;hpp;hxx;hm;inl;inc"> 527 <File 528 RelativePath="..\include\OgreBoundingBoxConverter.h"> 529 </File> 530 <File 531 RelativePath="..\include\OgreMeshInstance.h"> 532 </File> 533 <File 534 RelativePath="..\include\OgreOcclusionQueriesQueryManager.h"> 535 </File> 536 <File 537 RelativePath="..\include\OgrePlatformHierarchyInterface.h"> 538 </File> 539 <File 540 RelativePath="..\include\OgrePlatformOcclusionQuery.h"> 541 </File> 542 <File 543 RelativePath="..\include\OgrePlatformQueryManager.h"> 544 </File> 545 <File 546 RelativePath="..\include\OgreSceneContentGenerator.h"> 547 </File> 548 <File 549 RelativePath="..\include\OgreSceneNodeHierarchyInterface.h"> 550 </File> 551 <File 552 RelativePath="..\include\OgreSolidBoundingBox.h"> 553 </File> 554 <File 555 RelativePath="..\include\OgreSolidHalfBoundingBox.h"> 556 </File> 557 <File 558 RelativePath="..\include\OgreTypeConverter.h"> 559 </File> 560 <File 561 RelativePath="..\include\OgreVisibilityOptionsManager.h"> 562 </File> 563 </Filter> 564 <Filter 565 Name="Source Files" 566 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> 567 <File 568 RelativePath="..\src\OgreBoundingBoxConverter.cpp"> 569 </File> 570 <File 571 RelativePath="..\src\OgreMeshInstance.cpp"> 572 </File> 573 <File 574 RelativePath="..\src\OgreOcclusionQueriesQueryManager.cpp"> 575 </File> 576 <File 577 RelativePath="..\src\OgrePlatformHierarchyInterface.cpp"> 578 </File> 579 <File 580 RelativePath="..\src\OgrePlatformOcclusionQuery.cpp"> 581 </File> 582 <File 583 RelativePath="..\src\OgrePlatformQueryManager.cpp"> 584 </File> 585 <File 586 RelativePath="..\src\OgreSceneContentGenerator.cpp"> 587 </File> 588 <File 589 RelativePath="..\src\OgreSceneNodeHierarchyInterface.cpp"> 590 </File> 591 <File 592 RelativePath="..\src\OgreSolidBoundingBox.cpp"> 593 </File> 594 <File 595 RelativePath="..\src\OgreSolidHalfBoundingBox.cpp"> 596 </File> 597 <File 598 RelativePath="..\src\OgreTypeConverter.cpp"> 599 </File> 600 <File 601 RelativePath="..\src\OgreVisibilityOptionsManager.cpp"> 602 </File> 603 <File 604 RelativePath="..\src\OgreVisibilitySceneManagerDll.cpp"> 605 </File> 565 606 </Filter> 566 607 <File
Note: See TracChangeset
for help on using the changeset viewer.