diff options
| author | Dave Parks <davep@lindenlab.com> | 2010-12-22 01:05:52 -0600 | 
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2010-12-22 01:05:52 -0600 | 
| commit | 171307ded9084b3045b7f447abc9662525fadc46 (patch) | |
| tree | 90a5d953dfcbb68652c464f7da94a3c83c747392 | |
| parent | ce595b5663065c5a4e0cc8cc7788965489bd7c04 (diff) | |
| parent | e1b1db9575945fa8436b4ebabf55242635b61f38 (diff) | |
merge
| -rwxr-xr-x | indra/llprimitive/llmodel.cpp | 23 | ||||
| -rwxr-xr-x | indra/llprimitive/llmodel.h | 3 | ||||
| -rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 219 | ||||
| -rw-r--r-- | indra/newview/llfloatermodelpreview.h | 9 | ||||
| -rwxr-xr-x | indra/newview/llmeshrepository.cpp | 55 | ||||
| -rw-r--r-- | indra/newview/llmeshrepository.h | 10 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_model_preview.xml | 160 | ||||
| -rwxr-xr-x | install.xml | 4 | 
8 files changed, 237 insertions, 246 deletions
| diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 2a8505e16e..28f152f49c 100755 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -27,6 +27,7 @@  #include "linden_common.h"  #include "llmodel.h" +#include "llconvexdecomposition.h"  #include "llsdserialize.h"  #include "llvector4a.h" @@ -57,7 +58,15 @@ const int MODEL_NAMES_LENGTH = sizeof(model_names) / sizeof(std::string);  LLModel::LLModel(LLVolumeParams& params, F32 detail)  	: LLVolume(params, detail), mNormalizedScale(1,1,1), mNormalizedTranslation(0,0,0)  { +	mDecompID = -1; +} +LLModel::~LLModel() +{ +	if (mDecompID >= 0) +	{ +		LLConvexDecomposition::getInstance()->deleteDecomposition(mDecompID); +	}  }  void load_face_from_dom_inputs(LLVolumeFace& face, const domInputLocalOffset_Array& inputs, U32 min_idx, U32 max_idx) @@ -941,11 +950,10 @@ void LLModel::normalizeVolumeFaces()  		LLVector4a size;  		size.setSub(max, min); -		// To make the model fit within -		// the unit cube with only the largest -		// dimensions fitting on the surface of the cube, -		// calculate the largest extent on any axis -		F32 scale = 1.f/llmax(llmax(size[0], size[1]), size[2]); +		// Compute scale as reciprocal of size +		LLVector4a scale; +		scale.splat(1.f); +		scale.div(size);  		for (U32 i = 0; i < mVolumeFaces.size(); ++i)  		{ @@ -974,7 +982,10 @@ void LLModel::normalizeVolumeFaces()  		// we would need to multiply the model  		// by to get the original size of the  		// model instead of the normalized size. -		mNormalizedScale = LLVector3(1,1,1) / scale; +		LLVector4a normalized_scale; +		normalized_scale.splat(1.f); +		normalized_scale.div(scale); +		mNormalizedScale.set(normalized_scale.getF32ptr());  		mNormalizedTranslation.set(trans.getF32ptr());  		mNormalizedTranslation *= -1.f;   	} diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 9cc734ff59..ebf37904d4 100755 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -56,6 +56,8 @@ public:  	typedef std::vector<LLVector3> hull;  	LLModel(LLVolumeParams& params, F32 detail); +	~LLModel(); +  	static LLSD writeModel(  		std::string filename,  		LLModel* physics, @@ -193,6 +195,7 @@ public:  	LLVector3 mNormalizedTranslation;  	// convex hull decomposition +	S32 mDecompID;  	convex_hull_decomposition mConvexHullDecomp;  	void setConvexHullDecomposition(  		const convex_hull_decomposition& decomp); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 0dc021c44b..1050e86060 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -256,6 +256,7 @@ LLFloater(key)  	mLastMouseX = 0;  	mLastMouseY = 0;  	mGLName = 0; +	mStatusLock = new LLMutex(NULL);  }  //----------------------------------------------------------------------------- @@ -302,6 +303,8 @@ BOOL LLFloaterModelPreview::postBuild()  	childSetCommitCallback("lod_file_or_limit", refresh, this);  	childSetCommitCallback("physics_load_radio", refresh, this); +	//childSetCommitCallback("physics_optimize", refresh, this); +	//childSetCommitCallback("physics_use_hull", refresh, this);  	childDisable("upload_skin");  	childDisable("upload_joints"); @@ -376,6 +379,9 @@ LLFloaterModelPreview::~LLFloaterModelPreview()  	{  		LLImageGL::deleteTextures(1, &mGLName );  	} + +	delete mStatusLock; +	mStatusLock = NULL;  }  void LLFloaterModelPreview::onViewOptionChecked(const LLSD& userdata) @@ -534,9 +540,10 @@ void LLFloaterModelPreview::draw()  	childSetTextArg("prim_cost", "[PRIM_COST]", llformat("%d", mModelPreview->mResourceCost));  	childSetTextArg("description_label", "[TEXTURES]", llformat("%d", mModelPreview->mTextureSet.size())); -	if (mCurRequest.notNull()) +	if (!mCurRequest.empty())  	{ -		childSetTextArg("status", "[STATUS]", mCurRequest->mStatusMessage); +		LLMutexLock lock(mStatusLock); +		childSetTextArg("status", "[STATUS]", mStatusMessage);  	}  	U32 resource_cost = mModelPreview->mResourceCost*10; @@ -692,7 +699,22 @@ void LLFloaterModelPreview::onPhysicsParamCommit(LLUICtrl* ctrl, void* data)  	if (sInstance)  	{  		LLCDParam* param = (LLCDParam*) data; -		sInstance->mDecompParams[param->mName] = ctrl->getValue(); +		std::string name(param->mName); +		sInstance->mDecompParams[name] = ctrl->getValue(); + +		if (name == "Simplify Method") +		{ +			 if (ctrl->getValue().asInteger() == 0) +			 { +				sInstance->childSetVisible("Retain%", true); +				sInstance->childSetVisible("Detail Scale", false); +			 } +			else +			{ +				sInstance->childSetVisible("Retain%", false); +				sInstance->childSetVisible("Detail Scale", true); +			} +		}  	}  } @@ -701,11 +723,9 @@ void LLFloaterModelPreview::onPhysicsStageExecute(LLUICtrl* ctrl, void* data)  {  	LLCDStageData* stage = (LLCDStageData*) data; -	LLModel* mdl = NULL; -	  	if (sInstance)  	{ -		if (sInstance->mCurRequest.notNull()) +		if (!sInstance->mCurRequest.empty())  		{  			llinfos << "Decomposition request still pending." << llendl;  			return; @@ -713,36 +733,15 @@ void LLFloaterModelPreview::onPhysicsStageExecute(LLUICtrl* ctrl, void* data)  		if (sInstance->mModelPreview)  		{ -			S32 idx = sInstance->childGetValue("physics_layer").asInteger(); -			if (idx >= 0 && idx < sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS].size()) +			for (S32 i = 0; i < sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS].size(); ++i)  			{ -				mdl = sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS][idx]; +				LLModel* mdl = sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS][i]; +				DecompRequest* request = new DecompRequest(stage->mName, mdl); +				sInstance->mCurRequest.insert(request); +				gMeshRepo.mDecompThread->submitRequest(request);  			}  		}  	} -	 -	if (mdl) -	{ -		sInstance->mCurRequest = new DecompRequest(stage->mName, mdl); -		gMeshRepo.mDecompThread->submitRequest(sInstance->mCurRequest); -	} - -	const std::string decompose("Decompose"); - -	if (decompose == stage->mName) -	{ //hide decompose panel and show simplify panel -		sInstance->childSetVisible("physics step 2", false); -		sInstance->childSetVisible("physics step 3", true); -	} -} - -//static -void LLFloaterModelPreview::onPhysicsOptimize(LLUICtrl* ctrl, void *data) -{ -	//hide step 1 panel and show step 2 panel + info -	sInstance->childSetVisible("physics step 1", false); -	sInstance->childSetVisible("physics step 2", true); -	sInstance->childSetVisible("physics info", true);  }  //static  @@ -764,29 +763,16 @@ void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata)  	sInstance->mModelPreview->setPhysicsFromLOD(which_mode);  } -//static  -void LLFloaterModelPreview::onPhysicsDecomposeBack(LLUICtrl* ctrl, void* userdata) -{ -	//hide step 2 panel and info and show step 1 panel -	sInstance->childSetVisible("physics step 1", true); -	sInstance->childSetVisible("physics step 2", false); -	sInstance->childSetVisible("physics info", false); -} -		 -//static  -void LLFloaterModelPreview::onPhysicsSimplifyBack(LLUICtrl* ctrl, void* userdata) -{ -	//hide step 3 panel and show step 2 panel -	sInstance->childSetVisible("physics step 3", false); -	sInstance->childSetVisible("physics step 2", true); -} -	  //static  void LLFloaterModelPreview::onPhysicsStageCancel(LLUICtrl* ctrl, void*data)  { -	if (sInstance && sInstance->mCurRequest.notNull()) +	if (sInstance)  	{ -		sInstance->mCurRequest->mContinue = 0; +		for (std::set<LLPointer<DecompRequest> >::iterator iter = sInstance->mCurRequest.begin(); +			iter != sInstance->mCurRequest.end(); ++iter) +		{ +			(*iter)->mContinue = 0; +		}  	}  } @@ -797,10 +783,6 @@ void LLFloaterModelPreview::initDecompControls()  	childSetCommitCallback("cancel_btn", onPhysicsStageCancel, NULL);  	childSetCommitCallback("physics_lod_combo", onPhysicsUseLOD, NULL);  	childSetCommitCallback("physics_browse", onPhysicsBrowse, NULL); -	childSetCommitCallback("physics_optimize", onPhysicsOptimize, NULL); -	childSetCommitCallback("decompose_back", onPhysicsDecomposeBack, NULL); -	childSetCommitCallback("simplify_back", onPhysicsSimplifyBack, NULL); -	childSetCommitCallback("physics_layer", refresh, NULL);  	static const LLCDStageData* stage = NULL;  	static S32 stage_count = 0; @@ -915,7 +897,6 @@ void LLFloaterModelPreview::initDecompControls()  		}  	} -	childSetCommitCallback("physics_layer", LLFloaterModelPreview::refresh, LLFloaterModelPreview::sInstance);  	childSetCommitCallback("physics_explode", LLFloaterModelPreview::onExplodeCommit, this);  } @@ -2225,20 +2206,6 @@ void LLModelPreview::rebuildUploadData()  		scale_spinner->setValue(max_import_scale);  	} -	//refill "layer" combo in physics panel -	LLComboBox* combo_box = mFMP->getChild<LLComboBox>("physics_layer"); -	if (combo_box) -	{ -		S32 current = combo_box->getCurrentIndex(); -		combo_box->removeall(); -	 -		for (S32 i = 0; i < mBaseModel.size(); ++i) -		{ -			LLModel* mdl = mBaseModel[i]; -			combo_box->add(mdl->mLabel, i); -		} -		combo_box->setCurrentByIndex(current); -	}  } @@ -3226,14 +3193,6 @@ void LLModelPreview::updateStatusMessages()  	S32 start = 0;  	S32 end = mModel[LLModel::LOD_PHYSICS].size(); -	S32 idx = mFMP->childGetValue("physics_layer").asInteger(); - -	if (idx >= 0 && idx < mModel[LLModel::LOD_PHYSICS].size()) -	{ -		start = idx; -		end = idx+1; -	} -  	S32 phys_tris = 0;  	S32 phys_hulls = 0;  	S32 phys_points = 0; @@ -3299,6 +3258,32 @@ void LLModelPreview::updateStatusMessages()  			fmp->disableViewOption("show_physics");  			fmp->setViewOption("show_physics", false);  		} + +		//bool use_hull = fmp->childGetValue("physics_use_hull").asBoolean(); + +		//fmp->childSetEnabled("physics_optimize", !use_hull); +		 +		bool enable = phys_tris > 0 || phys_hulls > 0; +		//enable = enable && !use_hull && fmp->childGetValue("physics_optimize").asBoolean(); + +		//enable/disable "analysis" UI +		LLPanel* panel = fmp->getChild<LLPanel>("physics analysis"); +		LLView* child = panel->getFirstChild(); +		while (child) +		{ +			child->setEnabled(enable); +			child = panel->findNextSibling(child); +		} + +		enable = phys_hulls > 0; +		//enable/disable "simplification" UI +		panel = fmp->getChild<LLPanel>("physics simplification"); +		child = panel->getFirstChild(); +		while (child) +		{ +			child->setEnabled(enable); +			child = panel->findNextSibling(child); +		}	  	}  	const char* lod_controls[] =  @@ -3750,8 +3735,6 @@ BOOL LLModelPreview::render()  		//genLODs();  	} -	S32 physics_idx = mFMP->childGetValue("physics_layer").asInteger(); -	  	if (!mModel[mPreviewLOD].empty())  	{  		bool regen = mVertexBuffer[mPreviewLOD].empty(); @@ -3833,13 +3816,6 @@ BOOL LLModelPreview::render()  				LLGLEnable blend(GL_BLEND);  				gGL.blendFunc(LLRender::BF_ONE, LLRender::BF_ZERO); -				LLModel* physics_model = NULL; -				 -				if (physics_idx >= 0 && physics_idx < mModel[LLModel::LOD_PHYSICS].size() ) -				{ -					physics_model = mModel[LLModel::LOD_PHYSICS][physics_idx]; -				} -  				for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)  				{  					LLModelInstance& instance = *iter; @@ -3867,7 +3843,7 @@ BOOL LLModelPreview::render()  						std::map<LLPointer<LLModel>, std::vector<LLPointer<LLVertexBuffer> > >::iterator iter =   							mPhysicsMesh.find(model);  						if (iter != mPhysicsMesh.end()) -						{ +						{ //render hull instead of mesh  							render_mesh = false;  							for (U32 i = 0; i < iter->second.size(); ++i)  							{ @@ -3895,16 +3871,6 @@ BOOL LLModelPreview::render()  									glColor4ubv(hull_colors[i].mV);  									buff->drawArrays(LLRender::TRIANGLES, 0, buff->getNumVerts()); -								 -									if (edges) -									{ -										glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); -										glLineWidth(3.f); -										glColor4ub(hull_colors[i].mV[0]/2, hull_colors[i].mV[1]/2, hull_colors[i].mV[2]/2, 255); -										buff->drawArrays(LLRender::TRIANGLES, 0, buff->getNumVerts()); -										glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); -										glLineWidth(1.f); -									}	  								}  								if (explode > 0.f) @@ -3927,40 +3893,19 @@ BOOL LLModelPreview::render()  							buffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0); -							if (textures) -							{ -								glColor4fv(instance.mMaterial[i].mDiffuseColor.mV); -								if (i < instance.mMaterial.size() && instance.mMaterial[i].mDiffuseMap.notNull()) -								{ -									gGL.getTexUnit(0)->bind(instance.mMaterial[i].mDiffuseMap, true); -									if (instance.mMaterial[i].mDiffuseMap->getDiscardLevel() > -1) -									{ -										mTextureSet.insert(instance.mMaterial[i].mDiffuseMap); -									} -								} -							} -							else -							{ -								glColor4f(1,1,1,1); -							} -							  							buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);  							gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); -							glColor3f(0.4f, 0.4f, 0.4f); - -							if (edges || model == physics_model) -							{ -								if (model == physics_model) -								{ -									glColor3f(1.f, 1.f, 0.f); -								} +							glColor4f(0.4f, 0.4f, 0.0f, 0.4f); +							 +							buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0); -								glLineWidth(3.f); -								glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); -								buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0); -								glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); -								glLineWidth(1.f); -							} +							glColor3f(1.f, 1.f, 0.f); +								 +							glLineWidth(3.f); +							glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +							buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0); +							glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +							glLineWidth(1.f);  						}  					} @@ -4208,6 +4153,7 @@ LLFloaterModelPreview::DecompRequest::DecompRequest(const std::string& stage, LL  	mStage = stage;  	mContinue = 1;  	mModel = mdl; +	mDecompID = &mdl->mDecompID;  	mParams = sInstance->mDecompParams;  	//copy out positions and indices @@ -4242,14 +4188,25 @@ LLFloaterModelPreview::DecompRequest::DecompRequest(const std::string& stage, LL  	}  } +void LLFloaterModelPreview::setStatusMessage(const std::string& msg) +{ +	LLMutexLock lock(mStatusLock); +	mStatusMessage = msg; +} +  S32 LLFloaterModelPreview::DecompRequest::statusCallback(const char* status, S32 p1, S32 p2)  {  	setStatusMessage(llformat("%s: %d/%d", status, p1, p2)); +	if (LLFloaterModelPreview::sInstance) +	{ +		LLFloaterModelPreview::sInstance->setStatusMessage(mStatusMessage); +	} +  	return mContinue;  }  void LLFloaterModelPreview::DecompRequest::completed() -{ +{ //called from the main thread  	mModel->setConvexHullDecomposition(mHull);  	if (sInstance)  @@ -4261,6 +4218,6 @@ void LLFloaterModelPreview::DecompRequest::completed()  			LLFloaterModelPreview::sInstance->mModelPreview->refresh();  		} -		sInstance->mCurRequest = NULL; +		sInstance->mCurRequest.erase(this);  	}  } diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 64b220d86b..8c7ab39e55 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -201,6 +201,8 @@ protected:  	void initDecompControls(); +	void setStatusMessage(const std::string& msg); +  	LLModelPreview*	mModelPreview;  	LLPhysicsDecomp::decomp_params mDecompParams; @@ -211,8 +213,9 @@ protected:  	U32				mGLName;  	static S32		sUploadAmount; -	LLPointer<DecompRequest> mCurRequest; -	 +	std::set<LLPointer<DecompRequest> > mCurRequest; +	std::string mStatusMessage; +  	std::map<std::string, bool> mViewOption;  	//use "disabled" as false by default @@ -220,7 +223,7 @@ protected:  	LLMenuButton* mViewOptionMenuButton;  	LLToggleableMenu* mViewOptionMenu; -	 +	LLMutex* mStatusLock;  };  class LLMeshFilePicker : public LLFilePickerThread diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 4873eaeabd..861db7fd5d 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1396,6 +1396,7 @@ LLMeshUploadThread::DecompRequest::DecompRequest(LLModel* mdl, LLModel* base_mod  {  	mStage = "single_hull";  	mModel = mdl; +	mDecompID = &mdl->mDecompID;  	mBaseModel = base_model;  	mThread = thread; @@ -2262,6 +2263,9 @@ void LLMeshRepository::notifyLoadedMeshes()  			mInventoryQ.pop();  		}  	} + +	//call completed callbacks on finished decompositions +	mDecompThread->notifyCompleted();  	if (!mThread->mWaiting)  	{ //curl thread is churning, wait for it to go idle @@ -3229,9 +3233,8 @@ void LLPhysicsDecomp::doDecomposition()  		mCurRequest->mHullMesh.clear();  		mCurRequest->setStatusMessage("FAIL"); -		mCurRequest->completed(); -				 -		mCurRequest = NULL; +		 +		completeCurrent();  	}  	else  	{ @@ -3282,13 +3285,33 @@ void LLPhysicsDecomp::doDecomposition()  			LLMutexLock lock(mMutex);  			mCurRequest->setStatusMessage("FAIL"); -			mCurRequest->completed(); -					 -			mCurRequest = NULL; +			completeCurrent();						 +		} +	} +} + +void LLPhysicsDecomp::completeCurrent() +{ +	LLMutexLock lock(mMutex); +	mCompletedQ.push(mCurRequest); +	mCurRequest = NULL; +} + +void LLPhysicsDecomp::notifyCompleted() +{ +	if (!mCompletedQ.empty()) +	{ +		LLMutexLock lock(mMutex); +		while (!mCompletedQ.empty()) +		{ +			Request* req = mCompletedQ.front(); +			req->completed(); +			mCompletedQ.pop();  		}  	}  } +  void make_box(LLPhysicsDecomp::Request * request)  {  	LLVector3 min,max; @@ -3406,18 +3429,17 @@ void LLPhysicsDecomp::doDecompositionSingleHull()  	{ -		LLMutexLock lock(mMutex); -		mCurRequest->completed(); -		mCurRequest = NULL; +		completeCurrent(); +		  	}  } +  void LLPhysicsDecomp::run()  { -	LLConvexDecomposition::getInstance()->initThread(); -	mInited = true; -  	LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance(); +	decomp->initThread(); +	mInited = true;  	static const LLCDStageData* stages = NULL;  	static S32 num_stages = 0; @@ -3443,6 +3465,13 @@ void LLPhysicsDecomp::run()  				mRequestQ.pop();  			} +			S32& id = *(mCurRequest->mDecompID); +			if (id == -1) +			{ +				decomp->genDecomposition(id); +			} +			decomp->bindDecomposition(id); +  			if (mCurRequest->mStage == "single_hull")  			{  				doDecompositionSingleHull(); @@ -3454,7 +3483,7 @@ void LLPhysicsDecomp::run()  		}  	} -	LLConvexDecomposition::getInstance()->quitThread(); +	decomp->quitThread();  	//delete mSignal;  	delete mMutex; diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 8687ac750b..5b770994a8 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -157,6 +157,7 @@ public:  	{  	public:  		//input params +		S32* mDecompID;  		std::string mStage;  		std::vector<LLVector3> mPositions;  		std::vector<U16> mIndices; @@ -167,8 +168,12 @@ public:  		std::vector<LLPointer<LLVertexBuffer> > mHullMesh;  		LLModel::convex_hull_decomposition mHull; +		//status message callback, called from decomposition thread  		virtual S32 statusCallback(const char* status, S32 p1, S32 p2) = 0; + +		//completed callback, called from the main thread  		virtual void completed() = 0; +  		virtual void setStatusMessage(const std::string& msg);  	}; @@ -193,6 +198,9 @@ public:  	void doDecompositionSingleHull();  	virtual void run(); +	 +	void completeCurrent(); +	void notifyCompleted();  	std::map<std::string, S32> mStageID; @@ -201,6 +209,8 @@ public:  	LLPointer<Request> mCurRequest; +	std::queue<LLPointer<Request> > mCompletedQ; +  };  class LLMeshRepoThread : public LLThread diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index ee47e53db9..0fdcf486e7 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -64,7 +64,7 @@    <text bottom_delta="25" left="25" width="100" follows="bottom|left">Upload Details</text>    <panel top_pad="5" border="true" left="15" width="290" height="70" follows="bottom|left" -          bevel_style="in" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3"> +          bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">      <text left="25" follows="bottom|left" width="140" height="15" name="streaming cost">        Resource Cost: [COST]      </text> @@ -222,30 +222,25 @@        label="Physics"        name="physics_panel"> -      <!-- PHYSICS STEP ONE--> +      <!-- PHYSICS GEOMETRY-->        <panel          follows="top|left" -        name="physics step 1" +        name="physics geometry"          left="0"          top="0" -        width="260" -        height="450" -        visible="true"> - -        <text follows="left|top" bottom="40" height="30" left="10" font="SansSerifBig"> -          Step 1: Geometry -        </text> - -        <radio_group follows="top|left" top_pad="5" width="240" height="70" name="physics_load_radio" value="physics_load_from_file"> -          <radio_item bottom="50" name="physics_load_from_file" label="Load from file"/> -          <radio_item bottom="0" name="physics_use_lod" label="Use Level of Detail"/> +        width="300" +        height="80" +        visible="true" +        border="true" +        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3"> + +        <radio_group follows="top|left" top="10" width="240" height="40" name="physics_load_radio" value="physics_load_from_file"> +          <radio_item bottom="0" name="physics_load_from_file" label="File:"/> +          <radio_item bottom="23" name="physics_use_lod" label="Use Level of Detail:"/>          </radio_group> -        <line_editor follows="left|top" bottom_delta="-25" width="140" left="30" value="" name="physics_file" height="20"/> -        <button bottom_delta="3" name="physics_browse" label="Browse..." left_pad="5" follows="left|top" width="70" height="25"/> - -        <combo_box left="30" bottom_delta="40" follows="left|top" height="18" -	        name="physics_lod_combo" width="90" tool_tip="LOD to use for physics shape"> +        <combo_box left="180" top="10" follows="left|top" height="18" +	        name="physics_lod_combo" width="110" tool_tip="LOD to use for physics shape">            <combo_item name="physics_lowest">              Lowest            </combo_item> @@ -260,120 +255,103 @@            </combo_item>          </combo_box> -        <!-- -        <text follows="top|left" name="physics_triangles" top_pad="15" height="15" left="10"> -          Triangles:  [TRIANGLES] -        </text> -        <text follows="top|left" name="physics_hulls" top_pad="5" height="15"> -          Hulls:      [HULLS] -        </text> -        <text follows="top|left" name="physics_points" top_pad="5" height="15"> -          Points:     [POINTS] -        </text> - -        <text follows="top|left" left="140" width="100"  bottom_delta="-40" height="15"> -          Layer: -        </text> -        <combo_box name="physics_layer" follows="top|left" width="100" height="20" top_pad="5"/> -         --> +        <line_editor follows="left|top" top_pad="5" width="140" left="60" value="" name="physics_file" height="20"/> +        <button left_pad="10" name="physics_browse" label="Browse..." follows="left|top" width="70" height="20"/> -        <button bottom="440" left="180" width="80" follows="bottom|right" label="Optimize" name="physics_optimize" height="20"/> -         -      </panel> +        <!-- +        <check_box name="physics_optimize" follows="left|top" width="130" left="10" top_pad="5" height="20" label="Optimize"/> +        <check_box name="physics_use_hull" follows="left|top" width="130" left_pad="5" height="20" label="Use Convex Hull"/> +        --> +     </panel> -      <!-- PHYSICS STEP 2--> +      <!-- PHYSICS ANALYSIS-->        <panel         follows="top|left" -       name="physics step 2" +       name="physics analysis" +       top_pad="0"         left="0" -       top="0" -       width="260" -       height="450" -       visible="false"> +       width="300" +       height="130" +       visible="true" +       border="true" +       bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">          <text follows="left|top" bottom="40" height="30" left="10" font="SansSerifBig"> -          Step 2: Decompose +          Step 1: Analysis          </text> -        <text top_pad="100" follows="top|left" height="15"> -          Decompose Method: +        <text top_pad="5" width="50" follows="top|left" height="15"> +          Method:          </text> -        <combo_box name="Method" follows="top|left" top_pad="5" height="20" width="100"/> -        <text top_pad="10" follows="top|left" height="15"> +        <combo_box name="Method" follows="top|left" left_pad="5" bottom_delta="2" height="20" width="80"/> +        <text left="160" bottom_delta="-2" width="50" follows="top|left" height="15">            Quality:          </text> -        <combo_box name="Decompose Quality" follows="top|left" top_pad="5" height="20" width="100"/> +        <combo_box name="Decompose Quality" bottom_delta="2" follows="top|left" left_pad="5" height="20" width="80"/> -        <check_box name="Simplify Coplanar" follows="top|left" top_pad="10" height="15" label="Simplify Coplaner"/> -        <check_box name="Close Holes (Slow)" follows="top|left" top_pad="10" height="15" label="Close Holes (slow)"/> -        <slider name="Cosine%" width="240" follows="top|left" top_pad="10" height="20" label="Cosine %"/> +        <slider name="Smooth" left="10" width="280" follows="top|left" top_pad="10" height="20" label="Smooth:"/> -        <text follows="top|left" top_pad="20" height="30" width="260"> -          "Note: Only models that have been Decomposed" -          "can be made Physical or used as Vehicles." -        </text> - -        <button bottom="440" left="90" width="80" follows="bottom|right" label="<< Back" name="decompose_back" height="20"/> -        <button left_pad="5" width="90" follows="bottom|right" label="Decompose" name="Decompose" height="20"/> +        <check_box name="Close Holes (Slow)" follows="top|left" top_pad="10" height="15" label="Close Holes (slow)"/> +                 +        <button left="200" bottom_delta="0" width="90" follows="top|left" label="Analyze" name="Decompose" height="20"/>        </panel> -      <!-- PHYSICS STEP 3 --> -      <panel +      <!-- PHYSICS SIMPLIFICATION --> +     <panel         follows="top|left" -       name="physics step 3" +       name="physics simplification"         left="0" -       top="0" -       width="260" -       height="450" -       visible="false"> +       top_pad="0" +       width="300" +       height="150" +       visible="true" +       border="true" +       bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">          <text follows="left|top" bottom="40" height="30" left="10" font="SansSerifBig"> -          Step 3: Simplify +          Step 2: Simplification          </text> -        <text left="10" top_pad="100" height="15" width="240" follows="top|left"> -          Simplify Method: +        <text left="10" top_pad="5" height="15" width="140" follows="top|left"> +          Method:          </text> -        <combo_box top_pad="5" height="20" width="100" follows="top|left" name="Simplify Method"/> +        <combo_box left_pad="5" height="20" width="120" follows="top|left" name="Simplify Method"/> -        <slider name="Combine Quality" label="Combine Quality:" label_width="100" width="260" follows="top|left" top_pad="10" height="20"/> -        <slider name="Detail Scale" label="Detail Scale:" label_width="100" width="260" follows="top|left" top_pad="10" height="20"/> -        <slider name="Retain%" label="Retain %:" label_width="100" width="260" follows="top|left" top_pad="10" height="20"/> -         -        <button bottom="440" left="90" width="80" follows="bottom|right" label="<< Back" name="simplify_back" height="20"/> -        <button left_pad="5" width="90" follows="bottom|right" label="Simplify" name="Simplify" height="20"/> +        <slider left="10" name="Combine Quality" label="Passes:" label_width="120" width="270" follows="top|left" top_pad="10" height="20"/> +        <slider name="Detail Scale" label="Detail Scale:" label_width="120" width="270" follows="top|left" top_pad="10" height="20"/> +        <slider name="Retain%" label="Retain:" label_width="120" width="270" follows="top|left" bottom_delta="0" left_delta="0" visible="false" height="20"/> +        <button left="190" width="90" follows="top|left" label="Simplify" name="Simplify" height="20"/>        </panel>        <!-- INFO PANEL -->        <panel          left="0" -        top="35" -        width="260" +        top_pad="0" +        width="300"          height="100"          follows="left|top"          name="physics info" -        visible="false"> +        visible="true" +        border="true"  +        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3"> -        <text follows="top|left" name="physics_triangles" top_pad="15" height="15" left="10"> -          Triangles:  [TRIANGLES] -        </text> -        <text follows="top|left" name="physics_hulls" top_pad="5" height="15"> -          Hulls:      [HULLS] +        <slider name="physics_explode" follows="top|left" top="10" left="10" label="Preview Spread:" min_val="0.0" max_val="3.0" height="20" width="280"/> +         +        <text follows="top|left" name="physics_triangles" top_pad="10" height="15" left="10"> +          Triangles: [TRIANGLES]          </text>          <text follows="top|left" name="physics_points" top_pad="5" height="15"> -          Points:     [POINTS] +          Vertices: [POINTS]          </text> - -        <text follows="top|left" left="140" width="100"  bottom_delta="-40" height="15"> -          Layer: +        <text follows="top|left" name="physics_hulls" top_pad="5" height="15"> +          Hulls: [HULLS]          </text> -        <combo_box name="physics_layer" follows="top|left" width="100" height="20" top_pad="5"/> -        <slider name="physics_explode" follows="top|left" top_pad="25" left="10" label="Explode" min_val="0.0" max_val="3.0" height="20" width="240"/> +        </panel>      </panel> diff --git a/install.xml b/install.xml index 49f16876cc..27181850e8 100755 --- a/install.xml +++ b/install.xml @@ -1058,9 +1058,9 @@ anguage Infrstructure (CLI) international standard</string>            <key>windows</key>            <map>              <key>md5sum</key> -            <string>50fb24b9ad5baf16cbd7b7bf8a607010</string> +            <string>5ae8bab01189c5dbbc6f383c751e031a</string>              <key>url</key> -            <uri>scp:install-packages.lindenlab.com:/local/www/install-packages/doc/llconvexdecomposition-0.3-windows-20101015a.tar.bz2</uri> +            <uri>scp:install-packages.lindenlab.com:/local/www/install-packages/doc/llconvexdecomposition-0.3-windows-20101222.tar.bz2</uri>            </map>            <key>linux</key>            <map> | 
