Beispiel #1
0
    bool VMapManager::isInLineOfSight(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2)
    {
        bool result = true;
		if( m_maps[pMapId] != NULL )
        {
            Vector3 pos1 = convertPositionToInternalRep(x1,y1,z1);
            Vector3 pos2 = convertPositionToInternalRep(x2,y2,z2);
            if(pos1 != pos2)
            {
                MapTree* mapTree = m_maps[pMapId];
                result = mapTree->isInLineOfSight(pos1, pos2);
            }
        }
        return(result);
    }
Beispiel #2
0
	bool VMapManager::isInLineOfSight(unsigned int pMapId, LocationVector & v1, LocationVector & v2)
	{
		bool result = true;
		if( m_maps[pMapId] != NULL )
		{
			Vector3 pos1 = convertPositionToInternalRepMod(v1);
			Vector3 pos2 = convertPositionToInternalRepMod(v2);
			if(pos1 != pos2)
			{
				MapTree* mapTree = m_maps[pMapId];
				result = mapTree->isInLineOfSight(pos1, pos2);
			}
		}
		return(result);
	}
Beispiel #3
0
 bool VMapManager::isInLineOfSight(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2)
 {
     bool result = true;
     if(isLineOfSightCalcEnabled() && iInstanceMapTrees.containsKey(pMapId))
     {
         Vector3 pos1 = convertPositionToInternalRep(x1,y1,z1);
         Vector3 pos2 = convertPositionToInternalRep(x2,y2,z2);
         if(pos1 != pos2)
         {
             MapTree* mapTree = iInstanceMapTrees.get(pMapId);
             result = mapTree->isInLineOfSight(pos1, pos2);
             Command c = Command();
                                                         // save the orig vectors
             c.fillTestVisCmd(pMapId,Vector3(x1,y1,z1),Vector3(x2,y2,z2),result);
             iCommandLogger.appendCmd(c);
         }
     }
     return(result);
 }