diff options
| author | Todd Stinson <stinson@lindenlab.com> | 2012-06-25 18:02:41 -0700 | 
|---|---|---|
| committer | Todd Stinson <stinson@lindenlab.com> | 2012-06-25 18:02:41 -0700 | 
| commit | ce101172954c9cbc9a089d8796643d545bdee9d5 (patch) | |
| tree | 590ee7fb969c5b29034b3e30879406c12c2b6fae | |
| parent | b6d42e0b6223a290f700d9ce9a8aea5f48764610 (diff) | |
PATH-718: Ensuring that the characters panel will work correctly with a stubbed physicsextension library.
| -rw-r--r-- | autobuild.xml | 12 | ||||
| -rw-r--r-- | indra/newview/llfloaterpathfindingcharacters.cpp | 40 | ||||
| -rw-r--r-- | indra/newview/llpathfindingcharacter.cpp | 5 | ||||
| -rw-r--r-- | indra/newview/llpathfindingcharacterlist.cpp | 6 | 
4 files changed, 41 insertions, 22 deletions
| diff --git a/autobuild.xml b/autobuild.xml index 17bdb74e0b..55b8a7f435 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1110,9 +1110,9 @@              <key>archive</key>              <map>                <key>hash</key> -              <string>06f13505e99259c3b8d1d1e8fe90b1c7</string> +              <string>9a37d0201667a971887604f171394966</string>                <key>url</key> -              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/stinson_llpathinglibrary/rev/260468/arch/Darwin/installer/llphysicsextensions-0.1-darwin-20120622.tar.bz2</string> +              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/stinson_llpathinglibrary/rev/260580/arch/Darwin/installer/llphysicsextensions-0.1-darwin-20120625.tar.bz2</string>              </map>              <key>name</key>              <string>darwin</string> @@ -1122,9 +1122,9 @@              <key>archive</key>              <map>                <key>hash</key> -              <string>737fcb1848fc230620a7d40706a96d34</string> +              <string>5600a7849a6bc00cfe08baa5bc251efd</string>                <key>url</key> -              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/stinson_llpathinglibrary/rev/260468/arch/Linux/installer/llphysicsextensions-0.1-linux-20120623.tar.bz2</string> +              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/stinson_llpathinglibrary/rev/260580/arch/Linux/installer/llphysicsextensions-0.1-linux-20120626.tar.bz2</string>              </map>              <key>name</key>              <string>linux</string> @@ -1134,9 +1134,9 @@              <key>archive</key>              <map>                <key>hash</key> -              <string>de32260c76aa70a3342757851dba6032</string> +              <string>bfcfb9bc885e46a1b97f8f91cf5d5fd1</string>                <key>url</key> -              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/stinson_llpathinglibrary/rev/260468/arch/CYGWIN/installer/llphysicsextensions-0.1-windows-20120622.tar.bz2</string> +              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/stinson_llpathinglibrary/rev/260580/arch/CYGWIN/installer/llphysicsextensions-0.1-windows-20120625.tar.bz2</string>              </map>              <key>name</key>              <string>windows</string> diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index 7a4c5c81cb..5245b78871 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -36,7 +36,9 @@  #include "llpathfindingcharacter.h"  #include "llpathfindingcharacterlist.h"  #include "llpathfindingmanager.h" +#include "llpathfindingobject.h"  #include "llpathfindingobjectlist.h" +#include "llpathinglib.h"  #include "llsd.h"  #include "lluicolortable.h"  #include "llviewerobject.h" @@ -63,7 +65,7 @@ BOOL LLFloaterPathfindingCharacters::isShowPhysicsCapsule() const  void LLFloaterPathfindingCharacters::setShowPhysicsCapsule(BOOL pIsShowPhysicsCapsule)  { -	mShowPhysicsCapsuleCheckBox->set(pIsShowPhysicsCapsule); +	mShowPhysicsCapsuleCheckBox->set(pIsShowPhysicsCapsule && (LLPathingLib::getInstance() != NULL));  }  BOOL LLFloaterPathfindingCharacters::isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos, LLQuaternion& rot) const @@ -115,6 +117,7 @@ BOOL LLFloaterPathfindingCharacters::postBuild()  	mShowPhysicsCapsuleCheckBox = findChild<LLCheckBoxCtrl>("show_physics_capsule");  	llassert(mShowPhysicsCapsuleCheckBox != NULL);  	mShowPhysicsCapsuleCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingCharacters::onShowPhysicsCapsuleClicked, this)); +	mShowPhysicsCapsuleCheckBox->setEnabled(LLPathingLib::getInstance() != NULL);  	return LLFloaterPathfindingObjects::postBuild();  } @@ -171,13 +174,23 @@ LLPathfindingObjectListPtr LLFloaterPathfindingCharacters::getEmptyObjectList()  void LLFloaterPathfindingCharacters::onShowPhysicsCapsuleClicked()  { -	if (mSelectedCharacterId.notNull() && isShowPhysicsCapsule()) +	if (LLPathingLib::getInstance() == NULL)  	{ -		showCapsule(); +		if (isShowPhysicsCapsule()) +		{ +			setShowPhysicsCapsule(FALSE); +		}  	}  	else  	{ -		hideCapsule(); +		if (mSelectedCharacterId.notNull() && isShowPhysicsCapsule()) +		{ +			showCapsule(); +		} +		else +		{ +			hideCapsule(); +		}  	}  } @@ -222,7 +235,7 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListData(const LLPathfi  void LLFloaterPathfindingCharacters::updateStateOnDisplayControls()  {  	int numSelectedItems = getNumSelectedObjects();; -	bool isEditEnabled = (numSelectedItems == 1); +	bool isEditEnabled = ((numSelectedItems == 1) && (LLPathingLib::getInstance() != NULL));  	mShowPhysicsCapsuleCheckBox->setEnabled(isEditEnabled);  	if (!isEditEnabled) @@ -256,6 +269,19 @@ void LLFloaterPathfindingCharacters::showCapsule() const  {  	if (mSelectedCharacterId.notNull() && isShowPhysicsCapsule())  	{ +		LLPathfindingObjectPtr objectPtr = getFirstSelectedObject(); +		llassert(objectPtr != NULL); +		if (objectPtr != NULL) +		{ +			const LLPathfindingCharacter *character = dynamic_cast<const LLPathfindingCharacter *>(objectPtr.get()); +			llassert(mSelectedCharacterId == character->getUUID()); +			if (LLPathingLib::getInstance() != NULL) +			{ +				LLPathingLib::getInstance()->createPhysicsCapsuleRep(character->getLength(), character->getRadius(), +					character->isHorizontal(), character->getUUID()); +			} +		} +  		gPipeline.hideObject(mSelectedCharacterId);  	}  } @@ -266,6 +292,10 @@ void LLFloaterPathfindingCharacters::hideCapsule() const  	{  		gPipeline.restoreHiddenObject(mSelectedCharacterId);  	} +	if (LLPathingLib::getInstance() != NULL) +	{ +		LLPathingLib::getInstance()->cleanupPhysicsCapsuleRepResiduals(); +	}  }  bool LLFloaterPathfindingCharacters::getCapsuleRenderData(LLVector3& pPosition, LLQuaternion& rot) const diff --git a/indra/newview/llpathfindingcharacter.cpp b/indra/newview/llpathfindingcharacter.cpp index 98e9141043..c9f3555e9c 100644 --- a/indra/newview/llpathfindingcharacter.cpp +++ b/indra/newview/llpathfindingcharacter.cpp @@ -31,7 +31,6 @@  #include "llpathfindingobject.h"  #include "llsd.h" -#include "llpathinglib.h"  #define CHARACTER_CPU_TIME_FIELD   "cpu_time"  #define CHARACTER_HORIZONTAL_FIELD "horizontal" @@ -94,8 +93,4 @@ void LLPathfindingCharacter::parseCharacterData(const LLSD &pCharacterData)  	llassert(pCharacterData.has(CHARACTER_RADIUS_FIELD));  	llassert(pCharacterData.get(CHARACTER_RADIUS_FIELD).isReal());  	mRadius = pCharacterData.get(CHARACTER_RADIUS_FIELD).asReal(); - -	//Create the rep inside the pathing library -	LLVector3 empty(0,0,0); -	LLPathingLib::getInstance()->createPhysicsCapsuleRep( mLength, mRadius, mIsHorizontal, empty, getUUID() );  } diff --git a/indra/newview/llpathfindingcharacterlist.cpp b/indra/newview/llpathfindingcharacterlist.cpp index ac1fb15be9..9b0ed14e35 100644 --- a/indra/newview/llpathfindingcharacterlist.cpp +++ b/indra/newview/llpathfindingcharacterlist.cpp @@ -33,7 +33,6 @@  #include "llpathfindingobject.h"  #include "llpathfindingobjectlist.h"  #include "llsd.h" -#include "llpathinglib.h"  //---------------------------------------------------------------------------  // LLPathfindingCharacterList @@ -47,11 +46,6 @@ LLPathfindingCharacterList::LLPathfindingCharacterList()  LLPathfindingCharacterList::LLPathfindingCharacterList(const LLSD& pCharacterListData)  	: LLPathfindingObjectList()  { -	if (LLPathingLib::getInstance() != NULL) -	{ -		LLPathingLib::getInstance()->cleanupPhysicsCapsuleRepResiduals( ); -	} -  	parseCharacterListData(pCharacterListData);  } | 
