Exemple #1
0
 float VMapManager2::getHeight(unsigned int pMapId, float x, float y, float z, float maxSearchDist)
 {
     float height = VMAP_INVALID_HEIGHT_VALUE;           //no height
     if (isHeightCalcEnabled())
     {
         InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(pMapId);
         if (instanceTree != iInstanceMapTrees.end())
         {
             Vector3 pos = convertPositionToInternalRep(x,y,z);
             height = instanceTree->second->getHeight(pos, maxSearchDist);
             if (!(height < G3D::inf()))
             {
                 height = VMAP_INVALID_HEIGHT_VALUE;         //no height
             }
         }
     }
     return height;
 }
Exemple #2
0
 //int gGetHeightCounter = 0;
 float VMapManager::getHeight(unsigned int pMapId, float x, float y, float z)
 {
     float height = VMAP_INVALID_HEIGHT;                 //no height
     if(isHeightCalcEnabled() && iInstanceMapTrees.containsKey(pMapId))
     {
         Vector3 pos = convertPositionToInternalRep(x,y,z);
         MapTree* mapTree = iInstanceMapTrees.get(pMapId);
         height = mapTree->getHeight(pos);
         if(!(height < inf()))
         {
             height = VMAP_INVALID_HEIGHT;               //no height
         }
         Command c = Command();
         c.fillTestHeightCmd(pMapId,Vector3(x,y,z),height);
         iCommandLogger.appendCmd(c);
     }
     return(height);
 }
    float VMapManager2::getHeight(unsigned int mapId, float x, float y, float z, float maxSearchDist)
    {
        if (isHeightCalcEnabled() && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_HEIGHT))
        {
            InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(mapId);
            if (instanceTree != iInstanceMapTrees.end())
            {
                Vector3 pos = convertPositionToInternalRep(x, y, z);
                float height = instanceTree->second->getHeight(pos, maxSearchDist);
                if (!(height < G3D::inf()))
                    return height = VMAP_INVALID_HEIGHT_VALUE; // No height

                return height;
            }
        }

        return VMAP_INVALID_HEIGHT_VALUE;
    }
Exemple #4
0
    float VMapManager2::getHeight(unsigned int mapId, float x, float y, float z, float maxSearchDist)
    {
        if (isHeightCalcEnabled() && !IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_HEIGHT))
        {
            auto instanceTree = GetMapTree(mapId);
            if (instanceTree != iInstanceMapTrees.end())
            {
                Vector3 pos = convertPositionToInternalRep(x, y, z);
                float height = instanceTree->second->getHeight(pos, maxSearchDist);
                if (!(height < G3D::finf()))
                    return height = VMAP_INVALID_HEIGHT_VALUE; // No height

                return height;
            }
        }

        return VMAP_INVALID_HEIGHT_VALUE;
    }