//---------------------------------------------------------------------------- // // ROUTINE: CHoverMovementModifier::GetUpperBound() // // PURPOSE: Returns the highest point the AI is allowed to move to. If // there is no volume, Max the point. If there is no ceiling // height, assume that we can go x high // //---------------------------------------------------------------------------- float CHoverMovementModifier::GetUpperBound( HOBJECT hObject, float flCheckDist, const LTVector& vDims, const LTVector& vPos ) { float flCeilingHeight; CAIUtils Utils(hObject); if ( LTFALSE == Utils.FindTrueCeilingHeight(flCheckDist, vDims, vPos, &flCeilingHeight) ) { AIASSERT( 0, hObject, "Ceiling not found!" ); } return flCeilingHeight; }
//---------------------------------------------------------------------------- // // ROUTINE: CHoverMovementModifier::GetLowerBound() // // PURPOSE: Returns the lowest point the AI is allowed to move to. If // there is no volume, Min the point. If there is no floorheight, // we can go at least that low. // //---------------------------------------------------------------------------- float CHoverMovementModifier::GetLowerBound( HOBJECT hObject, float flCheckDist, const LTVector& vDims, const LTVector& vPos ) { float flFloorHeight; CAIUtils Utils(hObject); LTVector vStartPosition = LTVector( vPos.x, vPos.y+m_cMaxVerticalDifference, vPos.z); if ( LTFALSE == Utils.FindTrueFloorHeight(flCheckDist, vDims, vStartPosition, &flFloorHeight) ) { AIASSERT( 0, hObject, "Floor not found!" ); } return flFloorHeight; }
void DownloadManager::download(QUrl url, QString fileName, QString localDirPath) { qDebug() << "download: URL = " <<url.toString(); if (_pReply != NULL) { abort(); } _URL = url; _fileName = fileName; { if (!localDirPath.isNull() && !localDirPath.isEmpty()) { _path = localDirPath; } else { _path = Utils().getDefaultCacheDirPath(); } QString extension = "mp3";//vk only allows mp3 QFileInfo fileInfo(_path.append("/").append(fileName).append(".").append(extension)); _qsFileAbsPath = fileInfo.absoluteFilePath(); qDebug() << "download: local path =" << _qsFileAbsPath; } _nDownloadSize = 0; _nDownloadSizeAtPause = 0; // _pManager = new QNetworkAccessManager(this); _request = QNetworkRequest(url); _pReply = _pManager->head(_request); emit downloadStarted(); setDownloading(true); _Timer.setInterval(5000); _Timer.setSingleShot(true); connect(&_Timer, SIGNAL(timeout()), this, SLOT(timeout())); _Timer.start(); connect(_pReply, SIGNAL(finished()), this, SLOT(finishedHead())); connect(_pReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError))); }