📄 ogrepaginglandscapepage.h
字号:
/***************************************************************************
OgrePagingLandScapePage.h - description
-------------------
begin : Sat Mar 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. *
* *
***************************************************************************/
#ifndef PAGINGLANDSCAPEPAGE_H
#define PAGINGLANDSCAPEPAGE_H
#include "OgrePagingLandScapePrerequisites.h"
namespace Ogre
{
#define PAGE_INSIDE 0x00000001
#define PAGE_CHANGE 0x00000002
#define PAGE_OUTSIDE 0x00000004
class PagingLandScapePage
{
public:
/** Sets the appropriate neighbor for this TerrainRenderable. Neighbors are necessary
to know when to bridge between LODs.
*/
void _setNeighbor( Neighbor n, PagingLandScapePage *t )
{
mNeighbors[ n ] = t;
};
/** Returns the neighbor TerrainRenderable.
*/
PagingLandScapePage * _getNeighbor( Neighbor n )
{
return mNeighbors[ n ];
};
PagingLandScapeTile *getTile (const uint i , const uint j)
{
return mTiles[i][j];
}
PagingLandScapeTile *getTile (const Vector3& pos);
PagingLandScapePage( uint tableX, uint tableZ );
virtual ~PagingLandScapePage( );
/** Pre-loads the landscape using parameters int he given in the constructor. */
void preload( );
/** Loads the landscape using parameters int he given in the constructor. */
void load( SceneNode &PagingLandScapeRootNode );
/** Unloads the landscape data, but doesn磘 destroy the landscape page. */
void unload( );
/** Post Unloads the landscape data, but doesn磘 destroy the landscape page. */
void postUnload( );
bool isLoaded();
bool isPreLoaded( );
/** Returns if the camera is over this landscape page.
*/
int isCameraIn( const Vector3 & pos );
void _Notify(const Vector3 &pos, PagingLandscapeCamera* Cam);
/// Gets all the patches within an AABB in world coordinates as GeometryData structs
virtual void getPagingLandScapeRenderOpsInBox(const AxisAlignedBox& box, std::list<RenderOperation>& opList);
protected:
SceneNode *mPageNode;
PagingLandScapeTiles mTiles;
bool mIsLoaded;
bool mIsPreLoaded;
uint mTableX; // Position of this Terrain Page in the Terrain Page Array
uint mTableZ;
uint mNumTiles;
Real mIniX; //, mEndX; // Max and Min values of the terrain
Real mIniZ; //, mEndZ;
PagingLandScapePage *mNeighbors[4];
// Change Zone values
AxisAlignedBox mBoundsExt;
AxisAlignedBox mBoundsInt;
};
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -