diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterimportcollada.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 40 | ||||
-rw-r--r-- | indra/newview/llmeshrepository.cpp | 61 | ||||
-rw-r--r-- | indra/newview/llmeshrepository.h | 4 |
4 files changed, 71 insertions, 49 deletions
diff --git a/indra/newview/llfloaterimportcollada.cpp b/indra/newview/llfloaterimportcollada.cpp index cd4d13b58d..20907e899e 100644 --- a/indra/newview/llfloaterimportcollada.cpp +++ b/indra/newview/llfloaterimportcollada.cpp @@ -481,13 +481,14 @@ BOOL LLImportColladaAssetCache::uploadMeshAsset(domMesh* mesh) // write model to temp file std::string filename = gDirUtilp->getTempFilename(); - LLModel::writeModel(filename, - lods[4], - lods[0], - lods[1], - lods[2], - lods[3], - lods[4]->mPhysicsShape); + LLModel::writeModel( + filename, + lods[4], + lods[0], + lods[1], + lods[2], + lods[3], + lods[4]->mConvexHullDecomp); // copy file to VFS diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index d067970806..1e87e84eb2 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -2122,24 +2122,28 @@ U32 LLModelPreview::calcResourceCost() { accounted.insert(instance.mModel); - LLModel::physics_shape& physics_shape = instance.mLOD[LLModel::LOD_PHYSICS] ? instance.mLOD[LLModel::LOD_PHYSICS]->mPhysicsShape : instance.mModel->mPhysicsShape; - - LLSD ret = LLModel::writeModel("", - instance.mLOD[4], - instance.mLOD[3], - instance.mLOD[2], - instance.mLOD[1], - instance.mLOD[0], - physics_shape, - mFMP->childGetValue("upload_skin").asBoolean(), - mFMP->childGetValue("upload_joints").asBoolean(), - true); + LLModel::convex_hull_decomposition& decomp = + instance.mLOD[LLModel::LOD_PHYSICS] ? + instance.mLOD[LLModel::LOD_PHYSICS]->mConvexHullDecomp : + instance.mModel->mConvexHullDecomp; + + LLSD ret = LLModel::writeModel( + "", + instance.mLOD[4], + instance.mLOD[3], + instance.mLOD[2], + instance.mLOD[1], + instance.mLOD[0], + decomp, + mFMP->childGetValue("upload_skin").asBoolean(), + mFMP->childGetValue("upload_joints").asBoolean(), + TRUE); cost += gMeshRepo.calcResourceCost(ret); - num_hulls += physics_shape.size(); - for (U32 i = 0; i < physics_shape.size(); ++i) + num_hulls += decomp.size(); + for (U32 i = 0; i < decomp.size(); ++i) { - num_points += physics_shape[i].size(); + num_points += decomp[i].size(); } //calculate streaming cost @@ -2771,7 +2775,7 @@ void LLModelPreview::genLODs(S32 which_lod) if (which_lod == -1) { - mModel[LLModel::LOD_HIGH] = mBaseModel; + mModel[LLModel::LOD_HIGH] = mBaseModel; } return; @@ -3478,7 +3482,7 @@ BOOL LLModelPreview::render() { gGL.pushMatrix(); - LLVector3 offset = model->mHullCenter[i]-model->mPhysicsCenter; + LLVector3 offset = model->mHullCenter[i]-model->mCenterOfHullCenters; offset *= explode; gGL.translatef(offset.mV[0], offset.mV[1], offset.mV[2]); @@ -3820,7 +3824,7 @@ S32 LLFloaterModelPreview::DecompRequest::statusCallback(const char* status, S32 void LLFloaterModelPreview::DecompRequest::completed() { - mModel->setPhysicsShape(mHull); + mModel->setConvexHullDecomposition(mHull); if (sInstance) { diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 28db665ff9..5e95376830 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1031,6 +1031,8 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat } else { + llinfos + << "Marking header as non-existent, will not retry." << llendl; header["404"] = 1; } @@ -1984,7 +1986,25 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, LLMeshRepoThread::sActiveHeaderRequests--; if (status < 200 || status > 400) { - llwarns << status << ": " << reason << llendl; + llwarns + << "Header responder failed with status: " + << status << ": " << reason << llendl; + + // 503 (service unavailable) or 499 (timeout) + // can be due to server load and can be retried + + // TODO*: Add maximum retry logic, exponential backoff + // and (somewhat more optional than the others) retries + // again after some set period of time + if (status == 503 || status == 499) + { //retry + LLMeshRepository::sHTTPRetryCount++; + LLMeshRepoThread::HeaderRequest req(mMeshParams); + LLMutexLock lock(gMeshRepo.mThread->mMutex); + gMeshRepo.mThread->mHeaderReqQ.push(req); + + return; + } } S32 data_size = buffer->countAfter(channels.in(), NULL); @@ -2001,14 +2021,9 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, if (!gMeshRepo.mThread->headerReceived(mMeshParams, data, data_size)) { - llwarns << "Header responder failed with status: " << status << ": " << reason << llendl; - if (status == 503 || status == 499) - { //retry - LLMeshRepository::sHTTPRetryCount++; - LLMeshRepoThread::HeaderRequest req(mMeshParams); - LLMutexLock lock(gMeshRepo.mThread->mMutex); - gMeshRepo.mThread->mHeaderReqQ.push(req); - } + llwarns + << "Unable to parse mesh header: " + << status << ": " << reason << llendl; } else if (data && data_size > 0) { @@ -2660,20 +2675,22 @@ void LLMeshUploadThread::sendCostRequest(LLMeshUploadData& data) { //write model file to memory buffer std::stringstream ostr; - - LLModel::physics_shape& phys_shape = data.mModel[LLModel::LOD_PHYSICS].notNull() ? - data.mModel[LLModel::LOD_PHYSICS]->mPhysicsShape : - data.mBaseModel->mPhysicsShape; + + LLModel::convex_hull_decomposition& decomp = + data.mModel[LLModel::LOD_PHYSICS].notNull() ? + data.mModel[LLModel::LOD_PHYSICS]->mConvexHullDecomp : + data.mBaseModel->mConvexHullDecomp; LLModel::hull dummy_hull; - LLSD header = LLModel::writeModel(ostr, + LLSD header = LLModel::writeModel( + ostr, data.mModel[LLModel::LOD_PHYSICS], data.mModel[LLModel::LOD_HIGH], data.mModel[LLModel::LOD_MEDIUM], data.mModel[LLModel::LOD_LOW], data.mModel[LLModel::LOD_IMPOSTOR], - phys_shape, + decomp, dummy_hull, mUploadSkin, mUploadJoints, @@ -2750,19 +2767,19 @@ void LLMeshUploadThread::doUploadModel(LLMeshUploadData& data) { std::stringstream ostr; - LLModel::physics_shape& phys_shape = data.mModel[LLModel::LOD_PHYSICS].notNull() ? - data.mModel[LLModel::LOD_PHYSICS]->mPhysicsShape : - data.mBaseModel->mPhysicsShape; - - + LLModel::convex_hull_decomposition& decomp = + data.mModel[LLModel::LOD_PHYSICS].notNull() ? + data.mModel[LLModel::LOD_PHYSICS]->mConvexHullDecomp : + data.mBaseModel->mConvexHullDecomp; - LLModel::writeModel(ostr, + LLModel::writeModel( + ostr, data.mModel[LLModel::LOD_PHYSICS], data.mModel[LLModel::LOD_HIGH], data.mModel[LLModel::LOD_MEDIUM], data.mModel[LLModel::LOD_LOW], data.mModel[LLModel::LOD_IMPOSTOR], - phys_shape, + decomp, mHullMap[data.mBaseModel], mUploadSkin, mUploadJoints); diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index bbfe2e46f2..427bcb8a75 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -139,7 +139,7 @@ public: void merge(const LLMeshDecomposition* rhs); LLUUID mMeshID; - LLModel::physics_shape mHull; + LLModel::convex_hull_decomposition mHull; LLModel::hull mBaseHull; std::vector<LLPointer<LLVertexBuffer> > mMesh; @@ -165,7 +165,7 @@ public: //output state std::string mStatusMessage; std::vector<LLPointer<LLVertexBuffer> > mHullMesh; - LLModel::physics_shape mHull; + LLModel::convex_hull_decomposition mHull; virtual S32 statusCallback(const char* status, S32 p1, S32 p2) = 0; virtual void completed() = 0; |