本文整理汇总了C++中vmap::IVMapManager::getAreaInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ IVMapManager::getAreaInfo方法的具体用法?C++ IVMapManager::getAreaInfo怎么用?C++ IVMapManager::getAreaInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vmap::IVMapManager
的用法示例。
在下文中一共展示了IVMapManager::getAreaInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetArea
AreaTable* TerrainHolder::GetArea(float x, float y, float z)
{
AreaTable* ret = NULL;
float vmap_z = z;
VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
uint32 flags;
int32 adtid, rootid, groupid;
if(vmgr->getAreaInfo(m_mapid, x, y, vmap_z, flags, adtid, rootid, groupid))
{
float adtz = GetADTLandHeight(x, y);
if(adtz > vmap_z && z + 1 > adtz)
return GetArea2D(x, y);
WMOAreaTableEntry* wmoArea = sWorld.GetWMOAreaData(rootid, adtid, groupid);
if(wmoArea != NULL)
ret = dbcArea.LookupEntryForced(wmoArea->areaId);
}
if(ret == NULL) //fall back to 2d if no vmaps or vmap has no areaid set
ret = GetArea2D(x, y);
return ret;
}
示例2: GetAreaInfo
bool TerrainInfo::GetAreaInfo(float x, float y, float z, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const
{
float vmap_z = z;
VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
if (vmgr->getAreaInfo(GetMapId(), x, y, vmap_z, flags, adtId, rootId, groupId))
{
// check if there's terrain between player height and object height
if(GridMap *gmap = const_cast<TerrainInfo*>(this)->GetGrid(x, y))
{
float _mapheight = gmap->getHeight(x,y);
// z + 2.0f condition taken from GetHeight(), not sure if it's such a great choice...
if(z + 2.0f > _mapheight && _mapheight > vmap_z)
return false;
}
return true;
}
return false;
}