- Timestamp:
- 04/02/07 11:59:11 (18 years ago)
- Location:
- OGRE/trunk/ogre_changes/Ogre1.2/PlugIns/OctreeSceneManager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
OGRE/trunk/ogre_changes/Ogre1.2/PlugIns/OctreeSceneManager/include/OgreOctree.h
r2257 r2308 177 177 */ 178 178 bool isOctreeVisible(void); 179 void setOctreeFullyVisible(bool visible);180 /** Returns true if this node is markedvisible, false otherwise.179 180 /** Returns true if all children of this nodes are fully visible, false otherwise. 181 181 */ 182 182 bool isOctreeFullyVisible(void); … … 201 201 void _updateBounds(); 202 202 203 void _incNumChildren(); 204 205 void setOctreeFullyVisible(bool visible); 206 207 float getVisibilityRatio(); 208 209 void setNumVisibleLeaves(int leaves); 210 int getNumVisibleLeaves(); 211 212 void setNumLeaves(int leaves); 213 int getNumLeaves(); 214 203 215 protected: 204 216 … … 209 221 int mLastVisited; 210 222 bool mVisible; 223 211 224 bool mFullyVisible; 225 226 int mNumVisibleLeaves; 227 int mNumLeaves; 212 228 #endif // GTP_VISIBILITY_MODIFIED_OGRE 213 229 }; -
OGRE/trunk/ogre_changes/Ogre1.2/PlugIns/OctreeSceneManager/src/OgreOctree.cpp
r2257 r2308 87 87 mHalfSize( 0, 0, 0 ) 88 88 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 89 , mLastVisited(0), mVisible(false), mLastRendered(-1), mFullyVisible(false) 89 , mLastVisited(0), mVisible(false), mLastRendered(-1) 90 , mNumLeaves(1), mNumVisibleLeaves(0) 91 , mFullyVisible(false) 90 92 #endif //GTP_VISIBILITY_MODIFIED_OGRE 91 93 { … … 105 107 106 108 mNumNodes = 0; 109 110 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 111 // recursively update number of children 112 if (0) _incNumChildren(); 113 #endif; 107 114 } 108 115 … … 214 221 bool Octree::isOctreeFullyVisible() 215 222 { 223 // all childrens are visible 224 #if 0 225 return mNumChildren == mNumVisibleChildren; 226 #else 216 227 return mFullyVisible; 217 } 218 //----------------------------------------------------------------------- 228 #endif 229 } 230 //----------------------------------------------------------------------- 231 float Octree::getVisibilityRatio() 232 { 233 // all childrens are visible 234 return (float)mNumVisibleLeaves / (float)mNumLeaves; 235 } 236 //----------------------------------------------------------------------- 237 void Octree::setNumVisibleLeaves(int leaves) 238 { 239 int mNumVisibleLeaves = leaves; 240 } 241 //----------------------------------------------------------------------- 242 int Octree::getNumVisibleLeaves() 243 { 244 return mNumVisibleLeaves; 245 } 246 //----------------------------------------------------------------------- 247 void Octree::setNumLeaves(int leaves) 248 { 249 mNumLeaves = leaves; 250 } 251 //----------------------------------------------------------------------- 252 int Octree::getNumLeaves() 253 { 254 return mNumLeaves; 255 } 256 //----------------------------------------------------------------------- 219 257 Octree *Octree::getParent() 220 258 { … … 267 305 mParent->_updateBounds(); 268 306 } 269 } 307 } 308 309 310 void Octree::_incNumChildren() 311 { 312 /* ++ mNumChildren; 313 314 if (mParent) 315 { 316 mParent->_incNumChildren(); 317 }*/ 318 } 270 319 271 320 #endif //GTP_VISIBILITY_MODIFIED_OGRE
Note: See TracChangeset
for help on using the changeset viewer.