Changeset 1319 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include
- Timestamp:
- 09/04/06 00:27:46 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include
- Files:
-
- 1 edited
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBvHierarchy.h
r1316 r1319 8 8 */ 9 9 10 #ifndef _Ogre KdTree_H__11 #define _Ogre KdTree_H__10 #ifndef _OgreBvHierarchy_H__ 11 #define _OgreBvHierarchy_H__ 12 12 13 13 #define KDNODE_CAST(a) (static_cast<KdTree::Node>(a)) … … 29 29 #include <stack> 30 30 31 #include "Ogre KdTreeCamera.h"31 #include "OgreBvHierarchyCamera.h" 32 32 #include "HierarchyInterface.h" 33 33 … … 35 35 namespace Ogre 36 36 { 37 class KdTreeCamera;38 class KdRenderable;37 class BvHierarchyCamera; 38 class BvRenderable; 39 39 struct SplitInfo; 40 40 … … 66 66 { }; 67 67 68 PlaneEvent( KdRenderable *rend, const Vector3& pos, PlaneEvent::Dimension dim, PlaneEvent::Type type):68 PlaneEvent(BvRenderable *rend, const Vector3& pos, PlaneEvent::Dimension dim, PlaneEvent::Type type): 69 69 mRenderable(rend), mPosition(pos), mDimension(dim), mType(type) 70 70 { }; … … 125 125 } 126 126 127 KdRenderable * getRenderable() const //??127 BvRenderable * getRenderable() const //?? 128 128 { 129 129 return mRenderable; … … 139 139 protected: 140 140 // event info 141 KdRenderable * mRenderable;141 BvRenderable * mRenderable; 142 142 Vector3 mPosition; 143 143 PlaneEvent::Dimension mDimension; … … 186 186 187 187 typedef std::list<PlaneEvent> PlaneEventList; 188 typedef std::list< KdRenderable *> KdRenderableList;188 typedef std::list<BvRenderable *> BvRenderableList; 189 189 190 190 class KdTree … … 397 397 398 398 // a leaf is empty when it does not posses renderables 399 virtual bool isEmpty() const { return m KdRenderables.empty(); }399 virtual bool isEmpty() const { return mBvRenderables.empty(); } 400 400 401 401 // a leaf has geometry when it has renderables 402 virtual bool hasGeometry() const { return !m KdRenderables.empty(); }402 virtual bool hasGeometry() const { return !mBvRenderables.empty(); } 403 403 404 404 // a leaf adds itself to the leaf set … … 417 417 virtual void _updateBounds(bool recurse = true); 418 418 419 virtual void remove( KdRenderable * rend)420 { 421 m KdRenderables.remove(rend);422 //m KdRenderables.erase(find(mKdRenderables.begin(), mKdRenderables.end(), rend));419 virtual void remove(BvRenderable * rend) 420 { 421 mBvRenderables.remove(rend); 422 //mBvRenderables.erase(find(mBvRenderables.begin(), mBvRenderables.end(), rend)); 423 423 }; 424 424 425 virtual void insert( KdRenderable * rend)426 { 427 m KdRenderables.push_back(rend);425 virtual void insert(BvRenderable * rend) 426 { 427 mBvRenderables.push_back(rend); 428 428 }; 429 429 430 KdRenderableList mKdRenderables;430 BvRenderableList mBvRenderables; 431 431 }; 432 432 … … 562 562 563 563 // insert a new scene node into an existing kd-tree 564 void insert( KdRenderable * rend);564 void insert(BvRenderable * rend); 565 565 // remove a scene node from the tree 566 void remove( KdRenderable * rend);566 void remove(BvRenderable * rend); 567 567 // function to initialize a kd-tree based on the contents of the scene 568 void build( KdRenderable * sceneRoot);568 void build(BvRenderable * sceneRoot); 569 569 570 570 // test visibility of objects and add to render queue 571 void queueVisibleObjects( KdTreeCamera* cam, RenderQueue* queue, bool onlyShadowCasters,571 void queueVisibleObjects(BvHierarchyCamera* cam, RenderQueue* queue, bool onlyShadowCasters, 572 572 bool showBoxes, KdTree::NodeList& visibleNodes); 573 573 … … 594 594 void init(); 595 595 // recursive insert funciton 596 void recInsert(KdTree::Node * node, KdRenderable * rend);596 void recInsert(KdTree::Node * node, BvRenderable * rend); 597 597 // helper functions for insert 598 void recInsertNew(KdTree::Branch * parent, PlaneEvent::Side side, KdRenderable * rend);598 void recInsertNew(KdTree::Branch * parent, PlaneEvent::Side side, BvRenderable * rend); 599 599 void splitBox(const KdTree::Branch& parent, AxisAlignedBox& left, AxisAlignedBox& right); 600 void rebuildSubtree(KdTree::Node * node, KdRenderable * rend);600 void rebuildSubtree(KdTree::Node * node, BvRenderable * rend); 601 601 // build scene from a list of nodes rather than a hierarchy 602 KdTree::Node * buildFromList( KdRenderableList& nodelist, KdTree::Branch * parent, AxisAlignedBox& aabb);603 void addRendToList(KdTree::Node * node, KdRenderableList& nodelist);602 KdTree::Node * buildFromList(BvRenderableList& nodelist, KdTree::Branch * parent, AxisAlignedBox& aabb); 603 void addRendToList(KdTree::Node * node, BvRenderableList& nodelist); 604 604 605 605 // recursively delete empty nodes … … 615 615 616 616 // recursive rendering function 617 void recQueueVisibleObjects(KdTree::Node * node, unsigned long currentFrame, KdTreeCamera* cam,617 void recQueueVisibleObjects(KdTree::Node * node, unsigned long currentFrame, BvHierarchyCamera* cam, 618 618 RenderQueue* queue, bool onlyShadowCasters, bool showBoxes, 619 619 KdTree::NodeList& visibleNodes, bool fullVis = false); … … 659 659 // allows choosing between regular vis (NONE/PART, same es isVisible) 660 660 // and enhaced vis (NONE/PART/FULL) for early traversal abort 661 KdTreeCamera::NodeVisibility (KdTreeCamera::*getVisibility)(const AxisAlignedBox& box) const;661 BvHierarchyCamera::NodeVisibility (BvHierarchyCamera::*getVisibility)(const AxisAlignedBox& box) const; 662 662 663 663 // DEBUG … … 668 668 } // namespace Ogre 669 669 670 #endif // _Ogre KdTree_H__670 #endif // _OgreBvHierarchy_H__
Note: See TracChangeset
for help on using the changeset viewer.