summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelvolume.cpp
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2020-02-21 12:05:46 -0700
committerDave Houlton <euclid@lindenlab.com>2020-02-21 12:05:46 -0700
commit7674c00fb934b1269192553ccd0cd029d65a4e24 (patch)
treeb5ac7ac56e27105fcbf04d02aaebe31fdb6ce083 /indra/newview/llpanelvolume.cpp
parent01d4fd2451f6ba2f4f17c7fbf0f9511d37b20e21 (diff)
parent2c4133c8db131b08d40fc91e2881b873ea1a984d (diff)
Merge master (v 6.3.8) into DRTVWR-440
Diffstat (limited to 'indra/newview/llpanelvolume.cpp')
-rw-r--r--indra/newview/llpanelvolume.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index eba12b405e..d50cda2113 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -82,8 +82,11 @@
#include <boost/bind.hpp>
-// "Features" Tab
+const F32 DEFAULT_GRAVITY_MULTIPLIER = 1.f;
+const F32 DEFAULT_DENSITY = 1000.f;
+
+// "Features" Tab
BOOL LLPanelVolume::postBuild()
{
// Flexible Objects Parameters
@@ -830,7 +833,7 @@ void LLPanelVolume::onLightSelectTexture(const LLSD& data)
// static
void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
{
- //LLPanelObject* self = (LLPanelObject*) userdata;
+ LLPanelVolume* self = (LLPanelVolume*)userdata;
LLComboBox* box = (LLComboBox*) ctrl;
if (box)
@@ -841,6 +844,19 @@ void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
if (material_name != LEGACY_FULLBRIGHT_DESC)
{
U8 material_code = LLMaterialTable::basic.getMCode(material_name);
+ if (self)
+ {
+ LLViewerObject* objectp = self->mObject;
+ if (objectp)
+ {
+ objectp->setPhysicsGravity(DEFAULT_GRAVITY_MULTIPLIER);
+ objectp->setPhysicsFriction(LLMaterialTable::basic.getFriction(material_code));
+ //currently density is always set to 1000 serverside regardless of chosen material,
+ //actual material density should be used here, if this behavior change
+ objectp->setPhysicsDensity(DEFAULT_DENSITY);
+ objectp->setPhysicsRestitution(LLMaterialTable::basic.getRestitution(material_code));
+ }
+ }
LLSelectMgr::getInstance()->selectionSetMaterial(material_code);
}
}