6 #ifndef _INC_cMapBase_H
7 #define _INC_cMapBase_H
45 #define MAP_SCALE(lod) (1<<((lod)*3))
46 #define MAP_SIZE(lod) (MAP_SCALE(lod) * MAP_PATCH_POINTS)
195 cMapBase(
const char* pszMapName =
"Map");
202 virtual bool isPatchInBounds(
const cMapPatch* pPatch)
const;
206 bool ClampPointDynamic(
cPoint3f& ptW)
const;
214 return GetHeightAt(ptW.
m_x, ptW.
m_y, iSize, uFlags);
240 return GetNormalAt(vNorm, ptW.
m_x, ptW.
m_y, iSize);
246 return GetNormalGradeAt(ptW.
m_x, ptW.
m_y, iSize);
254 return GetWaterLevel(ptW.
m_x, ptW.
m_y, iSize);
262 STDMETHOD(SetObjStateLoaded)();
271 #define cMapBaseProp(a,b,c,d,e) P_##a,
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define GRAYMAPDATA_LINK
Definition: GrayMapData.h:13
float D3DVALUE
Definition: MathDX.h:18
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define D3DCOLOR_ARGB(a, r, g, b)
Definition: cColorRef.h:28
DWORD D3DCOLOR
Stuff normally defined in windows.h or DirectX headers.
Definition: cColorRef.h:24
#define MAP_SIZE(lod)
size of a patch (in meters (MAP_METERI_t))
Definition: cMapBase.h:46
Definition: cMapCommon.h:42
Definition: cCoordSpace.h:20
cPoint3f CvtRenderToWorld(const cVector3f &vPt) const
Definition: cCoordSpace.h:73
Definition: cScriptableObj.h:26
Definition: cScriptableInterface.h:97
Definition: cVariant.h:26
TYPE m_z
Definition: cVecT.h:544
TYPE y
Definition: cVecT.h:545
TYPE z
Definition: cVecT.h:545
TYPE m_x
Definition: cVecT.h:544
TYPE m_y
Definition: cVecT.h:544
TYPE x
Definition: cVecT.h:545
Definition: WinTypes.h:128
Definition: cMapKeys.h:49
Definition: cMapBase.h:188
cMapWaterDef m_WaterDef
Definition: cMapBase.h:284
CHEAPOBJECT_IMPL
Definition: cMapBase.h:267
cValueRange< MAP_METERI_t > m_SizeHeight
Definition: cMapBase.h:278
UNITTEST_FRIEND(cMapBase)
float GetNormalGradeAt(const cPoint3f &ptW, MAP_METERI_t iSize)
Definition: cMapBase.h:244
P_TYPE_
Definition: cMapBase.h:270
@ P_QTY
Definition: cMapBase.h:274
MAP_METERf_t GetHeightAt(const cPoint3f &ptW, MAP_METERI_t iSize, MAP_CHANNEL_t uFlags=MAP_CHANNEL_Height)
Definition: cMapBase.h:210
MAP_METER_t GetWaterLevel(const cPoint3f &ptW, MAP_METERI_t iSize)
Definition: cMapBase.h:252
CSCRIPT_CLASS_DEF0(MapBase)
cRectI m_MapDynamic
Definition: cMapBase.h:282
bool SetHeightAt(const cPoint3f &ptW, MAP_METERI_t iSize)
Definition: cMapBase.h:224
cWinSize m_MapSize
Definition: cMapBase.h:281
CMapKeys m_MapKeys
Definition: cMapBase.h:287
float GetNormalAt(OUT cVector3f &vNorm, const cPoint3f &ptW, MAP_METERI_t iSize)
Definition: cMapBase.h:238
void GetHeightVert(cVector3f &v, DVALUEDEF_t x, DVALUEDEF_t y)
Definition: cMapBase.h:216
Definition: cMapEntity.h:76
Definition: cMapPatch.h:23
Definition: cMapBase.h:165
MAP_METERf_t m_SeaLevelDef
Definition: cMapBase.h:175
D3DCOLOR m_ColorDef
Definition: cMapBase.h:173
float m_FadeExp
Definition: cMapBase.h:172
float m_FadeBias
Definition: cMapBase.h:171
cMapWaterDef()
Definition: cMapBase.h:178
Definition: cHeapObject.h:38
Definition: cThreadLockRef.h:44
double MAP_METER_t
float meters for x,y,z, similar to MAP_METERI_t. also D3DVALUE or DVALUEDEF_t METERSf_t
Definition: cMapCommon.h:22
float DVALUEDEF_t
similar to D3DVALUE in DX. the basic default dimension type. DVALUEDEF_t
Definition: cVecT.h:34
GINTERSECT_TYPE
Definition: cVecT.h:20
Definition: GrayMapData.cpp:12
const int MAP_LOD_RATIO
Ratio of one LOD to the next. i.e. a parent patch has (max) <= MAP_LOD_RATIO^2 immediate children.
Definition: cMapBase.h:39
WORD MAP_CHANNEL_t
Definition: cMapBase.h:103
const MAP_METERf_t MAP_HEIGHT_SCALE
Definition: cMapBase.h:110
int MAP_PATCH_POINT_t
this gives the number of samples in the heightmap file: 128 means a 129x129 file (include skirt pixel...
Definition: cMapBase.h:42
const D3DVALUE MAP_VIEWDIST_MIN
Definition: cMapBase.h:72
DWORD MAP_TERRAIN_MASK_t
Definition: cMapBase.h:155
BYTE MAP_SURFACE_ID_t
Definition: cMapBase.h:114
MAP_CHANNEL_TYPE_
Definition: cMapBase.h:75
@ MAP_CHANNEL_NonCrit
get cached data only else just fail. (or out of bounds)
Definition: cMapBase.h:98
@ MAP_CHANNEL_Height
the height map. MAP_HEIGHT_t
Definition: cMapBase.h:82
@ MAP_CHANNEL_Surface_LegY
Definition: cMapBase.h:95
@ MAP_CHANNEL_Surface_LegX
Definition: cMapBase.h:94
@ MAP_CHANNEL_All
never used with MAP_CHANNEL_NonCrit ?
Definition: cMapBase.h:88
@ MAP_CHANNEL_Normal
always computed normal/bump map. (NOT loaded from file)
Definition: cMapBase.h:83
@ MAP_CHANNEL_Surface
the detailed ground surfaces. (detailed patch textures) (for roads, etc) (TODO Make this into an obje...
Definition: cMapBase.h:84
@ MAP_CHANNEL_Height_LegX
Definition: cMapBase.h:92
@ MAP_CHANNEL_Placement
going to place an object. (must have proper height info)
Definition: cMapBase.h:99
@ MAP_CHANNEL_NONE
Definition: cMapBase.h:79
@ MAP_CHANNEL_Script
the script listing all the child objects in the patch. includes water level.
Definition: cMapBase.h:87
@ MAP_CHANNEL_Height_LegY
Definition: cMapBase.h:93
@ MAP_CHANNEL_IgnoreBounds
load even if outside bounds. (usually for very large objects)
Definition: cMapBase.h:100
@ MAP_CHANNEL_Now
i need this data now. can't wait for it.
Definition: cMapBase.h:101
@ MAP_CHANNEL_Texture
the ground texture. (for distance viewing only)
Definition: cMapBase.h:85
MAP_SURFACE_TYPE
Definition: cMapBase.h:116
@ MAP_SURFACE_Legacy
For MAP_CHANNEL_Surface.
Definition: cMapBase.h:118
@ MAP_SURFACE_QTY
Definition: cMapBase.h:121
@ MAP_SURFACE_Hole
Definition: cMapBase.h:120
const MAP_HEIGHT_t MAP_HEIGHT_UNITS
Definition: cMapBase.h:109
MAP_TERRAIN_TYPE
Definition: cMapBase.h:127
@ MAP_TERRAIN_ICE
Definition: cMapBase.h:139
@ MAP_TERRAIN_MUD
Definition: cMapBase.h:137
@ MAP_TERRAIN_DIRT
Definition: cMapBase.h:135
@ MAP_TERRAIN_WATER_SHALLOW
Definition: cMapBase.h:143
@ MAP_TERRAIN_UnderGround
Definition: cMapBase.h:148
@ MAP_TERRAIN_QTY
Definition: cMapBase.h:150
@ MAP_TERRAIN_WATER_BOTTOM
Definition: cMapBase.h:146
@ MAP_TERRAIN_WATER_DEEP
Definition: cMapBase.h:145
@ MAP_TERRAIN_WATER_SURFACE
Definition: cMapBase.h:144
@ MAP_TERRAIN_SNOW
Definition: cMapBase.h:138
@ MAP_TERRAIN_WOOD
Definition: cMapBase.h:134
@ MAP_TERRAIN_BURIED
Definition: cMapBase.h:149
@ MAP_TERRAIN_GRASS
Definition: cMapBase.h:136
@ MAP_TERRAIN_STONE
Definition: cMapBase.h:133
@ MAP_TERRAIN_NONE
Definition: cMapBase.h:131
@ MAP_TERRAIN_MASK_ANY
Definition: cMapBase.h:152
__DECL_IMPORT cCoordSpaceDX g_Coords
unsigned short MAP_HEIGHT_t
Definition: cMapBase.h:108
MAP_LOD_TYPE
Definition: cMapBase.h:27
@ MAP_LOD_SECTOR
Definition: cMapBase.h:33
@ MAP_LOD_BLOCK
Definition: cMapBase.h:32
@ MAP_LOD_OCTANT
Definition: cMapBase.h:34
@ MAP_LOD_ZONE
Definition: cMapBase.h:35
@ MAP_LOD_WORLD
Definition: cMapBase.h:36
cRefPtr< cMapPatch > cMapPatchPtr
Definition: cMapBase.h:157
const MAP_PATCH_POINT_t MAP_PATCH_POINTS
arbitrary qty of points in the patch height grid. (meters @ MAP_LOD_BLOCK) MAP_PATCH_POINT_t
Definition: cMapBase.h:43
cThreadLockRef< cMapPatch > cMapPatchPtrX
Definition: cMapBase.h:159
int MAP_METERI_t
integer meters for the location of a patch. MAP_METER_t
Definition: cMapKeys.h:16
float MAP_METERf_t
Height meters dont need double accuracy. MAP_METER_t.
Definition: cMapKeys.h:17
const D3DVALUE MAP_VIEWDIST_NEAR_DEF
Definition: cMapBase.h:71
MAP_LIMITS_TYPE
Definition: cMapBase.h:49
@ MAP_MIN_Z
Definition: cMapBase.h:56
@ MAP_MAX_Z
Definition: cMapBase.h:57
@ MAP_HEIGHT_SEA
Definition: cMapBase.h:61
@ MAP_MAX_X
Definition: cMapBase.h:51
@ MAP_MAX_Y
Definition: cMapBase.h:54
@ MAP_VIEWDIST_TER_DEF
Definition: cMapBase.h:67
@ MAP_MIN_Y
Definition: cMapBase.h:53
@ MAP_HEIGHT_MIN
Definition: cMapBase.h:60
@ MAP_VIEWDIST_OBJ_DEF
Definition: cMapBase.h:68
@ MAP_HEIGHT_MAX
Definition: cMapBase.h:62
@ MAP_MIN_X
Definition: cMapBase.h:50
@ MAP_VIEWDIST_OBJ_MAX
Definition: cMapBase.h:65
@ MAP_BAD_Z
Definition: cMapBase.h:58
@ MAP_VIEWDIST_TER_MAX
Definition: cMapBase.h:64
char FILECHAR_t
a UTF8 char in a file name. like TCHAR
Definition: FileName.h:22