Changeset 1203 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src
- Timestamp:
- 08/13/06 21:40:58 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp
r1195 r1203 21 21 #include <OgreMaterialManager.h> 22 22 23 #define KDTREE_LOGNAME "KdTreeBuild.log"24 23 #define PLT_SIZE 101 25 24 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneNode.cpp
r1195 r1203 43 43 /* TODO: find a generic solution where MOVABLE nodes are NOT INSERTED into the KDTREE */ 44 44 /**************************************************************************************/ 45 if (mName == "PlayerCamNode")46 return;45 //if (mName == "PlayerCamNode") 46 // return; 47 47 48 48 // first compute nodes AABB … … 52 52 for (i = mObjectsByName.begin(); i != mObjectsByName.end(); ++i) 53 53 { 54 // Merge world bounds of each object 55 mWorldAABB.merge(i->second->getWorldBoundingBox(true)); 54 // ignore objects with no actual geometry like frustums & lights 55 if (getExcludedMovables().find(i->second->getMovableType()) == getExcludedMovables().end()) 56 { 57 //LogManager::getSingleton().getLog(KDTREE_LOGNAME)->logMessage("Adding movable type " + i->second->getMovableType() + " to KdTree"); 58 // Merge world bounds of each object 59 mWorldAABB.merge(i->second->getWorldBoundingBox(true)); 60 } 56 61 } 57 62 63 // create information for KdTree/SAH 58 64 if (!mWorldAABB.isNull()) 59 65 { 60 66 // merge aabb with global AABB 61 67 aabb.merge(mWorldAABB); 68 62 69 // increase object count 63 70 nObjects++; … … 68 75 Vector3 min = mWorldAABB.getMinimum(); 69 76 Vector3 max = mWorldAABB.getMaximum(); 70 //PlaneEvent * e;71 77 for (int i = 0; i < 3; i++) 72 78 { … … 148 154 149 155 // recalculate the world aabb 150 AxisAlignedBox KdTreeSceneNode::getBoundingBox( ) const156 AxisAlignedBox KdTreeSceneNode::getBoundingBox(void) const 151 157 { 152 #if 0 153 AxisAlignedBox box;158 return mWorldAABB; 159 } 154 160 155 // Update bounds from own attached objects 156 ObjectMap::const_iterator it = mObjectsByName.begin(); 157 ObjectMap::const_iterator end = mObjectsByName.end(); 158 for ( ; it != end ; ++it) 161 KdTreeSceneNode::StringSet& KdTreeSceneNode::getExcludedMovables(void) 162 { 163 static StringSet sExluded; 164 165 // initialise once 166 if (sExluded.empty()) 159 167 { 160 // Merge world bounds of each object 161 box.merge(it->second->getWorldBoundingBox(true)); 168 sExluded.insert("Camera"); 169 sExluded.insert("Frustum"); 170 sExluded.insert("Light"); 162 171 } 163 172 164 if (box.getMinimum() != mWorldAABB.getMinimum() ||box.getMaximum() != mWorldAABB.getMaximum()) 165 { 166 try 167 { 168 Log * log = LogManager::getSingleton().getLog("KdTreeBuild.log"); 169 log->logMessage("mWorldAABB was not up to date"); 170 } 171 catch (Exception) 172 { 173 // F.U. 174 } 175 } 176 177 return box; 178 #else 179 return mWorldAABB; 180 #endif 173 return sExluded; 181 174 } 182 175 183 //void KdTreeSceneNode::getRenderOperation(RenderOperation& op)184 //{185 // if (mWireBoundingBox == NULL)186 // {187 // mWireBoundingBox = new WireBoundingBox();188 // }189 190 // mWireBoundingBox->setupBoundingBox(mWorldAABB);191 // mWireBoundingBox->getRenderOperation(op);192 //}193 194 176 // DEBUG 195 String KdTreeSceneNode::dumpToString( )177 String KdTreeSceneNode::dumpToString(void) 196 178 { 197 179 String objects;
Note: See TracChangeset
for help on using the changeset viewer.