📄 ogrepaginglandscapetile.h
字号:
/***************************************************************************
OgrePagingLandScapeTile.h - description
-------------------
begin : Sun Jun 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 PAGINGLANDSCAPETILE_H
#define PAGINGLANDSCAPETILE_H
#include "OgrePagingLandScapePrerequisites.h"
namespace Ogre
{
class PagingLandScapeTile : public MovableObject
{
public:
PagingLandScapeTileInfo* getInfo ()
{
return mInfo;
};
/** Sets the appropriate neighbor for this TerrainRenderable. Neighbors are necessary
to know when to bridge between LODs.
*/
void _setNeighbor( Neighbor n, PagingLandScapeTile *t )
{
mNeighbors[ n ] = t;
};
/** Returns the neighbor TerrainRenderable.
*/
PagingLandScapeTile * _getNeighbor( Neighbor n )
{
return mNeighbors[ n ];
};
/** intersectSegment
@remarks
Intersect mainly with Landscape
@param start
begining of the segment
@param end
where it ends
@param result
where it intersects with terrain
*/
bool intersectSegment( const Vector3 & start, const Vector3 & dir, Vector3 * result );
/** updateTerrain
@remarks
Make the Tile reload its vertices and normals
(upon a modification of the height data)
*/
void updateTerrain ();
PagingLandScapeRenderable* getRenderable ()
{
return mRenderable;
}
void _linkRenderableNeighbor();
PagingLandScapeTile( void );
~PagingLandScapeTile( void );
void init( SceneNode &PageNode, const int tableX, const int tableZ, const int tileX, const int tileZ );
void release( void );
//movable object methods
/** Returns the name of the PagingLandScapeRenderable
*/
virtual const String& getName( void ) const { return mName; };
/** Returns the type of the movable.
*/
virtual const String& getMovableType( void ) const { return mType; };
/** Returns the bounding box of this LandScapeRenderable
*/
const AxisAlignedBox& getBoundingBox( void ) const { return mBounds; };
/** Updates the level of detail to be used for rendering this PagingLandScapeRenderable based on the passed in Camera
*/
virtual void _notifyCurrentCamera( Camera* cam );
virtual void _notifyAttached(Node* parent);
virtual void _updateRenderQueue( RenderQueue* queue );
/** Overridden from MovableObject */
Real getBoundingRadius(void) const { return 0; /* not needed */ };
void getWorldTransforms( Matrix4* xform ) const;
const Quaternion& getWorldOrientation(void) const;
const Vector3& getWorldPosition(void) const;
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);
SceneNode* getTileNode () {return mTileSceneNode;};
bool isLoaded (){return mLoaded;};
protected:
//movable object variables
String mName;
static String mType;
AxisAlignedBox mBounds;
AxisAlignedBox mBoundsExt;
AxisAlignedBox mWorldBounds;
// if the tile is initialized
bool mInit;
// if the renderable is loaded
bool mLoaded;
PagingLandScapeRenderable *mRenderable;
SceneNode *mTileSceneNode;
PagingLandScapeTile *mNeighbors[4];
PagingLandScapeTileInfo* mInfo;
};
} //namespace
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -