diff options
Diffstat (limited to 'indra/newview/llmeshrepository.h')
| -rw-r--r-- | indra/newview/llmeshrepository.h | 68 |
1 files changed, 56 insertions, 12 deletions
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 0847c29d0d..01b51e753e 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -521,6 +521,9 @@ public: // list of completed Decomposition info requests std::list<LLModel::Decomposition*> mDecompositionQ; + // list of completed Physics Mesh info requests + std::list<LLModel::Decomposition*> mPhysicsQ; + //queue of requested headers std::queue<HeaderRequest> mHeaderReqQ; @@ -668,14 +671,31 @@ public: LLPointer<DecompRequest> mFinalDecomp; volatile bool mPhysicsComplete; - typedef std::map<LLPointer<LLModel>, std::vector<LLVector3> > hull_map; - hull_map mHullMap; + typedef std::map<LLPointer<LLModel>, std::vector<LLVector3> > hull_map_t; + hull_map_t mHullMap; - typedef std::vector<LLModelInstance> instance_list; - instance_list mInstanceList; + typedef std::vector<LLModelInstance> instance_list_t; + instance_list_t mInstanceList; - typedef std::map<LLPointer<LLModel>, instance_list> instance_map; - instance_map mInstance; + // Upload should happen in deterministic order, so sort instances by model name. + struct LLUploadModelInstanceLess + { + inline bool operator()(const LLPointer<LLModel>& a, const LLPointer<LLModel>& b) const + { + if (a.isNull() || b.isNull()) + { + llassert(false); // We are uploading these models, they shouldn't be null. + return true; + } + // Note: probably can sort by mBaseModel->mSubmodelID here as well to avoid + // running over the list twice in wholeModelToLLSD. + return a->mLabel > b->mLabel; + } + }; + typedef std::map<LLPointer<LLModel>, instance_list_t, LLUploadModelInstanceLess> instance_map_t; + instance_map_t mInstance; + typedef std::map<std::string, std::string> lod_sources_map_t; + lod_sources_map_t mLodSources; LLMutex* mMutex; S32 mPendingUploads; @@ -690,10 +710,14 @@ public: LLHost mHost; std::string mWholeModelFeeCapability; std::string mWholeModelUploadURL; + LLUUID mDestinationFolderId; - LLMeshUploadThread(instance_list& data, LLVector3& scale, bool upload_textures, + LLMeshUploadThread(instance_list_t& data, const lod_sources_map_t& sources_list, + LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, - const std::string & upload_url, bool do_upload = true, + const std::string & upload_url, + const LLUUID destination_folder_id = LLUUID::null, + bool do_upload = true, LLHandle<LLWholeModelFeeObserver> fee_observer = (LLHandle<LLWholeModelFeeObserver>()), LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>())); ~LLMeshUploadThread(); @@ -709,7 +733,7 @@ public: void doWholeModelUpload(); void requestWholeModelFee(); - void wholeModelToLLSD(LLSD& dest, bool include_textures); + void wholeModelToLLSD(LLSD& dest, std::vector<std::string>& texture_list_dest, bool include_textures); void decomposeMeshMatrix(LLMatrix4& transformation, LLVector3& result_pos, @@ -724,12 +748,29 @@ public: static LLViewerFetchedTexture* FindViewerTexture(const LLImportMaterial& material); +protected: + void packModelIntance( + LLModel* model, + LLMeshUploadThread::instance_list_t& instance_list, + std::string& model_name, + LLSD& res, + S32& mesh_num, + S32& texture_num, + S32& instance_num, + std::unordered_set<LLViewerTexture* > &textures, + std::unordered_map<LLViewerTexture*, S32> texture_index, + std::unordered_map<LLModel*, S32>& mesh_index, + std::vector<std::string>& texture_list_dest, + bool include_textures + ); + private: LLHandle<LLWholeModelFeeObserver> mFeeObserverHandle; LLHandle<LLWholeModelUploadObserver> mUploadObserverHandle; bool mDoUpload; // if false only model data will be requested, otherwise the model will be uploaded LLSD mModelData; + std::vector<std::string> mTextureFiles; // llcorehttp library interface objects. LLCore::HttpStatus mHttpStatus; @@ -833,7 +874,7 @@ public: void notifyMeshUnavailable(const LLVolumeParams& mesh_params, S32 request_lod, S32 volume_lod); void notifySkinInfoReceived(LLMeshSkinInfo* info); void notifySkinInfoUnavailable(const LLUUID& info); - void notifyDecompositionReceived(LLModel::Decomposition* info); + void notifyDecompositionReceived(LLModel::Decomposition* info, bool physics_mesh); S32 getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lod); static S32 getActualMeshLOD(LLMeshHeader& header, S32 lod); @@ -850,9 +891,12 @@ public: bool meshUploadEnabled(); bool meshRezEnabled(); - void uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures, + void uploadModel(std::vector<LLModelInstance>& data, const std::map<std::string, std::string> &lod_sources, + LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, - std::string upload_url, bool do_upload = true, + std::string upload_url, + const LLUUID& destination_folder_id = LLUUID::null, + bool do_upload = true, LLHandle<LLWholeModelFeeObserver> fee_observer= (LLHandle<LLWholeModelFeeObserver>()), LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>())); |
