⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ogrepaginglandscapeintersectionscenequery.cpp

📁 使用stl技术,(还没看,是听说的)
💻 CPP
字号:
/***************************************************************************
	OgrePagingLandScapeIntersectionSceneQuery.cpp  -  description
  -------------------
  begin                : Fri Aug 08 2003
  copyright            : (C) 2003 by Jose A Milan
  email                : spoke2@supercable.es
***************************************************************************/

/***************************************************************************
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU Lesser General Public License as        *
*   published by the Free Software Foundation; either version 2 of the    *
*   License, or (at your option) any later version.                       *
*                                                                         *
***************************************************************************/

#include "OgreEntity.h"

#include "OgreVector3.h"
#include "OgreColourValue.h"

#include "OgreSceneManager.h"
#include "OgreCamera.h"

#include "OgrePagingLandScapeOptions.h"

#include "OgrePagingLandScapeSceneManager.h"

#include "OgrePagingLandScapeData2DManager.h"

#include "OgrePagingLandScapeRaySceneQuery.h"
#include "OgrePagingLandScapeIntersectionSceneQuery.h"
#include "OgrePagingLandScapeCamera.h"
#include "OgrePagingLandScapePageManager.h"
#include "OgrePagingLandScapePage.h"

namespace Ogre
{

//----------------------------------------------------------------------------
void PagingLandScapeIntersectionSceneQuery::execute(IntersectionSceneQueryListener* listener)
{
	// Do movables to movables as before
	DefaultIntersectionSceneQuery::execute(listener);
	SceneQuery::WorldFragment frag;

	// Do entities to world
	SceneManager::EntityList::const_iterator a, theEnd;
	PagingLandScapeSceneManager *sceneMgr = static_cast<PagingLandScapeSceneManager*>(mParentSceneMgr);
	theEnd = sceneMgr->getEntities().end();
	for (a = sceneMgr->getEntities().begin();a != theEnd; ++a)
	{
		// Apply mask 
		if ( a->second->getQueryFlags() & mQueryMask)
		{
			const AxisAlignedBox& box = a->second->getWorldBoundingBox();
			std::list<RenderOperation> opList;

			for ( uint j = 0; j < PagingLandScapeOptions::getSingleton().world_height; j++ )
			{
				for ( uint i = 0; i < PagingLandScapeOptions::getSingleton().world_width; i++ )
				{
					if ( PagingLandScapePageManager::getSingleton().mPages[ i ][ j ]->isLoaded() == true )
					{
						PagingLandScapePageManager::getSingleton().mPages[ i ][ j ]->getPagingLandScapeRenderOpsInBox(box, opList);
					}
				}
			}						

			std::list<RenderOperation>::iterator i, iend;
			iend = opList.end();
			for (i = opList.begin(); i != iend; ++i)
			{
				frag.fragmentType = SceneQuery::WFT_RENDER_OPERATION;
				frag.renderOp = &(*i);
				listener->queryResult(a->second, &frag);
			}
		}
	}
}

} // namespace Ogre

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -