- Timestamp:
- 09/04/06 08:56:26 (18 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchySceneNode.cpp
r1319 r1320 18 18 // TRIVIA: this function is _not_ called for nodes which did not change since the last frame 19 19 // only exception: the root node ... it's aabb should be null however, so we don't care 20 void KdTreeSceneNode::_updateBounds(void)20 void BvHierarchySceneNode::_updateBounds(void) 21 21 { 22 22 // Reset bounds first … … 33 33 if (!mWorldAABB.isNull()) 34 34 { 35 static_cast< KdTreeSceneManager *>(mCreator)->_updateNode(this);35 static_cast<BvHierarchySceneManager *>(mCreator)->_updateNode(this); 36 36 } 37 37 } 38 38 39 void KdTreeSceneNode::computeScene(PlaneEventList& events, AxisAlignedBox& aabb, int& nObjects, bool includeChildren)39 void BvHierarchySceneNode::computeScene(BvhPlaneEventList& events, AxisAlignedBox& aabb, int& nObjects, bool includeChildren) 40 40 { 41 41 /**************************************************************************************/ 42 42 /* HACK: do not include camera node, FUCKS UP world AABB really BAD, dunno why */ 43 /* TODO: find a generic solution where MOVABLE nodes are NOT INSERTED into the KDTREE*/43 /* TODO: find a generic solution where MOVABLE nodes are NOT INSERTED into the BvHierarchy */ 44 44 /**************************************************************************************/ 45 45 //if (mName == "PlayerCamNode") … … 55 55 if (getExcludedMovables().find(i->second->getMovableType()) == getExcludedMovables().end()) 56 56 { 57 //LogManager::getSingleton().getLog( KDTREE_LOGNAME)->logMessage("Adding movable type " + i->second->getMovableType() + " to KdTree");57 //LogManager::getSingleton().getLog(BvHierarchy_LOGNAME)->logMessage("Adding movable type " + i->second->getMovableType() + " to BvHierarchy"); 58 58 // Merge world bounds of each object 59 59 mWorldAABB.merge(i->second->getWorldBoundingBox(true)); … … 61 61 } 62 62 63 // create information for KdTree/SAH63 // create information for BvHierarchy/SAH 64 64 if (!mWorldAABB.isNull()) 65 65 { … … 71 71 72 72 // generate events 73 PlaneEvent::Dimension axes[] =74 { PlaneEvent::PED_X, PlaneEvent::PED_Y,PlaneEvent::PED_Z};73 BvhPlaneEvent::Dimension axes[] = 74 {BvhPlaneEvent::PED_X, BvhPlaneEvent::PED_Y, BvhPlaneEvent::PED_Z}; 75 75 Vector3 min = mWorldAABB.getMinimum(); 76 76 Vector3 max = mWorldAABB.getMaximum(); … … 80 80 if (min[i] == max[i]) 81 81 { 82 //e = new PlaneEvent(this, min, axes[i],PlaneEvent::PET_ON);82 //e = new BvhPlaneEvent(this, min, axes[i], BvhPlaneEvent::PET_ON); 83 83 //sceneinfo.events.push_back(*e); 84 events.push_back( PlaneEvent(this, min, axes[i],PlaneEvent::PET_ON));84 events.push_back(BvhPlaneEvent(this, min, axes[i], BvhPlaneEvent::PET_ON)); 85 85 } 86 86 else 87 87 { 88 //e = new PlaneEvent(this, min, axes[i],PlaneEvent::PET_START);88 //e = new BvhPlaneEvent(this, min, axes[i], BvhPlaneEvent::PET_START); 89 89 //sceneinfo.events.push_back(*e); 90 //e = new PlaneEvent(this, max, axes[i],PlaneEvent::PET_END);90 //e = new BvhPlaneEvent(this, max, axes[i], BvhPlaneEvent::PET_END); 91 91 //sceneinfo.events.push_back(*e); 92 events.push_back( PlaneEvent(this, min, axes[i],PlaneEvent::PET_START));93 events.push_back( PlaneEvent(this, max, axes[i],PlaneEvent::PET_END));92 events.push_back(BvhPlaneEvent(this, min, axes[i], BvhPlaneEvent::PET_START)); 93 events.push_back(BvhPlaneEvent(this, max, axes[i], BvhPlaneEvent::PET_END)); 94 94 } 95 95 } … … 102 102 for (child = mChildren.begin(); child != mChildren.end(); ++child) 103 103 { 104 KdTreeSceneNode* sceneChild = static_cast<KdTreeSceneNode*>(child->second);104 BvHierarchySceneNode* sceneChild = static_cast<BvHierarchySceneNode*>(child->second); 105 105 sceneChild->computeScene(events, aabb, nObjects); 106 106 } … … 108 108 } 109 109 110 //void KdTreeSceneNode::_findVisibleObjects(Camera* cam, RenderQueue* queue,110 //void BvHierarchySceneNode::_findVisibleObjects(Camera* cam, RenderQueue* queue, 111 111 // bool includeChildren, bool displayNodes, bool onlyShadowCasters) 112 void KdTreeSceneNode::queueObjects(Camera* cam, RenderQueue* queue, bool onlyShadowCasters)112 void BvHierarchySceneNode::queueObjects(Camera* cam, RenderQueue* queue, bool onlyShadowCasters) 113 113 { 114 114 //SceneNode::_findVisibleObjects(cam, queue, includeChildren, displayNodes, onlyShadowCasters); … … 136 136 } 137 137 138 void KdTreeSceneNode::getGeometryList(GtpVisibility::GeometryVector *geometryList)138 void BvHierarchySceneNode::getGeometryList(GtpVisibility::GeometryVector *geometryList) 139 139 { 140 140 SceneNode::ObjectIterator objIt = getAttachedObjectIterator(); … … 154 154 155 155 // recalculate the world aabb 156 AxisAlignedBox KdTreeSceneNode::getBoundingBox(void) const156 AxisAlignedBox BvHierarchySceneNode::getBoundingBox(void) const 157 157 { 158 158 return mWorldAABB; 159 159 } 160 160 161 KdTreeSceneNode::StringSet& KdTreeSceneNode::getExcludedMovables(void)161 BvHierarchySceneNode::StringSet& BvHierarchySceneNode::getExcludedMovables(void) 162 162 { 163 163 static StringSet sExluded; … … 175 175 176 176 // DEBUG 177 String KdTreeSceneNode::dumpToString(void)177 String BvHierarchySceneNode::dumpToString(void) 178 178 { 179 179 String objects;
Note: See TracChangeset
for help on using the changeset viewer.