worldwall.h

来自「五行MMORPG引擎系统V1.0」· C头文件 代码 · 共 80 行

H
80
字号
//-----------------------------------------------------------------------------
// Torque RPG
//	在Terrain边界加上世界墙,在TerrainBlock的Tile属性为0时,较适用;用来标注地形范围,
//	因为TerrainBlock的Tile为1时,地形是无限大的。
// 李亦编写
// 2006.5.18
//-----------------------------------------------------------------------------

#ifndef _WORLDWALL_H_
#define _WORLDWALL_H_

#ifndef _SCENEOBJECT_H_
#include "sim/sceneObject.h"
#endif


/// Manage decals in the world.
class WorldWall : public SceneObject
{
   typedef SceneObject Parent;

  //SimObjectPtr<TerrainBlock> mTerrainBlock;

	bool		mRenderWall;
   ColorI  mWallFillColor;
   ColorI  mWallFrameColor;

	bool		mRenderGridLine;
	bool		mRenderGridPlane;
   ColorI	mGridLineColor;
   ColorI	mGridFillColor;
	Point3F	mGridSize;
	U32		mGridAmount;

  protected:
   bool prepRenderImage(SceneState *state, const U32 stateKey, const U32 startZone, const bool modifyBaseZoneState);
   void renderObject(SceneState *state, SceneRenderImage *image);

	void renderWorldWall();
	void renderCuboidFrame(const RectF &area, F32 height, ColorI & a,ColorI & b);
	void renderGrid(const RectF &area, Point3F& grid, ColorI & a,ColorI & b,bool bRenderPlane,bool bRenderLine);
	void renderTerrainGrid(const RectF &area);
	void renderTerrainGridSquare(S32 xPos,S32 yPos);


  public:
   WorldWall();
   ~WorldWall();

	static void create();
 	static void destroy();

	static void consoleInit();	
	static void initPersistFields();
	
   virtual void onEditorEnable();
   virtual void onEditorDisable();


	void setRenderGridLine(bool bSet = true)	{mRenderGridLine = bSet;}
	void setRenderWall(bool bSet = true)		{mRenderWall = bSet;}
 	void setRenderGridPlane(bool bSet = true)	{mRenderGridPlane = bSet;}

	bool isRenderGridLine()		{return mRenderGridLine;}
	bool isRenderWall()			{return mRenderWall;}
 	bool isRenderGridPlane()	{return mRenderGridPlane;}

  //U32  packUpdate  (NetConnection *conn, U32 mask, BitStream *stream);
   //void unpackUpdate(NetConnection *conn,           BitStream *stream);

	//static bool ms_bWorldWallOn;
	//static bool ms_bWorldGridOn;

   DECLARE_CONOBJECT(WorldWall);

};
extern WorldWall* g_pWorldWall;

#endif // _H_DecalManager

⌨️ 快捷键说明

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