Changeset 135 for trunk/VUT/work/ogre_changes
- Timestamp:
- 06/16/05 18:13:33 (20 years ago)
- Location:
- trunk/VUT/work/ogre_changes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneManager.cpp
r131 r135 779 779 void SceneManager::_renderScene(Camera* camera, Viewport* vp, bool includeOverlays) 780 780 { 781 LogManager::getSingleton().logMessage("***********RENDER SCENE************"); 782 Root::getSingleton()._setCurrentSceneManager(this); 781 Root::getSingleton()._setCurrentSceneManager(this); 783 782 // Prep Pass for use in debug shadows 784 783 initShadowVolumeMaterials(); … … 4200 4199 void SceneManager::_renderSceneNode(Camera *cam, SceneNode *node, bool leaveTransparentsInQueue) 4201 4200 { 4201 // delete previously rendered objects from renderqueue 4202 _deleteRenderedQueueGroups(leaveTransparentsInQueue); 4203 4202 4204 node->_findVisibleObjects(cam, getRenderQueue(), false, mDisplayNodes, false); 4203 4205 SceneManager::_renderVisibleObjects(); 4204 4205 // delete all rendered objects from renderqueue4206 _deleteRenderedQueueGroups(leaveTransparentsInQueue);4207 4206 } 4208 4207 //----------------------------------------------------------------------- … … 4248 4247 void SceneManager::_renderMovableObject(MovableObject *mov, const bool leaveTransparentsInQueue) 4249 4248 { 4249 // delete previously rendered objects from renderqueue 4250 _deleteRenderedQueueGroups(leaveTransparentsInQueue); 4251 4250 4252 mov->_updateRenderQueue(getRenderQueue()); 4251 4253 SceneManager::_renderVisibleObjects(); 4252 4253 // delete rendered objects from renderqueue4254 //TODO: should be first4255 _deleteRenderedQueueGroups(leaveTransparentsInQueue);4256 4254 } 4257 4255 #endif //GTP_VISIBILITY_MODIFIED_OGRE -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h
r104 r135 157 157 158 158 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 159 public: 160 /** Returns last visited frame id. */ 161 int lastVisited(void); 162 /** Set to current frame id. 163 @param current frame id. 164 */ 165 void setLastVisited(int frameid); 166 /** Makes this octree become visible / invisble. 167 @param visible Whether this node is to be made visible or invisible 168 */ 169 void setOctreeVisible(bool visible); 170 /** Returns true if this node is marked visible, false otherwise. 171 */ 172 bool isOctreeVisible(void); 173 /** Gets this node's parent (NULL if this is the root). 174 */ 175 Octree *getParent(); 176 /** Frame id when this octree was last rendered. 177 @return last rendered frame id 178 */ 179 int lastRendered(void); 180 /** Sets frame id when this octree was last rendered. 181 @param last rendered frame id 182 */ 183 void setLastRendered(int frameid); 184 /** Returns current depth of octree 185 @return current depth 186 */ 187 int getDepth(); 188 189 protected: 190 191 int mLastRendered; 192 int mLastVisited; 193 bool mVisible; 194 int mDepth; 159 public: 160 /** Returns last visited frame id. */ 161 int lastVisited(void); 162 /** Set to current frame id. 163 @param current frame id. 164 */ 165 void setLastVisited(int frameid); 166 /** Makes this octree become visible / invisble. 167 @param visible Whether this node is to be made visible or invisible 168 */ 169 void setOctreeVisible(bool visible); 170 /** Returns true if this node is marked visible, false otherwise. 171 */ 172 bool isOctreeVisible(void); 173 /** Gets this node's parent (NULL if this is the root). 174 */ 175 Octree *getParent(); 176 /** Frame id when this octree was last rendered. 177 @return last rendered frame id 178 */ 179 int lastRendered(void); 180 /** Sets frame id when this octree was last rendered. 181 @param last rendered frame id 182 */ 183 void setLastRendered(int frameid); 184 /** Returns current depth of octree 185 @return current depth 186 */ 187 int getDepth(); 188 /** Returns real extent of the octree, i.e., the merged extent of the bounding boxes. */ 189 AxisAlignedBox _getWorldAABB(void) const; 190 191 /** Updates bounds of real aabb of octree. */ 192 void _updateBounds(); 193 194 protected: 195 196 /** the real extent of the octree. */ 197 AxisAlignedBox mWorldAABB; 198 199 int mLastRendered; 200 int mLastVisited; 201 bool mVisible; 202 int mDepth; 195 203 196 204 #endif // GTP_VISIBILITY_MODIFIED_OGRE -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctree.cpp
r115 r135 142 142 _ref(); 143 143 144 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 145 _updateBounds(); 146 #endif 147 144 148 } 145 149 … … 151 155 //update total counts. 152 156 _unref(); 157 158 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 159 _updateBounds(); 160 #endif 153 161 } 154 162 … … 165 173 mWireBoundingBox = new WireBoundingBox(); 166 174 167 mWireBoundingBox->setupBoundingBox(mBox); 175 //mWireBoundingBox->setupBoundingBox(mBox); 176 mWireBoundingBox->setupBoundingBox(mWorldAABB); 168 177 return mWireBoundingBox; 169 178 } … … 171 180 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 172 181 //----------------------------------------------------------------------- 173 int Octree::lastVisited( void)182 int Octree::lastVisited() 174 183 { 175 184 return mLastVisited; … … 181 190 } 182 191 //----------------------------------------------------------------------- 183 int Octree::lastRendered( void)192 int Octree::lastRendered() 184 193 { 185 194 return mLastRendered; … … 196 205 } 197 206 //----------------------------------------------------------------------- 198 bool Octree::isOctreeVisible( void)207 bool Octree::isOctreeVisible() 199 208 { 200 209 return mVisible; … … 210 219 return mDepth; 211 220 } 221 //----------------------------------------------------------------------- 222 AxisAlignedBox Octree::_getWorldAABB(void) const 223 { 224 return mWorldAABB; 225 } 226 //----------------------------------------------------------------------- 227 void Octree::_updateBounds() 228 { 229 // Reset bounds first 230 mWorldAABB.setNull(); 231 232 // Update bounds from own attached objects 233 NodeList::iterator it, it_end; 234 it_end = mNodes.end(); 235 236 for (it = mNodes.begin(); it != it_end; ++it) 237 { 238 // Merge world bounds of each object 239 mWorldAABB.merge((*it)->_getWorldAABB()); 240 } 241 242 // Merge with children 243 for (int i = 0; i < 2; ++i) 244 { 245 for (int j = 0; j < 2; ++j) 246 { 247 for (int k = 0; k < 2; ++k) 248 { 249 if (mChildren[i][j][k] != 0) 250 { 251 mWorldAABB.merge(mChildren[i][j][k]->_getWorldAABB()); 252 } 253 } 254 } 255 } 256 // recursively update parent bounds 257 if (mParent) 258 { 259 mParent->_updateBounds(); 260 } 261 } 212 262 #endif //GTP_VISIBILITY_MODIFIED_OGRE 213 263 } -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeSceneManager.cpp
r115 r135 428 428 _addOctreeNode( onode, mOctree ); 429 429 } 430 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 431 else // still update because bounding box may be different 432 { 433 onode -> getOctant() -> _updateBounds(); 434 } 435 #endif // GTP_VISIBILITY_MODIFIED_OGRE 430 436 } 431 437 … … 1172 1178 bool leaveTransparentsInQueue)//, bool useZPassQueue) 1173 1179 { 1180 // delete previously rendered objects from the render queue 1181 _deleteRenderedQueueGroups(leaveTransparentsInQueue); 1182 1174 1183 //Add stuff to be rendered; 1175 1184 NodeList::iterator it = octant->mNodes.begin(); … … 1211 1220 //-- the actual rendering 1212 1221 SceneManager::_renderVisibleObjects(); 1213 // delete all rendered objects from the render queue1214 _deleteRenderedQueueGroups(leaveTransparentsInQueue);1215 1222 } 1216 1223 #endif // GTP_VISIBILITY_MODIFIED_OGRE
Note: See TracChangeset
for help on using the changeset viewer.