Changeset 164 for trunk/VUT/Ogre/src
- Timestamp:
- 07/11/05 03:25:50 (19 years ago)
- Location:
- trunk/VUT/Ogre/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/src/OgreItemBufferQueryManager.cpp
r159 r164 6 6 7 7 namespace Ogre { 8 8 9 //----------------------------------------------------------------------- 9 ItemBufferQueryManager::ItemBufferQueryManager(PlatformHierarchyInterface *hierarchyInterface, Viewport *vp, 10 ItemBufferQueryManager::ItemBufferQueryManager(PlatformHierarchyInterface *hierarchyInterface, 11 Viewport *vp, 10 12 const bool renderPatches): 11 13 PlatformQueryManager(hierarchyInterface, vp), mRenderPatchesForItemBuffer(renderPatches) … … 13 15 } 14 16 //----------------------------------------------------------------------- 15 bool ItemBufferQueryManager::ShootRay(const Ray &ray, std::vector<Mesh *> *visibleMeshes, bool isGlobalLine) 17 bool ItemBufferQueryManager::ShootRay(const Ray &ray, 18 std::vector<Mesh *> *visibleMeshes, 19 bool isGlobalLine) 16 20 { 17 21 // run OGRE ray shooting query … … 50 54 ColourValue bg = mViewport->getBackgroundColour(); 51 55 mViewport->setBackgroundColour(ColourValue(0, 0, 0, 0)); 56 pfHierarchyInterface->GetRenderSystem()->clearFrameBuffer(FBT_COLOUR | FBT_DEPTH); 52 57 58 //-- render item buffer 59 sm->_renderScene(pCam, mViewport, false); 60 //mViewport->getTarget()->update(); 53 61 54 // --- render item buffer 55 pfHierarchyInterface->GetSceneManager()->_renderScene(pCam, mViewport, false); 62 //for(int j=0; j<10000000; j++) printf("wait"); 56 63 57 64 … … 64 71 65 72 int n = mRenderPatchesForItemBuffer ? (int)visiblePatches->size() : (int)visibleGeometry->size(); 66 73 74 std::stringstream d; d << "dimx: " << dimx << ", dimy: " << dimy; 75 LogManager::getSingleton().logMessage(d.str()); 76 67 77 // loop through frame buffer & collect visible pixels 68 78 for (int idx = 0; idx < dimy * dimx * 3; idx += 3) 69 79 { 70 // 80 //-- decode color code to receive id 71 81 int id = buf[idx] << 16; 72 82 id += buf[idx + 1] << 8; 73 83 id += buf[idx + 2]; 74 84 75 // if valid id <= add visibility (id values start at 1 85 std::stringstream d; d << "myid: " << (int)buf[idx] << " " << (int)buf[idx + 1] << " " << (int)buf[idx + 2]; 86 LogManager::getSingleton().logMessage(d.str()); 87 88 // if valid id <= add visibility (id values start at 1) 76 89 if ((id > 0) && (id < n)) 77 90 { … … 144 157 145 158 subEnt->setId(id); 159 subEnt->setId((41 << 16) + (4 << 8) + 60); 160 //subEnt->setId((2 << 16) + (4 << 8) + 60); 146 161 } 147 162 -
trunk/VUT/Ogre/src/OgrePlatformQueryManager.cpp
r159 r164 49 49 50 50 // ---- capture visibility from all 6 directions 51 for (int i=0; i < 6; i++)51 for (int dir=0; dir < 6; dir++) 52 52 { 53 53 sign *= -1; … … 60 60 61 61 // prevent from initialising geometry / node array again 62 if ( i> 0)62 if (dir > 0) 63 63 { 64 64 mWasInitialised = true; … … 70 70 71 71 // permute directions 72 Vector3 dir (0,0,0);73 dir [i/2] = sign;72 Vector3 direction(0,0,0); 73 direction[dir/2] = sign; 74 74 75 cam->setDirection(dir );75 cam->setDirection(direction); 76 76 } 77 77 -
trunk/VUT/Ogre/src/OgreTerrainContentGenerator.cpp
r161 r164 16 16 RayQueryExecutor::~RayQueryExecutor() 17 17 { 18 delete mRaySceneQuery;18 OGRE_DELETE(mRaySceneQuery); 19 19 } 20 20 //----------------------------------------------------------------------- -
trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
r159 r164 739 739 } 740 740 */ 741 //----------------------------------------------------------------------- 742 /* 741 /*//----------------------------------------------------------------------- 743 742 Entity* VisibilityTerrainSceneManager::createEntity(const String& entityName, 744 743 const String& meshName) -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r160 r164 37 37 mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); 38 38 39 //mDisplayNodes = true; 40 //mShowBoundingBoxes = true; 41 //mShowBoxes = true; 39 //mDisplayNodes = true;//mShowBoundingBoxes = true;//mShowBoxes = true; 42 40 43 41 // TODO: set maxdepth to reasonable value … … 120 118 if (mRenderNodesForViz || mRenderNodesContentForViz) 121 119 { 122 // change node material so it is better suited for visualization120 // HACK: change node material so it is better suited for visualization 123 121 MaterialPtr nodeMat = MaterialManager::getSingleton().getByName("Core/NodeMaterial"); 124 122 nodeMat->setAmbient(1, 1, 0); … … 130 128 if (mRenderNodesForViz) 131 129 { 132 if (((*it)->numAttachedObjects() > 0) && ((*it)->numChildren() == 0) 133 && (*it)->getAttachedObject(0)->getMovableType() == "Entity") 134 getRenderQueue()->addRenderable((*it)); 130 // render the leaf nodes 131 if (((*it)->numAttachedObjects() > 0) && ((*it)->numChildren() == 0) && 132 (*it)->getAttachedObject(0)->getMovableType() == "Entity") 133 { 134 getRenderQueue()->addRenderable((*it)); 135 } 135 136 136 137 // addbounding boxes instead of node itself … … 508 509 } 509 510 510 // --- item buffer511 //-- item buffer 511 512 512 513 // Iterate through priorities … … 743 744 */ 744 745 //----------------------------------------------------------------------- 745 /*746 746 Entity* VisibilityTerrainSceneManager::createEntity(const String& entityName, 747 747 const String& meshName) … … 752 752 { 753 753 ent->getSubEntity(i)->setId(mCurrentEntityId); 754 ent->getSubEntity(i)->setId((41 << 16) + (4 << 8) + 60); 755 //ent->getSubEntity(i)->setId((2 << 16) + (4 << 8) + 60); 754 756 } 755 757 … … 759 761 return ent; 760 762 } 761 */762 763 } // namespace Ogre
Note: See TracChangeset
for help on using the changeset viewer.