summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelobject.cpp')
-rw-r--r--indra/newview/llpanelobject.cpp145
1 files changed, 18 insertions, 127 deletions
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 0300ea0c92..64af6c2157 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -67,7 +67,6 @@
#include "pipeline.h"
#include "llviewercontrol.h"
#include "lluictrlfactory.h"
-#include "llmeshrepository.h"
//#include "llfirstuse.h"
#include "lldrawpool.h"
@@ -132,27 +131,7 @@ BOOL LLPanelObject::postBuild()
// Phantom checkbox
mCheckPhantom = getChild<LLCheckBoxCtrl>("Phantom Checkbox Ctrl");
childSetCommitCallback("Phantom Checkbox Ctrl",onCommitPhantom,this);
-
- // PhysicsShapeType combobox
- mComboPhysicsShapeType = getChild<LLComboBox>("Physics Shape Type Combo Ctrl");
- mComboPhysicsShapeType->setCommitCallback(boost::bind(&LLPanelObject::sendPhysicsShapeType, this, _1, mComboPhysicsShapeType));
-
- // PhysicsGravity
- mSpinPhysicsGravity = getChild<LLSpinCtrl>("Physics Gravity");
- mSpinPhysicsGravity->setCommitCallback(boost::bind(&LLPanelObject::sendPhysicsGravity, this, _1, mSpinPhysicsGravity));
-
- // PhysicsFriction
- mSpinPhysicsFriction = getChild<LLSpinCtrl>("Physics Friction");
- mSpinPhysicsFriction->setCommitCallback(boost::bind(&LLPanelObject::sendPhysicsFriction, this, _1, mSpinPhysicsFriction));
-
- // PhysicsDensity
- mSpinPhysicsDensity = getChild<LLSpinCtrl>("Physics Density");
- mSpinPhysicsDensity->setCommitCallback(boost::bind(&LLPanelObject::sendPhysicsDensity, this, _1, mSpinPhysicsDensity));
-
- // PhysicsRestitution
- mSpinPhysicsRestitution = getChild<LLSpinCtrl>("Physics Restitution");
- mSpinPhysicsRestitution->setCommitCallback(boost::bind(&LLPanelObject::sendPhysicsRestitution, this, _1, mSpinPhysicsRestitution));
-
+
// Position
mLabelPosition = getChild<LLTextBox>("label position");
@@ -541,19 +520,7 @@ void LLPanelObject::getState( )
mCheckPhantom->set( mIsPhantom );
mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible );
-
- mSpinPhysicsGravity->set(objectp->getPhysicsGravity());
- mSpinPhysicsGravity->setEnabled(editable);
-
- mSpinPhysicsFriction->set(objectp->getPhysicsFriction());
- mSpinPhysicsFriction->setEnabled(editable);
-
- mSpinPhysicsDensity->set(objectp->getPhysicsDensity());
- mSpinPhysicsDensity->setEnabled(editable);
-
- mSpinPhysicsRestitution->set(objectp->getPhysicsRestitution());
- mSpinPhysicsRestitution->setEnabled(editable);
-
+
#if 0 // 1.9.2
mCastShadows = root_objectp->flagCastShadows();
mCheckCastShadows->set( mCastShadows );
@@ -1132,15 +1099,13 @@ 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)
{
- LLUUID id;
+
+
+ LLUUID id;
LLSculptParams *sculpt_params = (LLSculptParams *)objectp->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
@@ -1152,27 +1117,29 @@ void LLPanelObject::getState( )
mSculptTypeRevert = sculpt_params->getSculptType();
}
+ U8 sculpt_type = sculpt_params->getSculptType();
+ 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);
+
LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control");
if(mTextureCtrl)
{
mTextureCtrl->setTentative(FALSE);
- mTextureCtrl->setEnabled(editable);
+ mTextureCtrl->setEnabled(editable && !isMesh);
if (editable)
mTextureCtrl->setImageAssetID(sculpt_params->getSculptTexture());
else
mTextureCtrl->setImageAssetID(LLUUID::null);
}
- U8 sculpt_type = sculpt_params->getSculptType();
- 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);
+ mComboBaseType->setEnabled(!isMesh);
if (mCtrlSculptType)
{
mCtrlSculptType->setCurrentByIndex(sculpt_stitching);
- mCtrlSculptType->setEnabled(editable);
+ mCtrlSculptType->setEnabled(editable && !isMesh);
}
if (mCtrlSculptMirror)
@@ -1199,27 +1166,6 @@ void LLPanelObject::getState( )
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));
- }
- }
- else
- {
- // simple prims always allow physics shape prim
- mComboPhysicsShapeType->add(getString("Prim"), LLSD(0));
- }
- mComboPhysicsShapeType->add(getString("Convex Hull"), LLSD(2));
- mComboPhysicsShapeType->setValue(LLSD(objectp->getPhysicsShapeType()));
- mComboPhysicsShapeType->setEnabled(editable);
-
-
//----------------------------------------------------------------------------
mObject = objectp;
@@ -1282,48 +1228,6 @@ void LLPanelObject::sendIsPhantom()
}
}
-void LLPanelObject::sendPhysicsShapeType(LLUICtrl* ctrl, void* userdata)
-{
- U8 type = ctrl->getValue().asInteger();
- LLSelectMgr::getInstance()->selectionSetPhysicsType(type);
-
- refreshCost();
-}
-
-void LLPanelObject::sendPhysicsGravity(LLUICtrl* ctrl, void* userdata)
-{
- F32 val = ctrl->getValue().asReal();
- LLSelectMgr::getInstance()->selectionSetGravity(val);
-}
-
-void LLPanelObject::sendPhysicsFriction(LLUICtrl* ctrl, void* userdata)
-{
- F32 val = ctrl->getValue().asReal();
- LLSelectMgr::getInstance()->selectionSetFriction(val);
-}
-
-void LLPanelObject::sendPhysicsRestitution(LLUICtrl* ctrl, void* userdata)
-{
- F32 val = ctrl->getValue().asReal();
- LLSelectMgr::getInstance()->selectionSetRestitution(val);
-}
-
-void LLPanelObject::sendPhysicsDensity(LLUICtrl* ctrl, void* userdata)
-{
- F32 val = ctrl->getValue().asReal();
- LLSelectMgr::getInstance()->selectionSetDensity(val);
-}
-
-void LLPanelObject::refreshCost()
-{
- LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
-
- if (obj)
- {
- obj->getObjectCost();
- }
-}
-
void LLPanelObject::sendCastShadows()
{
BOOL value = mCheckCastShadows->get();
@@ -1924,31 +1828,23 @@ void LLPanelObject::refresh()
}
bool enable_mesh = gSavedSettings.getBOOL("MeshEnabled") &&
+ gAgent.getRegion() &&
!gAgent.getRegion()->getCapability("GetMesh").empty();
- getChildView("label physicsshapetype")->setVisible(enable_mesh);
- getChildView("Physics Shape Type Combo Ctrl")->setVisible(enable_mesh);
- getChildView("Physics Gravity")->setVisible(enable_mesh);
- getChildView("Physics Material Override")->setVisible(enable_mesh);
- getChildView("Physics Friction")->setVisible(enable_mesh);
- getChildView("Physics Density")->setVisible(enable_mesh);
- getChildView("Physics Restitution")->setVisible(enable_mesh);
-
F32 max_scale = get_default_max_prim_scale(LLPickInfo::isFlora(mObject));
getChild<LLSpinCtrl>("Scale X")->setMaxValue(max_scale);
getChild<LLSpinCtrl>("Scale Y")->setMaxValue(max_scale);
getChild<LLSpinCtrl>("Scale Z")->setMaxValue(max_scale);
- LLComboBox* sculpt_combo = getChild<LLComboBox>("sculpt type control");
- BOOL found = sculpt_combo->itemExists("Mesh");
+ BOOL found = mCtrlSculptType->itemExists("Mesh");
if (enable_mesh && !found)
{
- sculpt_combo->add("Mesh");
+ mCtrlSculptType->add("Mesh");
}
else if (!enable_mesh && found)
{
- sculpt_combo->remove("Mesh");
+ mCtrlSculptType->remove("Mesh");
}
}
@@ -2037,11 +1933,6 @@ void LLPanelObject::clearCtrls()
mCheckPhantom ->set(FALSE);
mCheckPhantom ->setEnabled( FALSE );
- mSpinPhysicsGravity->setEnabled(FALSE);
- mSpinPhysicsFriction->setEnabled(FALSE);
- mSpinPhysicsDensity->setEnabled(FALSE);
- mSpinPhysicsRestitution->setEnabled(FALSE);
-
#if 0 // 1.9.2
mCheckCastShadows->set(FALSE);
mCheckCastShadows->setEnabled( FALSE );