- Timestamp:
- 07/06/05 11:04:25 (19 years ago)
- Location:
- trunk/VUT
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/include/HierarchyInterface.h
r155 r158 14 14 typedef std::pair<HierarchyNode *, OcclusionQuery *> QueryPair; 15 15 typedef std::queue<QueryPair> QueryQueue; 16 typedef std::stack<HierarchyNode *> TraversalStack; 16 17 17 18 18 /** Class which implements a hierarchy interface for a scene hierarchy. … … 33 33 @param node the hierarchy node 34 34 */ 35 virtual void Traverse AndRenderNode(HierarchyNode *node) = 0;35 virtual void TraverseNode(HierarchyNode *node) = 0; 36 36 /** Renders current hierarchy node. 37 37 @param node current hierarchy node to be rendered … … 56 56 */ 57 57 HierarchyNode *GetHierarchyRoot() const; 58 /** Sets the scene root and initialises this hierarchy interface for a traversal. 59 @param frontToBack 60 if traversal is initialised for front-to-back rendering or 61 simple traversal of the nodes. 58 /** Sets the scene root and initialises this hierarchy interface for a traversal. 62 59 @remark also resets the statistics evaluated in the last traversal 63 60 */ 64 void InitTraversal( bool frontToBack = true);61 void InitTraversal(); 65 62 /** Returns current frame id. 66 63 @returns frame id … … 152 149 virtual void RenderGeometry(GtpVisibility::Mesh *geom) = 0; 153 150 154 /** Sets node id to specified value. 155 */ 156 virtual void SetNodeId(HierarchyNode *node, int id) = 0; 157 /** Returns id of given node. 158 */ 159 virtual int GetNodeId(HierarchyNode *node) = 0; 160 151 161 152 /** This is an optimization when issuing the occlusion test. 162 153 The test is done with actual geometry rather than the bounding 163 box of leave nodes previously marked as visible 154 box of leave nodes previously marked as visible. 155 164 156 @param testGeometry if this optimization should be used 165 157 @remark this option is only useful for the coherent hierarchical culling algorithm … … 167 159 void TestGeometryForVisibleLeaves(bool testGeometry); 168 160 169 /** 170 Traverses hierarchy and returns next node. 171 @returns next node in hierarchy. 172 */ 173 virtual HierarchyNode *GetNextNode() = 0; 161 174 162 175 163 protected: 176 164 /// chc optimization for testing geometry of leaves instead of bounding box 177 165 bool mTestGeometryForVisibleLeaves; 178 166 /// the current frame number 179 167 unsigned int mFrameId; 180 168 /// points to the last occlusion query in the query list 181 169 int mCurrentTestIdx; 182 170 183 171 /// number of traversed nodes 184 172 unsigned int mNumTraversedNodes; 185 /// the distance queue used for rendering of nodes in front to back order. 173 174 /// The queue is useful for rendering hierarchy nodes in front to back order. 186 175 DistanceQueue *mDistanceQueue; 187 /// internal structure for traversal188 TraversalStack *mTraversalStack;189 176 190 177 /// the root of the hierarchy 191 178 HierarchyNode *mHierarchyRoot; 192 179 193 // buffer for a node pointer180 /// buffer for a node pointer 194 181 HierarchyNode *mSavedNode; 195 182 /// list of rendered hierarchy nodes (e.g., useful for exact visibility queries) 196 183 std::vector<HierarchyNode *> mRenderedNodes; 197 184 }; -
trunk/VUT/GtpVisibility/src/CoherentHierarchicalCullingManager.cpp
r155 r158 40 40 { 41 41 mHierarchyInterface->PullUpVisibility(node); 42 mHierarchyInterface->Traverse AndRenderNode(node);42 mHierarchyInterface->TraverseNode(node); 43 43 } 44 44 else … … 111 111 if (wasVisible) 112 112 { 113 mHierarchyInterface->Traverse AndRenderNode(node);113 mHierarchyInterface->TraverseNode(node); 114 114 } 115 115 } … … 145 145 146 146 mHierarchyInterface->PullUpVisibility(node); 147 mHierarchyInterface->Traverse AndRenderNode(node);147 mHierarchyInterface->TraverseNode(node); 148 148 } 149 149 -
trunk/VUT/GtpVisibility/src/FrustumCullingManager.cpp
r155 r158 28 28 { 29 29 mHierarchyInterface->SetNodeVisible(node, true); 30 mHierarchyInterface->Traverse AndRenderNode(node);30 mHierarchyInterface->TraverseNode(node); 31 31 } 32 32 } -
trunk/VUT/GtpVisibility/src/HierarchyInterface.cpp
r155 r158 11 11 { 12 12 mDistanceQueue = new DistanceQueue(GreaterDistance<HierarchyNode *>(this)); 13 mTraversalStack = new std::stack<HierarchyNode *>;14 13 } 15 14 //----------------------------------------------------------------------- … … 17 16 { 18 17 delete mDistanceQueue; 19 delete mTraversalStack;20 18 } 21 19 //----------------------------------------------------------------------- … … 25 23 } 26 24 //----------------------------------------------------------------------- 27 void HierarchyInterface::InitTraversal( bool frontToBack)25 void HierarchyInterface::InitTraversal() 28 26 { 29 27 // initialise for front-to-back rendering 30 if (frontToBack)31 {32 ++ mFrameId;33 mCurrentTestIdx = 0;34 mNumTraversedNodes = 0;35 mRenderedNodes.clear();36 28 37 mDistanceQueue->push(mHierarchyRoot);38 }39 else 40 { // initialise for simple node traversal41 mTraversalStack->push(mHierarchyRoot); 42 }29 ++ mFrameId; 30 mCurrentTestIdx = 0; 31 mNumTraversedNodes = 0; 32 mRenderedNodes.clear(); 33 34 mDistanceQueue->push(mHierarchyRoot); 43 35 } 44 36 //----------------------------------------------------------------------- -
trunk/VUT/GtpVisibility/src/StopAndWaitCullingManager.cpp
r155 r158 31 31 { 32 32 mHierarchyInterface->SetNodeVisible(node, true); 33 mHierarchyInterface->Traverse AndRenderNode(node);33 mHierarchyInterface->TraverseNode(node); 34 34 } 35 35 else … … 45 45 if (visiblePixels > mVisibilityThreshold) 46 46 { 47 mHierarchyInterface->Traverse AndRenderNode(node);47 mHierarchyInterface->TraverseNode(node); 48 48 } 49 49 else -
trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h
r155 r158 24 24 @remark pushes children on the distance queue 25 25 */ 26 void Traverse AndRenderNode(GtpVisibility::HierarchyNode *node);26 void TraverseNode(GtpVisibility::HierarchyNode *node); 27 27 void RenderNode(GtpVisibility::HierarchyNode *node); 28 28 bool IsLeaf(GtpVisibility::HierarchyNode *node) const; -
trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h
r155 r158 27 27 void PullUpVisibility(GtpVisibility::HierarchyNode *node); 28 28 29 /** Traverses given node.29 /** Traverses and renders the given node. 30 30 @param node current node 31 31 @remark pushes children on a distance queue. 32 32 */ 33 void TraverseAndRenderNode(GtpVisibility::HierarchyNode *node); 33 void TraverseNode(GtpVisibility::HierarchyNode *node); 34 /** @copydoc HierarchyInterface::RenderNode */ 34 35 void RenderNode(GtpVisibility::HierarchyNode *node); 35 36 bool IsLeaf(GtpVisibility::HierarchyNode *node) const; … … 50 51 bool includeChildren); 51 52 52 void SetNodeId(GtpVisibility::HierarchyNode *node, int id);53 54 int GetNodeId(GtpVisibility::HierarchyNode *node);55 56 GtpVisibility::HierarchyNode *GetNextNode();57 58 53 protected: 59 54 /** Returns pointer to the bounding box of the node. … … 67 62 */ 68 63 Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const; 69 70 int mCurrentOctreePosition;71 64 }; 72 65 } // namespace Ogre -
trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h
r155 r158 24 24 bool IsLeaf(GtpVisibility::HierarchyNode *node) const; 25 25 26 void Traverse AndRenderNode(GtpVisibility::HierarchyNode *node);26 void TraverseNode(GtpVisibility::HierarchyNode *node); 27 27 void RenderNode(GtpVisibility::HierarchyNode *node); 28 28 void PullUpVisibility(GtpVisibility::HierarchyNode *node); … … 41 41 void VisualizeCulledNode(GtpVisibility::HierarchyNode *node, 42 42 GtpVisibility::CullingType type); 43 44 /*bool FindVisibleObjects(GtpVisibility::HierarchyNode *node,45 InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,46 bool includeChildren = false);*/47 43 48 44 void GetNodeGeometryList(GtpVisibility::HierarchyNode *node, … … 50 46 bool includeChildren); 51 47 52 void SetNodeId(GtpVisibility::HierarchyNode *node, int id);53 54 int GetNodeId(GtpVisibility::HierarchyNode *node);55 56 GtpVisibility::HierarchyNode *GetNextNode();57 48 }; 58 49 -
trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h
r156 r158 11 11 #include "OgrePlatformQueryManager.h" 12 12 #include "VisibilityManager.h" 13 #include <OgreSolidBoundingBox.h>14 13 15 14 … … 97 96 */ 98 97 void PrepareVisualization(Camera *cam); 99 98 /** Initialises necessary parameters for hierarchical visibility culling. 99 */ 100 100 void InitVisibilityCulling(Camera *cam); 101 101 102 102 /// the interface to the scene hierarchy. 103 103 OctreeHierarchyInterface *mHierarchyInterface; 104 /// manages all visibility options 104 105 GtpVisibility::VisibilityManager *mVisibilityManager; 105 106 107 /// if a visualization of the hierarchical culling is shown 106 108 bool mShowVisualization; 109 110 /// if the culled nodes are indicated in the visualization 107 111 bool mVisualizeCulledNodes; 108 112 113 /// if symbols for the nodes are shown in the visualization 109 114 bool mRenderNodesForViz; 115 /// if content of the nodes is shown in the visualization 110 116 bool mRenderNodesContentForViz; 117 118 /// if we render transparents after the hierarchical traversal 111 119 bool mDelayRenderTransparents; 120 121 /// if we use a depth pass (i.e., fill only the depth buffer in the first pass) 112 122 bool mUseDepthPass; 123 /// if we currently render the depth pass 113 124 bool mRenderDepthPass; 125 126 /// if we use an item buffer for rendering (i.e., object ids as color codes 127 bool mUseItemBuffer; 128 /// if we currently render the item buffer 114 129 bool mRenderItemBuffer; 115 bool mUseItemBuffer; 130 131 /// if depth write should be enabled 116 132 bool mEnableDepthWrite; 133 /// if transparents are skipped during rendering 117 134 bool mSkipTransparents; 118 135 136 /// the depth pass (no lighting, just filling the depth buffer) 119 137 Pass *mDepthPass; 120 138 Pass *mItemBufferPass; 121 139 122 140 int mCurrentEntityId; 123 141 /// flag for passes which should not be deleted from queue during first traversal 124 142 int mLeavePassesInQueue; 125 143 ShadowTechnique mSavedShadowTechnique; 126 127 bool mRenderHierarchyNodes;128 129 std::vector<SolidBoundingBox *> mSolidBoxes;130 144 }; 131 145 -
trunk/VUT/Ogre/src/OgreBspHierarchyInterface.cpp
r155 r158 12 12 } 13 13 //----------------------------------------------------------------------- 14 void BspHierarchyInterface::Traverse AndRenderNode(GtpVisibility::HierarchyNode *node)14 void BspHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node) 15 15 { 16 16 } -
trunk/VUT/Ogre/src/OgreItemBufferQueryManager.cpp
r156 r158 77 77 } 78 78 79 delete [] buf; 80 81 // ---- render visible nodes and collect node visibility 82 bool renderBoxes = true; 83 sm->setOption("RenderHierarchyNodes", &renderBoxes); 84 85 86 // --- render item buffer for visible nodes only 87 pfHierarchyInterface->GetSceneManager()->_renderScene(pCam, mViewport, false); 88 89 90 // get frame buffer for node visibility 91 buf = mViewport->getTarget()->getBufferContents(dimx, dimy); 92 93 94 // loop through frame buffer & collect visible pixels 95 for (int idx = 0; idx < dimy * dimx * 3; idx += 3) 96 { 97 // -- decode color code to receive id 98 int id = buf[idx] << 16; 99 id += buf[idx + 1] << 8; 100 id += buf[idx + 2]; 101 102 // if valid id <= add visibility (id values start at 1 103 if ((id > 0) && (id < (int)visibleNodes->size())) 104 { 105 ((*visibleNodes)[id]).AddVisibility(1, 1); 106 } 107 } 79 //-- reset options 108 80 109 81 // don't need item buffer anymore 110 82 useItemBuffer = false; 111 //sm->setOption("UseItemBuffer", &useItemBuffer); 112 113 renderBoxes = false; 114 //sm->setOption("RenderHierarchyNodes", &renderBoxes); 115 83 sm->setOption("UseItemBuffer", &useItemBuffer); 116 84 // reset initialised - flag 117 85 mWasInitialised = false; 118 119 86 // reset old overlay status 120 87 mViewport->setOverlaysEnabled(overlayEnabled); 121 88 // reset background color 122 89 mViewport->setBackgroundColour(bg); 123 90 91 // delete array storing the frame buffer 124 92 delete [] buf; 125 93 } … … 146 114 visibleGeometry->push_back(GtpVisibility::MeshInfo(it.getNext(), 0, 0)); 147 115 } 148 149 // -- initialise hierarchy interface for simple node traversal150 mHierarchyInterface->InitTraversal(false);151 152 GtpVisibility::HierarchyNode *node = NULL;153 154 int i = 1;155 156 while (node = mHierarchyInterface->GetNextNode())157 {158 mHierarchyInterface->SetNodeId(node, i++);159 visibleNodes->push_back(GtpVisibility::NodeInfo(node, 0, 0));160 }161 116 } 162 117 -
trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp
r155 r158 10 10 //----------------------------------------------------------------------- 11 11 OctreeHierarchyInterface::OctreeHierarchyInterface(OctreeSceneManager *sm, RenderSystem *rsys): 12 SceneNodeHierarchyInterface(sm, rsys) , mCurrentOctreePosition(0)12 SceneNodeHierarchyInterface(sm, rsys) 13 13 { 14 14 } 15 15 //----------------------------------------------------------------------- 16 void OctreeHierarchyInterface::Traverse AndRenderNode(GtpVisibility::HierarchyNode *node)16 void OctreeHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node) 17 17 { 18 18 ++ mNumTraversedNodes; … … 168 168 } 169 169 } 170 //-----------------------------------------------------------------------171 void OctreeHierarchyInterface::SetNodeId(GtpVisibility::HierarchyNode *node, int id)172 {173 static_cast<Octree *>(node)->setId(id);174 }175 //-----------------------------------------------------------------------176 int OctreeHierarchyInterface::GetNodeId(GtpVisibility::HierarchyNode *node)177 {178 return static_cast<Octree *>(node)->getId();179 }180 //-----------------------------------------------------------------------181 GtpVisibility::HierarchyNode *OctreeHierarchyInterface::GetNextNode()182 {183 if (mTraversalStack->empty())184 return NULL;185 186 Octree *octree = static_cast<Octree *>(mTraversalStack->top());187 mTraversalStack->pop();188 189 for(int i=0; i<8; ++i)190 {191 Octree *nextChild =192 octree->mChildren[(i & 4) >> 2][(i & 2) >> 1][i & 1];193 194 if (nextChild)195 {196 mTraversalStack->push(nextChild);197 }198 }199 200 return octree;201 }202 203 170 } // namespace Ogre -
trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
r155 r158 130 130 } 131 131 //----------------------------------------------------------------------- 132 void PlatformHierarchyInterface::InitTraversal(Camera *cam, Camera *cullCam, int leavePassesInQueue) 132 void PlatformHierarchyInterface::InitTraversal(Camera *cam, Camera *cullCam, 133 int leavePassesInQueue) 133 134 { 134 135 GtpVisibility::HierarchyInterface::InitTraversal(); -
trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp
r155 r158 17 17 } 18 18 //----------------------------------------------------------------------- 19 void SceneNodeHierarchyInterface::Traverse AndRenderNode(GtpVisibility::HierarchyNode *node)19 void SceneNodeHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node) 20 20 { 21 21 ++ mNumTraversedNodes; … … 157 157 } 158 158 } 159 //-----------------------------------------------------------------------160 void SceneNodeHierarchyInterface::SetNodeId(GtpVisibility::HierarchyNode *node, int id)161 {162 static_cast<SceneNode *>(node)->setId(id);163 }164 //-----------------------------------------------------------------------165 int SceneNodeHierarchyInterface::GetNodeId(GtpVisibility::HierarchyNode *node)166 {167 return static_cast<SceneNode *>(node)->getId();168 }169 //-----------------------------------------------------------------------170 GtpVisibility::HierarchyNode *SceneNodeHierarchyInterface::GetNextNode()171 {172 if (mTraversalStack->empty())173 return NULL;174 175 SceneNode *node = static_cast<SceneNode *>(mTraversalStack->top());176 mTraversalStack->pop();177 159 178 // internal node: add children to priority queue for further processing179 Node::ChildNodeIterator it = node->getChildIterator();180 181 while (it.hasMoreElements())182 {183 mTraversalStack->push(it.getNext());184 }185 186 return node;187 }188 160 } // namespace Ogre -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r157 r158 31 31 mEnableDepthWrite(true), 32 32 mSkipTransparents(false), 33 mSavedShadowTechnique(SHADOWTYPE_NONE), 34 mRenderHierarchyNodes(false) 35 //mRenderHierarchyNodes(true) 33 mSavedShadowTechnique(SHADOWTYPE_NONE) 36 34 { 37 35 mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); … … 210 208 void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters) 211 209 { 212 // clear list of solid boxes (used for item buffer hierarchy node rendering)213 /*for (int i=0; i<(int)mSolidBoxes.size(); ++i)214 delete mSolidBoxes[i];215 216 mSolidBoxes.clear();*/217 218 210 //-- show visible scene nodes and octree bounding boxes from last frame 219 211 if (mShowVisualization) … … 221 213 PrepareVisualization(cam); 222 214 } 223 else if (mRenderHierarchyNodes)224 {225 AxisAlignedBox aab;226 227 228 // get rendered hierarchy nodes from last frame229 GtpVisibility::HierarchyNodeList *nodeList = mHierarchyInterface->GetRenderedNodes();230 GtpVisibility::HierarchyNodeList::iterator nodeIt, nodeIt_end = nodeList->end();231 232 for (nodeIt = nodeList->begin(); nodeIt != nodeIt_end; ++nodeIt)233 {234 SolidBoundingBox *solidBox = new SolidBoundingBox();235 solidBox->SetupBoundingBox(aab);236 237 Octree *octree = static_cast<Octree *>(*nodeIt);238 solidBox->setId(octree->getId());239 mSolidBoxes.push_back(solidBox);240 241 aab = octree->_getWorldAABB();242 std::stringstream d; d << "bounding box with id: " << octree->getId() << ", " << aab << "\n";243 LogManager::getSingleton().logMessage(d.str());244 245 getRenderQueue()->addRenderable(solidBox);246 }247 }248 215 else 249 216 { … … 273 240 ColourValue savedAmbient = mAmbientLight; 274 241 275 // --- apply standard rendering for some cases 276 // e.g., visualization, shadow pass 277 278 if (mShowVisualization || mRenderHierarchyNodes || 242 // --- apply standard rendering for some cases (e.g., visualization, shadow pass) 243 244 if (mShowVisualization || 279 245 (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && 280 246 mIlluminationStage == IRS_RENDER_TO_TEXTURE)) … … 282 248 IlluminationRenderStage savedStage = mIlluminationStage; 283 249 284 if (mShowVisualization || mRenderHierarchyNodes)285 // disable illumination stage because we want noshadows250 if (mShowVisualization) 251 // disable illumination stage to prevent rendering shadows 286 252 mIlluminationStage = IRS_NONE; 287 253 … … 448 414 return true; 449 415 } 450 if (key == "RenderHierarchyNodes") 451 { 452 mRenderHierarchyNodes = (*static_cast<const bool *>(val)); 453 } 416 454 417 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 455 418 setOption(key, val) || TerrainSceneManager::setOption(key, val); -
trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp
r156 r158 453 453 ++nodesSize; 454 454 455 int id = sm->GetHierarchyInterface()->GetNodeId((*nodesIt).GetNode()); 456 std::stringstream d; d << "Node " << id << " visibility: " << vis; 455 std::stringstream d; d << "Node visibility: " << vis; 457 456 LogManager::getSingleton().logMessage(d.str()); 458 457 } -
trunk/VUT/work/ogre_changes/OgreMain/include/OgreRenderable.h
r153 r158 227 227 } 228 228 } 229 /** Sets an id for this renderable. 230 */ 229 231 void setId(int id) {mId = id;} 232 /** see set 233 */ 230 234 int getId() {return mId;} 231 235 -
trunk/VUT/work/ogre_changes/OgreMain/include/OgreSceneNode.h
r154 r158 444 444 void setLastRendered(int frameid); 445 445 446 /** Sets scene node id447 @param the id448 */449 void setId(int id);450 /** see set */451 int getId(void);452 453 446 protected: 454 447 int mLastVisited; -
trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneNode.cpp
r154 r158 42 42 mYawFixed(false), mAutoTrackTarget(0), mIsInSceneGraph(false) 43 43 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 44 , mLastVisited(0), mVisible(false), mLastRendered(-1) , mId(-1)44 , mLastVisited(0), mVisible(false), mLastRendered(-1) 45 45 #endif //GTP_VISIBILITY_MODIFIED_OGRE 46 46 { … … 53 53 mAutoTrackTarget(0), mIsInSceneGraph(false) 54 54 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 55 , mLastVisited(0), mVisible(false) , mId(-1)55 , mLastVisited(0), mVisible(false) 56 56 #endif //GTP_VISIBILITY_MODIFIED_OGRE 57 57 { … … 641 641 mLastRendered = frameid; 642 642 } 643 //-----------------------------------------------------------------------644 void SceneNode::setId(int id)645 {646 mId = id;647 }648 //-----------------------------------------------------------------------649 int SceneNode::getId(void)650 {651 return mId;652 }653 643 #endif //GTP_VISIBILITY_MODIFIED_OGRE 654 644 } -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h
r154 r158 192 192 void _updateBounds(); 193 193 194 /** Sets scene node id195 @param the id196 */197 void setId(int id);198 199 /** see set */200 int getId(void);201 202 194 protected: 203 195 … … 209 201 bool mVisible; 210 202 int mDepth; 211 int mId;203 212 204 213 205 #endif // GTP_VISIBILITY_MODIFIED_OGRE -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctree.cpp
r154 r158 88 88 mHalfSize( 0, 0, 0 ) 89 89 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 90 , mLastVisited(0), mVisible(false), mLastRendered(-1) , mId(-1)90 , mLastVisited(0), mVisible(false), mLastRendered(-1) 91 91 #endif //GTP_VISIBILITY_MODIFIED_OGRE 92 92 { … … 271 271 } 272 272 } 273 //----------------------------------------------------------------------- 274 void Octree::setId(int id) 275 { 276 mId = id; 277 } 278 //----------------------------------------------------------------------- 279 int Octree::getId() 280 { 281 return mId; 282 } 273 283 274 #endif //GTP_VISIBILITY_MODIFIED_OGRE 284 275 } -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeSceneManager.cpp
r154 r158 316 316 317 317 mOctree = new Octree( 0 ); 318 318 319 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 319 mNumOctreeNodes = 1; 320 mOctree->setId(mNumOctreeNodes); 320 mNumOctreeNodes = 1; // count number of octants 321 321 #endif // GTP_VISIBILITY_MODIFIED_OGRE 322 322 323 mMaxDepth = depth; 323 324 mBox = box; … … 469 470 octant -> mChildren[ x ][ y ][ z ] = new Octree( octant ); 470 471 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 471 mOctree->setId(++ mNumOctreeNodes);472 ++ mNumOctreeNodes; 472 473 #endif // GTP_VISIBILITY_MODIFIED_OGRE 473 474 … … 1031 1032 1032 1033 mOctree = new Octree( 0 ); 1034 1033 1035 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 1034 1036 mNumOctreeNodes = 1; 1035 mOctree->setId(mNumOctreeNodes);1036 1037 #endif // GTP_VISIBILITY_MODIFIED_OGRE 1038 1037 1039 mOctree->mBox = box; 1038 1040
Note: See TracChangeset
for help on using the changeset viewer.