merge changes for DRTVWR-213

master
Oz Linden 2012-09-11 10:20:06 -04:00
commit 1dd256f7a8
5 changed files with 62 additions and 33 deletions

View File

@ -302,3 +302,4 @@ b1dbb1a83f48f93f6f878cff9e52d2cb635e145c 3.4.0-beta2
8c9085066c78ed5f6c9379dc054c82a6fcdb1851 DRTVWR-207
351eea5f9dc192fc5ddea3b02958de97677a0a12 3.3.4-release3
af7b28e75bd5a629cd9e0dc46fb3f1757626f493 DRTVWR-212
015012c2b740ccdec8a8c3d6e5f898449ecfe0b8 DRTVWR-213

View File

@ -98,7 +98,11 @@ LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed)
mLabelSuggestedUseD(NULL),
mEditD(NULL),
mApplyEditsButton(NULL),
mBeaconColor()
mBeaconColor(),
mPreviousValueA(LLPathfindingLinkset::MAX_WALKABILITY_VALUE),
mPreviousValueB(LLPathfindingLinkset::MAX_WALKABILITY_VALUE),
mPreviousValueC(LLPathfindingLinkset::MAX_WALKABILITY_VALUE),
mPreviousValueD(LLPathfindingLinkset::MAX_WALKABILITY_VALUE)
{
}
@ -168,7 +172,7 @@ BOOL LLFloaterPathfindingLinksets::postBuild()
mEditA = findChild<LLLineEditor>("edit_a_value");
llassert(mEditA != NULL);
mEditA->setPrevalidate(LLTextValidate::validateNonNegativeS32);
mEditA->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1));
mEditA->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1, mPreviousValueA));
mLabelEditB = findChild<LLTextBase>("edit_b_label");
llassert(mLabelEditB != NULL);
@ -179,7 +183,7 @@ BOOL LLFloaterPathfindingLinksets::postBuild()
mEditB = findChild<LLLineEditor>("edit_b_value");
llassert(mEditB != NULL);
mEditB->setPrevalidate(LLTextValidate::validateNonNegativeS32);
mEditB->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1));
mEditB->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1, mPreviousValueB));
mLabelEditC = findChild<LLTextBase>("edit_c_label");
llassert(mLabelEditC != NULL);
@ -190,7 +194,7 @@ BOOL LLFloaterPathfindingLinksets::postBuild()
mEditC = findChild<LLLineEditor>("edit_c_value");
llassert(mEditC != NULL);
mEditC->setPrevalidate(LLTextValidate::validateNonNegativeS32);
mEditC->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1));
mEditC->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1, mPreviousValueC));
mLabelEditD = findChild<LLTextBase>("edit_d_label");
llassert(mLabelEditD != NULL);
@ -201,7 +205,7 @@ BOOL LLFloaterPathfindingLinksets::postBuild()
mEditD = findChild<LLLineEditor>("edit_d_value");
llassert(mEditD != NULL);
mEditD->setPrevalidate(LLTextValidate::validateNonNegativeS32);
mEditD->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1));
mEditD->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1, mPreviousValueD));
mApplyEditsButton = findChild<LLButton>("apply_edit_values");
llassert(mApplyEditsButton != NULL);
@ -323,26 +327,38 @@ void LLFloaterPathfindingLinksets::onClearFiltersClicked()
rebuildObjectsScrollList();
}
void LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl)
void LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl, LLSD &pPreviousValue)
{
LLLineEditor *pLineEditor = static_cast<LLLineEditor *>(pUICtrl);
llassert(pLineEditor != NULL);
const std::string &valueString = pLineEditor->getText();
S32 value;
if (LLStringUtil::convertToS32(valueString, value))
S32 intValue;
LLSD value;
bool doResetValue = false;
if (valueString.empty())
{
if ((value < LLPathfindingLinkset::MIN_WALKABILITY_VALUE) || (value > LLPathfindingLinkset::MAX_WALKABILITY_VALUE))
{
value = llclamp(value, LLPathfindingLinkset::MIN_WALKABILITY_VALUE, LLPathfindingLinkset::MAX_WALKABILITY_VALUE);
pLineEditor->setValue(LLSD(value));
}
value = pPreviousValue;
doResetValue = true;
}
else if (LLStringUtil::convertToS32(valueString, intValue))
{
doResetValue = ((intValue < LLPathfindingLinkset::MIN_WALKABILITY_VALUE) || (intValue > LLPathfindingLinkset::MAX_WALKABILITY_VALUE));
value = LLSD(llclamp(intValue, LLPathfindingLinkset::MIN_WALKABILITY_VALUE, LLPathfindingLinkset::MAX_WALKABILITY_VALUE));
}
else
{
pLineEditor->setValue(LLSD(LLPathfindingLinkset::MAX_WALKABILITY_VALUE));
value = LLSD(LLPathfindingLinkset::MAX_WALKABILITY_VALUE);
doResetValue = true;
}
if (doResetValue)
{
pLineEditor->setValue(value);
}
pPreviousValue = value;
}
void LLFloaterPathfindingLinksets::onApplyChangesClicked()
@ -376,10 +392,14 @@ void LLFloaterPathfindingLinksets::updateEditFieldValues()
const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(firstSelectedObjectPtr.get());
setEditLinksetUse(linkset->getLinksetUse());
mEditA->setValue(LLSD(linkset->getWalkabilityCoefficientA()));
mEditB->setValue(LLSD(linkset->getWalkabilityCoefficientB()));
mEditC->setValue(LLSD(linkset->getWalkabilityCoefficientC()));
mEditD->setValue(LLSD(linkset->getWalkabilityCoefficientD()));
mPreviousValueA = LLSD(linkset->getWalkabilityCoefficientA());
mPreviousValueB = LLSD(linkset->getWalkabilityCoefficientB());
mPreviousValueC = LLSD(linkset->getWalkabilityCoefficientC());
mPreviousValueD = LLSD(linkset->getWalkabilityCoefficientD());
mEditA->setValue(mPreviousValueA);
mEditB->setValue(mPreviousValueB);
mEditC->setValue(mPreviousValueC);
mEditD->setValue(mPreviousValueD);
}
}

