Heightmap.h
上传用户:hkb425
上传日期:2007-06-16
资源大小:34191k
文件大小:1k
- // Heightmap.h: interface for the CHeightmap class.
- //作者:吴雪平 2002-6-17日修改
- //存储公共数据:如地形、操作者位置等
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_HEIGHTMAP_H__5700AE61_401D_11D6_812C_5254AB37CDC9__INCLUDED_)
- #define AFX_HEIGHTMAP_H__5700AE61_401D_11D6_812C_5254AB37CDC9__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "structdef.h"
- class CHeightmap
- {
- public:
- CHeightmap();
- virtual ~CHeightmap();
- unsigned char GetHeightmapPointValue(VERTEX *checked);
- float GetHeight(VERTEX *checked);
- float GetHeight(float xpos,float zpos);
- bool CollideCheck(VERTEX viewPos,VERTEX objPos,float step=10);
- bool CheckSunVisible();
- bool IsInFrustum(VERTEX checked);
- POINT ConvertToMovemap(VERTEX pos);
- static MOVE_VERTEX * m_pMovemap;
- static unsigned char * m_pTmap; ///terrain map
- static unsigned char * m_pCovermap;
- static VERTEX * m_pViewPos;
- static VERTEX * m_pSunPos;
- static float * m_pViewRotX;
- static float * m_pViewRotY;
- static bool m_bSunVisible;
- static BOUNDARY_2D m_rect;
- private:
- bool ReadTerrainmapFile();
- bool ReadPlantmapFile();
- int GetPosInMovemap(int x,int z);
- POINT ConvertToHeightmap(VERTEX *pos);
- static int m_numUser;
- };
- #endif // !defined(AFX_HEIGHTMAP_H__5700AE61_401D_11D6_812C_5254AB37CDC9__INCLUDED_)