📄 ogrepaginglandscaperenderable.h
字号:
/***************************************************************************
OgrePagingLandScapeRenderable.h - description
-------------------
begin : Thu Feb 27 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 PAGINGLANDSCAPERENDERABLE_H
#define PAGINGLANDSCAPERENDERABLE_H
#include "OgrePagingLandScapePrerequisites.h"
namespace Ogre
{
/** Represents a landscape page.
@remarks
A LandScapeRenderable represents a page used to render a block of landscape using the procedural terrain approach for LOD.
*/
class PagingLandScapeRenderable : public SimpleRenderable
{
public:
/** Sets the appropriate neighbor for this TerrainRenderable. Neighbors are necessary
to know when to bridge between LODs.
*/
void _setNeighbor( Neighbor n, PagingLandScapeRenderable *t )
{
mNeighbors[ n ] = t;
};
/** Returns the neighbor TerrainRenderable.
*/
PagingLandScapeRenderable * _getNeighbor( Neighbor n )
{
return mNeighbors[ n ];
}
/// The current LOD level
uint mRenderLevel;
// if a neighbour changes its RenderLevel.
// get a new Indexbuffer.
void update();
/** Initializes the LandScapeRenderable with the given options and the starting coordinates of this block.
*/
PagingLandScapeRenderable();
~PagingLandScapeRenderable();
void init( PagingLandScapeTileInfo *info );
void load();
void setNeedUpdate (){mNeedReload = true;};
void release();
virtual void _notifyCurrentCamera( Camera* cam );
virtual void _updateRenderQueue(RenderQueue* queue);
/** Overridden, see Renderable */
virtual Technique* getTechnique(void) const;
virtual Real getSquaredViewDepth(const Camera* cam) const;
virtual Real getBoundingRadius(void) const;
const bool isLoaded () {return mIsLoaded;};
const Real getMaxHeight() {return (mBox.getMaximum ()).y;};
protected:
/// Connection to tiles four neighbours
PagingLandScapeRenderable *mNeighbors [ 4 ];
/// Gets the index data for this tile based on current settings
IndexData* getIndexData(void);
//unsigned short *mIndex;
unsigned int mNumIndex;
bool mInUse;
bool mIsLoaded;
bool mInFrustum;
bool mNeedReload;
int mMaterialLODIndex;
#if defined(_VisibilityCheck)
Vector3 mConeNormal;
float mAngle;
bool mMustRender;
#endif
// for loading
PagingLandScapeTileInfo* mInfo;
};
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -