diff options
Diffstat (limited to 'indra')
| -rwxr-xr-x | indra/newview/llmeshrepository.cpp | 6 | ||||
| -rw-r--r-- | indra/newview/llmeshrepository.h | 3 | ||||
| -rw-r--r-- | indra/newview/llpanelobject.cpp | 47 | ||||
| -rw-r--r-- | indra/newview/llspatialpartition.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_tools.xml | 18 | 
5 files changed, 51 insertions, 25 deletions
| diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 1ff11f2c01..8d5ef4ae3d 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2667,6 +2667,12 @@ void LLMeshRepository::buildHull(const LLVolumeParams& params, S32 detail)  	LLPrimitive::sVolumeManager->unrefVolume(volume);  } +bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id) +{ +	LLSD mesh = mThread->getMeshHeader(mesh_id); +	return mesh.has("physics_shape") && mesh["physics_shape"].has("size") && (mesh["physics_shape"]["size"].asInteger() > 0); +} +  const LLSD& LLMeshRepository::getMeshHeader(const LLUUID& mesh_id)  {  	return mThread->getMeshHeader(mesh_id); diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index df00c6c7aa..8687ac750b 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -458,7 +458,8 @@ public:  	const LLMeshSkinInfo* getSkinInfo(const LLUUID& mesh_id);  	const LLMeshDecomposition* getDecomposition(const LLUUID& mesh_id);  	void fetchPhysicsShape(const LLUUID& mesh_id); - +	bool hasPhysicsShape(const LLUUID& mesh_id); +	  	void buildHull(const LLVolumeParams& params, S32 detail);  	const LLSD& getMeshHeader(const LLUUID& mesh_id); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 4a1385134e..462ec2e75c 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -67,6 +67,7 @@  #include "pipeline.h"  #include "llviewercontrol.h"  #include "lluictrlfactory.h" +#include "llmeshrepository.h"  //#include "llfirstuse.h"  #include "lldrawpool.h" @@ -539,8 +540,6 @@ void LLPanelObject::getState( )  	mCheckPhantom->set( mIsPhantom );  	mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible ); -	mComboPhysicsShapeType->setCurrentByIndex(objectp->getPhysicsShapeType()); -	mComboPhysicsShapeType->setEnabled(editable);  	mSpinPhysicsGravity->set(objectp->getPhysicsGravity());  	mSpinPhysicsGravity->setEnabled(editable); @@ -604,6 +603,7 @@ void LLPanelObject::getState( )  	BOOL enabled = FALSE;  	BOOL hole_enabled = FALSE;  	F32 scale_x=1.f, scale_y=1.f; +	BOOL isMesh = FALSE;  	if( !objectp || !objectp->getVolume() || !editable || !single_volume)  	{ @@ -634,10 +634,9 @@ void LLPanelObject::getState( )  		// Only allowed to change these parameters for objects  		// that you have permissions on AND are not attachments.  		enabled = root_objectp->permModify(); - -		const LLVolumeParams &volume_params = objectp->getVolume()->getParams(); - +		  		// Volume type +		const LLVolumeParams &volume_params = objectp->getVolume()->getParams();  		U8 path = volume_params.getPathParams().getCurveType();  		U8 profile_and_hole = volume_params.getProfileParams().getCurveType();  		U8 profile	= profile_and_hole & LL_PCODE_PROFILE_MASK; @@ -868,7 +867,7 @@ void LLPanelObject::getState( )  		}  		mSpinSkew->set( skew );  	} - +	  	// Compute control visibility, label names, and twist range.  	// Start with defaults.  	BOOL cut_visible                = TRUE; @@ -1132,6 +1131,10 @@ void LLPanelObject::getState( )  	mCtrlSculptInvert->setVisible(sculpt_texture_visible); +	// update the physics shape combo to include allowed physics shapes +	mComboPhysicsShapeType->removeall(); +	mComboPhysicsShapeType->add(getString("None"), LLSD(1)); +	  	// sculpt texture  	if (selected_item == MI_SCULPT) @@ -1163,6 +1166,7 @@ void LLPanelObject::getState( )  			U8 sculpt_stitching = sculpt_type & LL_SCULPT_TYPE_MASK;  			BOOL sculpt_invert = sculpt_type & LL_SCULPT_FLAG_INVERT;  			BOOL sculpt_mirror = sculpt_type & LL_SCULPT_FLAG_MIRROR; +			isMesh = (sculpt_stitching == LL_SCULPT_TYPE_MESH);  			if (mCtrlSculptType)  			{ @@ -1179,20 +1183,43 @@ void LLPanelObject::getState( )  			if (mCtrlSculptInvert)  			{  				mCtrlSculptInvert->set(sculpt_invert); -				mCtrlSculptInvert->setEnabled(editable && (sculpt_stitching != LL_SCULPT_TYPE_MESH)); +				mCtrlSculptInvert->setEnabled(editable && (!isMesh));  			}  			if (mLabelSculptType)  			{  				mLabelSculptType->setEnabled(TRUE);  			} +			  		}  	}  	else  	{ -		mSculptTextureRevert = LLUUID::null; +		mSculptTextureRevert = LLUUID::null;		  	} +	if(isMesh && objectp) +	{ +		const LLVolumeParams &volume_params = objectp->getVolume()->getParams(); +		LLUUID mesh_id = volume_params.getSculptID(); +		if(gMeshRepo.hasPhysicsShape(mesh_id)) +		{ +			// if a mesh contains an uploaded or decomposed physics mesh, +			// allow 'Prim' +			mComboPhysicsShapeType->add(getString("Prim"), LLSD(0));			 +		} +		// meshes always allow convex hull +		mComboPhysicsShapeType->add(getString("Convex Hull"), LLSD(2));	 +	} +	else +	{ +		// simple prims always allow physics shape prim +		mComboPhysicsShapeType->add(getString("Prim"), LLSD(0));	 +	} +	 +	mComboPhysicsShapeType->setValue(LLSD(objectp->getPhysicsShapeType())); +	mComboPhysicsShapeType->setEnabled(editable); +										  	//---------------------------------------------------------------------------- @@ -1268,7 +1295,9 @@ public:  void LLPanelObject::sendPhysicsParam()  { -	U8 type = (U8)mComboPhysicsShapeType->getCurrentIndex(); +	LLSD physicsType = mComboPhysicsShapeType->getValue(); +	 +	U8 type = physicsType.asInteger();  	F32 gravity = mSpinPhysicsGravity->get();  	F32 friction = mSpinPhysicsFriction->get();  	F32 density = mSpinPhysicsDensity->get(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index bd6be14341..6b77209867 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2900,7 +2900,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)  	LLVolumeParams volume_params = volume->getVolume()->getParams(); -	LLPhysicsVolumeParams physics_params(volume->getVolume()->getParams(),  +	LLPhysicsVolumeParams physics_params(volume_params,   		physics_type == LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL);   	LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification physics_spec; diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index f6f74f2ebd..1f79cf310e 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1291,6 +1291,9 @@ even though the user gets a free copy.           name="Object"           top="16"           width="295"> +	<panel.string name="None">None</panel.string> +	<panel.string name="Prim">Prim</panel.string> +	<panel.string name="Convex Hull">Convex Hull</panel.string>              <check_box               height="19"               label="Locked" @@ -1516,20 +1519,7 @@ even though the user gets a free copy.  			   name="Physics Shape Type Combo Ctrl"  			   tool_tip="Choose the physics shape type"  			   left_pad="0" -			   width="108"> -			  <combo_box.item -				 label="Prim" -				 name="Prim" -				 value="Prim" /> -			  <combo_box.item -				 label="None" -				 name="None" -				 value="None" /> -			  <combo_box.item -				 label="Convex Hull" -				 name="Convex Hull" -				 value="Convex Hull" /> -			</combo_box> +			   width="108"/>              <spinner               follows="left|top" | 
