summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelvolume.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-03-19 12:53:05 +0000
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-03-19 12:53:05 +0000
commit62be7c38965deb79cbd984cfd4546be040f9c465 (patch)
tree492a84da19dc4ba05d41fdc083ad5f579f39b2ee /indra/newview/llpanelvolume.cpp
parent9a6dcc011c54f65e5da3c3b92074386946d8f291 (diff)
parent328329fceab6b18dd7dda6f7ce9a3d4788fd7c54 (diff)
Merged master into sl-11445_fmodstudio
Diffstat (limited to 'indra/newview/llpanelvolume.cpp')
-rw-r--r--indra/newview/llpanelvolume.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index 735eaa423d..6ad6a172b1 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -31,7 +31,6 @@
// linden library includes
#include "llclickaction.h"
-#include "lleconomy.h"
#include "llerror.h"
#include "llfontgl.h"
#include "llflexibleobject.h"
@@ -82,8 +81,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 +832,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 +843,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);
}
}