Skip to content
Snippets Groups Projects
Commit f2d92b05 authored by maxim_productengine's avatar maxim_productengine
Browse files

SL-12087 FIXED Values for physical preset (wood, stone, metal, etc.) in build...

SL-12087 FIXED Values for physical preset (wood, stone, metal, etc.) in build tool don't update unless the edited object is reselected.
parent b9648501
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment