Scott Lawrence avatar Scott Lawrence committed 62b07aa Merge

merge changes for DRTVWR-213

Comments (0)

Files changed (5)

 8c9085066c78ed5f6c9379dc054c82a6fcdb1851 DRTVWR-207
 351eea5f9dc192fc5ddea3b02958de97677a0a12 3.3.4-release3
 af7b28e75bd5a629cd9e0dc46fb3f1757626f493 DRTVWR-212
+015012c2b740ccdec8a8c3d6e5f898449ecfe0b8 DRTVWR-213

indra/newview/llfloaterpathfindinglinksets.cpp

 	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)
 {
 }
 
 	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);
 	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);
 	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);
 	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);
 	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()
 		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);
 	}
 }
 

indra/newview/llfloaterpathfindinglinksets.h

 
 	void onApplyAllFilters();
 	void onClearFiltersClicked();
-	void onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl);
+	void onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl, LLSD &pPreviousValue);
 	void onApplyChangesClicked();
 
 	void clearFilters();
 	LLButton         *mApplyEditsButton;
 
 	LLColor4         mBeaconColor;
+
+	LLSD             mPreviousValueA;
+	LLSD             mPreviousValueB;
+	LLSD             mPreviousValueC;
+	LLSD             mPreviousValueD;
 };
 
 #endif // LL_LLFLOATERPATHFINDINGLINKSETS_H

indra/newview/llviewerobject.cpp

 #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:
 					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;
 				}
 
 				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:
 
 				if (value & 0x80)
 				{
-					dp->unpackVector3(vec, "Omega");
-					setAngularVelocity(vec);
+					dp->unpackVector3(new_angv, "Omega");
+					setAngularVelocity(new_angv);
 				}
 
 				if (value & 0x20)
 	{
 		if (new_angv != old_angv)
 		{
-			if (flagUsePhysics())
+			if (flagUsePhysics() || new_angv.isExactlyZero())
 			{
 				resetRot();
 			}

indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml

     height="395"
     width="1075"
     min_height="395"
-    min_width="1075"
+    min_width="990"
     layout="topleft"
     name="floater_pathfinding_linksets"
     help_topic="floater_pathfinding_linksets"
         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"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.