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

📄 ogrepaginglandscapepagemanager.h

📁 使用stl技术,(还没看,是听说的)
💻 H
字号:
/***************************************************************************
	OgrePagingLandScapePageManager.h  -  description
	-------------------
	begin                : Sat May 01 2004
	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 PAGINGLANDSCAPEPAGEMANAGER_H
#define PAGINGLANDSCAPEPAGEMANAGER_H

#include "OgrePagingLandScapePrerequisites.h"
#include "OgreSingleton.h"
#include "OgrePagingLandScapeQueue.h"

#include "OgrePagingLandScapePage.h"

namespace Ogre
{



class PagingLandScapePageManager : public Singleton<PagingLandScapePageManager>
{
	friend class PagingLandScapeIntersectionSceneQuery;
	friend class PagingLandScapeRaySceneQuery;
public:
	PagingLandScapePageManager(SceneNode* rootNode);
	~PagingLandScapePageManager();

	void update( Camera* cam );

	uint getCurrentCameraPageX( void );
    uint getCurrentCameraPageZ( void );
    uint getCurrentCameraTileX( void );
    uint getCurrentCameraTileZ( void );

	int getPagePreloadQueueSize( void );
	int getPageLoadQueueSize( void );
	int getPageUnloadQueueSize( void );
	int getPagePostUnloadQueueSize( void );


    PagingLandScapePage *getPage  (const uint i , const uint j)
    {
        return mPages[i][j];
    }
    PagingLandScapeTile *getTile  (const Vector3& pos);
    PagingLandScapeTile *getTile(const Vector3& pos, const uint &pagex, const uint &pagez);
    PagingLandScapeTile *getTileUnscaled(const Vector3& pos);

	static PagingLandScapePageManager& getSingleton(void);

	static PagingLandScapePageManager* getSingletonPtr(void);

protected:
	void _processLoading( void );

	/// Root scene node
	SceneNode* mSceneRoot;

	/** LandScape pages for the terrain.
	*/
	PagingLandScapePages mPages;

	/** Queues to batch the process of loading and unloading Pages.
		This avoid the plugin to load a lot of Pages in a single Frame, droping the FPS.
	*/
	PagingLandScapeQueue<PagingLandScapePage> mPageLoadQueue;
	PagingLandScapeQueue<PagingLandScapePage> mPageUnloadQueue;
	PagingLandScapeQueue<PagingLandScapePage> mPagePreloadQueue;
	PagingLandScapeQueue<PagingLandScapePage> mPagePostunloadQueue;

	/** LandScapePage index where the camera is.
	*/
    uint mCurrentCameraPageX, mCurrentCameraPageZ;
    uint mCurrentCameraTileX, mCurrentCameraTileZ;


	/** The last estate for the camera.
	*/
	int mLastCameraPageState;

    uint mWidth ;
    uint mHeigth;

	int mPause;
    Vector3 mLastCameraPos;

};

}

#endif

⌨️ 快捷键说明

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