View File

@ -74,7 +74,7 @@ private:
void onApplyAllFilters();
void onClearFiltersClicked();
void onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl);
void onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl, LLSD &pPreviousValue);
void onApplyChangesClicked();
void clearFilters();
@ -132,6 +132,11 @@ private:
LLButton *mApplyEditsButton;
LLColor4 mBeaconColor;
LLSD mPreviousValueA;
LLSD mPreviousValueB;
LLSD mPreviousValueC;
LLSD mPreviousValueD;
};
#endif // LL_LLFLOATERPATHFINDINGLINKSETS_H

View File

@ -1433,9 +1433,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
#else
val = (U16 *) &data[count];
#endif
setAngularVelocity( U16_to_F32(val[VX], -size, size),
U16_to_F32(val[VY], -size, size),
U16_to_F32(val[VZ], -size, size));
new_angv.set(U16_to_F32(val[VX], -size, size),
U16_to_F32(val[VY], -size, size),
U16_to_F32(val[VZ], -size, size));
setAngularVelocity(new_angv);
break;
case 16:
@ -1459,9 +1460,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
new_rot.mQ[VZ] = U8_to_F32(data[11], -1.f, 1.f);
new_rot.mQ[VW] = U8_to_F32(data[12], -1.f, 1.f);
setAngularVelocity( U8_to_F32(data[13], -size, size),
U8_to_F32(data[14], -size, size),
U8_to_F32(data[15], -size, size) );
new_angv.set(U8_to_F32(data[13], -size, size),
U8_to_F32(data[14], -size, size),
U8_to_F32(data[15], -size, size));
setAngularVelocity(new_angv);
break;
}
@ -1533,9 +1535,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
dp->unpackU16(val[VX], "AccX");
dp->unpackU16(val[VY], "AccY");
dp->unpackU16(val[VZ], "AccZ");
setAngularVelocity( U16_to_F32(val[VX], -64.f, 64.f),
U16_to_F32(val[VY], -64.f, 64.f),
U16_to_F32(val[VZ], -64.f, 64.f));
new_angv.set(U16_to_F32(val[VX], -64.f, 64.f),
U16_to_F32(val[VY], -64.f, 64.f),
U16_to_F32(val[VZ], -64.f, 64.f));
setAngularVelocity(new_angv);
}
break;
case OUT_FULL_COMPRESSED:
@ -1579,8 +1582,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
if (value & 0x80)
{
dp->unpackVector3(vec, "Omega");
setAngularVelocity(vec);
dp->unpackVector3(new_angv, "Omega");
setAngularVelocity(new_angv);
}
if (value & 0x20)
@ -2074,7 +2077,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
{
if (new_angv != old_angv)
{
if (flagUsePhysics())
if (flagUsePhysics() || new_angv.isExactlyZero())
{
resetRot();
}

View File

@ -6,7 +6,7 @@
height="395"
width="1075"
min_height="395"
min_width="1075"
min_width="990"
layout="topleft"
name="floater_pathfinding_linksets"
help_topic="floater_pathfinding_linksets"
@ -524,7 +524,7 @@
tool_tip="Walkability for characters of type D. Example character type is other."
width="45" />
<button
follows="right|bottom"
follows="left|bottom"
height="21"
label="Apply changes"
layout="topleft"