Changeset 1190 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Timestamp:
- 08/09/06 13:41:12 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h
r1187 r1190 232 232 if (mLevel == level) 233 233 { 234 //mWBB->setMaterial("BaseGreenNoLighting"); 235 mWBB->setMaterial("aabbHiLite"); 234 mWBB->setMaterial("KdTree/BoxHiLite"); 236 235 return mWBB; 237 236 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp
r1187 r1190 311 311 mShowNodeAABB(true) 312 312 { 313 #ifdef KDTREE_DEBUG 314 MaterialPtr mp = MaterialManager::getSingleton().getByName("aabbHiLite"); 315 if (mp.isNull()) 316 { 317 ColourValue cv(0.0, 1.0, 0.0); 318 MaterialPtr mp = MaterialManager::getSingleton().create("aabbHiLite","General"); 319 mp->setSelfIllumination(cv); 320 mp->setDiffuse(cv); 321 } 322 #endif 313 MaterialPtr mphi = MaterialManager::getSingleton().getByName("KdTree/BoxHiLite"); 314 if (mphi.isNull()) 315 { 316 ColourValue green(0, 1, 0); 317 mphi = MaterialManager::getSingleton().create("KdTree/BoxHiLite", "General"); 318 mphi->setAmbient(green); 319 mphi->setDiffuse(green); 320 mphi->setSelfIllumination(ColourValue::Black); 321 mphi->setLightingEnabled(true); 322 mphi->getTechnique(0)->getPass(0)->removeAllTextureUnitStates(); 323 } 324 325 MaterialPtr mpviz = MaterialManager::getSingleton().getByName("KdTree/BoxViz"); 326 if (mpviz.isNull()) 327 { 328 ColourValue yellow(1, 1, 0); 329 mpviz = MaterialManager::getSingleton().create("KdTree/BoxViz", "General"); 330 mpviz->setAmbient(yellow); 331 mpviz->setDiffuse(yellow); 332 mpviz->setSelfIllumination(ColourValue::Black); 333 mpviz->setLightingEnabled(true); 334 mpviz->getTechnique(0)->getPass(0)->removeAllTextureUnitStates(); 335 } 336 323 337 try 324 338 { -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp
r1187 r1190 590 590 } 591 591 592 mVisibleNodes.clear(); 592 mVisibleNodes.clear(); 593 593 } 594 594 … … 951 951 // ignore 952 952 } 953 // add bounding boxes of rendered objects954 //if (0)955 //for (BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it)956 //{957 // getRenderQueue()->addRenderable(*it);958 //}959 953 960 954 if (mRenderNodesForViz || mRenderNodesContentForViz) 961 955 { 962 956 // HACK: change node material so it is better suited for visualization 963 MaterialPtr nodeMat = MaterialManager::getSingleton().getByName("Core/NodeMaterial"); 964 nodeMat->setAmbient(1, 1, 0); 965 nodeMat->setLightingEnabled(true); 966 nodeMat->getTechnique(0)->getPass(0)->removeAllTextureUnitStates(); 957 //MaterialPtr nodeMat = MaterialManager::getSingleton().getByName("Core/NodeMaterial"); 967 958 968 959 for (KdTree::NodeList::iterator it = mVisibleNodes.begin(); it != mVisibleNodes.end(); ++it) … … 970 961 if (mRenderNodesForViz) 971 962 { 972 //KdTreeSceneNode * node = static_cast<KdTreeSceneNode *>(*it); 973 //// render the leaf nodes 974 //if (node->numAttachedObjects() && 975 // !node->numChildren() && 976 // (node->getAttachedObject(0)->getMovableType() == "Entity") && 977 // node->getAttachedObject(0)->isVisible()) 978 //{ 979 // //getRenderQueue()->addRenderable(node); 980 // node->_addBoundingBoxToQueue(getRenderQueue()); 981 //} 982 983 /*** TODO: fix this ... maybe revert to original state, not quite happy now! ***/ 984 985 // addbounding boxes instead of node itself 986 //(*it)->_addBoundingBoxToQueue(getRenderQueue()); 963 WireBoundingBox * wirebox = (*it)->getWireBoundingBox(); 964 if (wirebox) 965 getRenderQueue()->addRenderable(wirebox); 987 966 } 988 967 // add renderables itself 989 968 if (mRenderNodesContentForViz) 990 969 { 991 //(*it)->queueObjects(cam, getRenderQueue(), false);992 970 (*it)->queueVisibleObjects(mHierarchyInterface->GetFrameId(), 993 cam, getRenderQueue(), false, mShowBoxes);971 cam, getRenderQueue(), false, true); 994 972 } 995 973 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneNode.cpp
r1187 r1190 39 39 void KdTreeSceneNode::computeScene(PlaneEventList& events, AxisAlignedBox& aabb, int& nObjects, bool includeChildren) 40 40 { 41 /**************************************************************************************/ 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 */ 44 /**************************************************************************************/ 45 if (mName == "PlayerCamNode") 46 return; 47 41 48 // first compute nodes AABB 42 49 mWorldAABB.setNull();
Note: See TracChangeset
for help on using the changeset viewer.