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

📄 ogrepaginglandscaperayscenequery.h

📁 使用stl技术,(还没看,是听说的)
💻 H
字号:
/***************************************************************************
OgrePagingLandScapeRaySceneQuery.h  -  description
-------------------
begin                : Fri Sep 10 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.                       *
*                                                                         *
***************************************************************************/

#ifndef PAGINGLANDSCAPERAYSCENEQUERY_H
#define PAGINGLANDSCAPERAYSCENEQUERY_H

#include "OgrePagingLandScapeSceneManager.h"
#include <vector>

namespace Ogre
{

	enum
	{
		// Height will return the height at the origin
		// Distance will always be 0
		RSQ_Height       = 1<<0,

		// AllTerrain will return all terrain contacts
		// along the ray
		RSQ_AllTerrain   = 1<<1,

		// FirstTerrain will return only the first
		// contact along the ray
		RSQ_FirstTerrain = 1<<2,

		// Entities will return all entity contacts along the ray
		RSQ_Entities     = 1<<3,

		// Different resolution scales.  It defaults to 1 unit
		// resolution.  2x resolution tests every 0.5 units
		// 4x tests every 0.25 and 8x every 0.125
		RSQ_8xRes        = 1<<4,
		RSQ_4xRes        = 1<<5,
		RSQ_2xRes        = 1<<6,
		RSQ_1xRes        = 1<<7
	};

	/** PagingLandScape's specialisation of RaySceneQuery.
		if RSQ_Height bit mask is set, RSQ_Terrain and RSQ_Entity bits will be ignored
		Otherwise data will be returned based on the mask
	*/
class PagingLandScapeRaySceneQuery : public DefaultRaySceneQuery
{
protected: 
	//JEFF
	//PagingLandScapeTile* getNonDividedTile(PagingLandScapeTile* tile, const Vector3& origin);
	inline Vector3 getHeightAt(const Vector3& origin);

	std::vector<SceneQuery::WorldFragment*> fragmentList;
	void clearFragmentList()
	{
		std::vector<SceneQuery::WorldFragment*>::iterator cur, end = fragmentList.end();
		for(cur = fragmentList.begin();cur < end;cur++)
		{
			SceneQuery::WorldFragment* frag = (*cur);
			if(frag)
			{
				delete frag;
				frag = 0;
			}
		}
	}

public:
	PagingLandScapeRaySceneQuery(SceneManager* creator) : DefaultRaySceneQuery(creator)
	{ 
		mOptions = PagingLandScapeOptions::getSingletonPtr();
		mSupportedWorldFragments.insert(SceneQuery::WFT_SINGLE_INTERSECTION);
	}

	~PagingLandScapeRaySceneQuery()
	{
		clearFragmentList();
	}

	/** See RaySceneQuery. */
	void execute(RaySceneQueryListener * listener);

private:
	PagingLandScapeOptions *mOptions;
};

} // namespace Ogre


#endif

⌨️ 快捷键说明

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