/** get the hit position and return true if we hit something otherwise the result pos will be the dest pos */ bool VMapManager::getObjectHitPos(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float pModifyDist) { bool result = false; rx=x2; ry=y2; rz=z2; if(isLineOfSightCalcEnabled()) { if(iInstanceMapTrees.containsKey(pMapId)) { Vector3 pos1 = convertPositionToInternalRep(x1,y1,z1); Vector3 pos2 = convertPositionToInternalRep(x2,y2,z2); Vector3 resultPos; MapTree* mapTree = iInstanceMapTrees.get(pMapId); result = mapTree->getObjectHitPos(pos1, pos2, resultPos, pModifyDist); resultPos = convertPositionToMangosRep(resultPos.x,resultPos.y,resultPos.z); rx = resultPos.x; ry = resultPos.y; rz = resultPos.z; #ifdef _VMAP_LOG_DEBUG Command c = Command(); c.fillTestObjectHitCmd(pMapId, pos1, pos2, resultPos, result); iCommandLogger.appendCmd(c); #endif } } return result; }
bool VMapManager::getObjectHitPos(unsigned int pMapId, LocationVector & v1, LocationVector & v2, LocationVector & vout, float pModifyDist) { bool result = false; vout = v2; if( m_maps[pMapId] != NULL ) { Vector3 pos1 = convertPositionToInternalRepMod(v1); Vector3 pos2 = convertPositionToInternalRepMod(v2); Vector3 resultPos; MapTree* mapTree = m_maps[pMapId]; result = mapTree->getObjectHitPos(pos1, pos2, resultPos, pModifyDist); vout = convertPositionToMangosRep(resultPos); } return result; }
/** get the hit position and return true if we hit something otherwise the result pos will be the dest pos */ bool VMapManager::getObjectHitPos(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float pModifyDist) { bool result = false; rx=x2; ry=y2; rz=z2; if( m_maps[pMapId] != NULL ) { Vector3 pos1 = convertPositionToInternalRep(x1,y1,z1); Vector3 pos2 = convertPositionToInternalRep(x2,y2,z2); Vector3 resultPos; MapTree* mapTree = m_maps[pMapId]; result = mapTree->getObjectHitPos(pos1, pos2, resultPos, pModifyDist); resultPos = convertPositionToMangosRep(resultPos.x,resultPos.y,resultPos.z); rx = resultPos.x; ry = resultPos.y; rz = resultPos.z; } return result; }