Terrain.h

#ifndef TERRAIN_H
#define TERRAIN_H

#include "Ogre.h"
#include "NxOgre.h"
#include "Character.h"
#include <vector>

using namespace Ogre;
using namespace NxOgre;

class TerrainBlock : public Actor, public RenderableSource
{
public:
	enum
	{
		FactoryIdentifier = 004 // Unique identifier for RenderableActorFactory.
	};
	enum OrdinalDirections
	{
		DIR_NORTH = 0,
		DIR_EAST,
		DIR_SOUTH,
		DIR_WEST
	};
	TerrainBlock(const NxString& name, const NxOgre::Pose& pose, Shape* shape, 
			Scene* scene, const NodeRenderableParams& visualParams, const ActorParams& params);
	TerrainBlock(const VisualIdentifier& vi, const NxOgre::Pose& pose, Shape* shape, 
			Scene* scene, const ActorParams& params);
	~TerrainBlock();
	void initialize( String north, String east, String south, String west );
	void setLowPolyMesh( Entity* lowPolyMesh );
	void setHighPolyMesh( Entity* newHighPolyMesh );



	NxOgre::Pose getSourcePose( const NxOgre::TimeStep& )  const;
	NxShortHashIdentifier getType();
	NxString getStringType();
	void setType( NxShortHashIdentifier newHash );
	void setStringType( NxString newStringType );

	void setActive( bool isActive );
	bool getActive();
	bool isCenter();

	void centerOnThisBlock();
	void connectTheBlocks();
	void disableDirection( TerrainBlock* block, OrdinalDirections direction );

	

protected:
	void createNewCenter();
	NodeRenderable* mNodeRenderable;
	OgreNodeRenderable* mOgreNodeRenderable;
	NxShortHashIdentifier mTypeHash;
	NxString mStringType;

	bool mIsActive;
	Scene* mScene;
	SceneManager* mSceneMgr;
	
	TerrainBlock* mNorthBlock;
	TerrainBlock* mSouthBlock;
	TerrainBlock* mEastBlock;
	TerrainBlock* mWestBlock;
	String mNorthBlockName;
	String mEastBlockName;	
	String mSouthBlockName;
	String mWestBlockName;

	Entity* mLowPolyMesh;
	Entity* mHighPolyMesh;
	static TerrainBlock* mCenterBlock;
};




#endif