diff options
| author | prep <prep@lindenlab.com> | 2012-05-31 16:38:19 -0400 | 
|---|---|---|
| committer | prep <prep@lindenlab.com> | 2012-05-31 16:38:19 -0400 | 
| commit | ef75a2e07ec4f26c9126c04af1adfbd28d7eaa9b (patch) | |
| tree | 9fcf0f9cdf911ff6c86dc48c939131dd701ba49b /indra | |
| parent | d00192c9cbeaace7c1b7c09bfb86a5b5d8dff458 (diff) | |
WIP:Displaying physics capsule for a character - it is currently disabled.
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/llcommon/lluuid.cpp | 171 | ||||
| -rw-r--r-- | indra/llcommon/lluuid.h | 173 | ||||
| -rw-r--r-- | indra/newview/llfloaterpathfindingobjects.cpp | 91 | ||||
| -rw-r--r-- | indra/newview/llfloaterpathfindingobjects.h | 11 | ||||
| -rw-r--r-- | indra/newview/llpathfindingcharacter.cpp | 8 | ||||
| -rw-r--r-- | indra/newview/llpathfindingcharacterlist.cpp | 8 | ||||
| -rw-r--r-- | indra/newview/pipeline.cpp | 144 | ||||
| -rw-r--r-- | indra/newview/pipeline.h | 5 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml | 9 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml | 9 | 
10 files changed, 427 insertions, 202 deletions
| diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index 5d452ac4e4..db8c9c85ab 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -922,3 +922,174 @@ LLAssetID LLTransactionID::makeAssetID(const LLUUID& session) const  	}  	return result;  } + +// Construct +LLUUID::LLUUID() +{ +	setNull(); +} + + +// Faster than copying from memory + void LLUUID::setNull() +{ +	U32 *word = (U32 *)mData; +	word[0] = 0; +	word[1] = 0; +	word[2] = 0; +	word[3] = 0; +} + + +// Compare + bool LLUUID::operator==(const LLUUID& rhs) const +{ +	U32 *tmp = (U32 *)mData; +	U32 *rhstmp = (U32 *)rhs.mData; +	// Note: binary & to avoid branching +	return  +		(tmp[0] == rhstmp[0]) &   +		(tmp[1] == rhstmp[1]) & +		(tmp[2] == rhstmp[2]) & +		(tmp[3] == rhstmp[3]); +} + + + bool LLUUID::operator!=(const LLUUID& rhs) const +{ +	U32 *tmp = (U32 *)mData; +	U32 *rhstmp = (U32 *)rhs.mData; +	// Note: binary | to avoid branching +	return  +		(tmp[0] != rhstmp[0]) | +		(tmp[1] != rhstmp[1]) | +		(tmp[2] != rhstmp[2]) | +		(tmp[3] != rhstmp[3]); +} + +/* +// JC: This is dangerous.  It allows UUIDs to be cast automatically +// to integers, among other things.  Use isNull() or notNull(). + LLUUID::operator bool() const +{ +	U32 *word = (U32 *)mData; +	return (word[0] | word[1] | word[2] | word[3]) > 0; +} +*/ + + BOOL LLUUID::notNull() const +{ +	U32 *word = (U32 *)mData; +	return (word[0] | word[1] | word[2] | word[3]) > 0; +} + +// Faster than == LLUUID::null because doesn't require +// as much memory access. + BOOL LLUUID::isNull() const +{ +	U32 *word = (U32 *)mData; +	// If all bits are zero, return !0 == TRUE +	return !(word[0] | word[1] | word[2] | word[3]); +} + +// Copy constructor + LLUUID::LLUUID(const LLUUID& rhs) +{ +	U32 *tmp = (U32 *)mData; +	U32 *rhstmp = (U32 *)rhs.mData; +	tmp[0] = rhstmp[0]; +	tmp[1] = rhstmp[1]; +	tmp[2] = rhstmp[2]; +	tmp[3] = rhstmp[3]; +} + + LLUUID::~LLUUID() +{ +} + +// Assignment + LLUUID& LLUUID::operator=(const LLUUID& rhs) +{ +	// No need to check the case where this==&rhs.  The branch is slower than the write. +	U32 *tmp = (U32 *)mData; +	U32 *rhstmp = (U32 *)rhs.mData; +	tmp[0] = rhstmp[0]; +	tmp[1] = rhstmp[1]; +	tmp[2] = rhstmp[2]; +	tmp[3] = rhstmp[3]; +	 +	return *this; +} + + + LLUUID::LLUUID(const char *in_string) +{ +	if (!in_string || in_string[0] == 0) +	{ +		setNull(); +		return; +	} +  +	set(in_string); +} + + LLUUID::LLUUID(const std::string& in_string) +{ +	if (in_string.empty()) +	{ +		setNull(); +		return; +	} + +	set(in_string); +} + +// IW: DON'T "optimize" these w/ U32s or you'll scoogie the sort order +// IW: this will make me very sad + bool LLUUID::operator<(const LLUUID &rhs) const +{ +	U32 i; +	for( i = 0; i < (UUID_BYTES - 1); i++ ) +	{ +		if( mData[i] != rhs.mData[i] ) +		{ +			return (mData[i] < rhs.mData[i]); +		} +	} +	return (mData[UUID_BYTES - 1] < rhs.mData[UUID_BYTES - 1]); +} + + bool LLUUID::operator>(const LLUUID &rhs) const +{ +	U32 i; +	for( i = 0; i < (UUID_BYTES - 1); i++ ) +	{ +		if( mData[i] != rhs.mData[i] ) +		{ +			return (mData[i] > rhs.mData[i]); +		} +	} +	return (mData[UUID_BYTES - 1] > rhs.mData[UUID_BYTES - 1]); +} + + U16 LLUUID::getCRC16() const +{ +	// A UUID is 16 bytes, or 8 shorts. +	U16 *short_data = (U16*)mData; +	U16 out = 0; +	out += short_data[0]; +	out += short_data[1]; +	out += short_data[2]; +	out += short_data[3]; +	out += short_data[4]; +	out += short_data[5]; +	out += short_data[6]; +	out += short_data[7]; +	return out; +} + + U32 LLUUID::getCRC32() const +{ +	U32 *tmp = (U32*)mData; +	return tmp[0] + tmp[1] + tmp[2] + tmp[3]; +} diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h index 726be4a82d..0b9e7d0cd0 100644 --- a/indra/llcommon/lluuid.h +++ b/indra/llcommon/lluuid.h @@ -129,177 +129,6 @@ public:  typedef std::vector<LLUUID> uuid_vec_t; -// Construct -inline LLUUID::LLUUID() -{ -	setNull(); -} - - -// Faster than copying from memory -inline void LLUUID::setNull() -{ -	U32 *word = (U32 *)mData; -	word[0] = 0; -	word[1] = 0; -	word[2] = 0; -	word[3] = 0; -} - - -// Compare -inline bool LLUUID::operator==(const LLUUID& rhs) const -{ -	U32 *tmp = (U32 *)mData; -	U32 *rhstmp = (U32 *)rhs.mData; -	// Note: binary & to avoid branching -	return  -		(tmp[0] == rhstmp[0]) &   -		(tmp[1] == rhstmp[1]) & -		(tmp[2] == rhstmp[2]) & -		(tmp[3] == rhstmp[3]); -} - - -inline bool LLUUID::operator!=(const LLUUID& rhs) const -{ -	U32 *tmp = (U32 *)mData; -	U32 *rhstmp = (U32 *)rhs.mData; -	// Note: binary | to avoid branching -	return  -		(tmp[0] != rhstmp[0]) | -		(tmp[1] != rhstmp[1]) | -		(tmp[2] != rhstmp[2]) | -		(tmp[3] != rhstmp[3]); -} - -/* -// JC: This is dangerous.  It allows UUIDs to be cast automatically -// to integers, among other things.  Use isNull() or notNull(). -inline LLUUID::operator bool() const -{ -	U32 *word = (U32 *)mData; -	return (word[0] | word[1] | word[2] | word[3]) > 0; -} -*/ - -inline BOOL LLUUID::notNull() const -{ -	U32 *word = (U32 *)mData; -	return (word[0] | word[1] | word[2] | word[3]) > 0; -} - -// Faster than == LLUUID::null because doesn't require -// as much memory access. -inline BOOL LLUUID::isNull() const -{ -	U32 *word = (U32 *)mData; -	// If all bits are zero, return !0 == TRUE -	return !(word[0] | word[1] | word[2] | word[3]); -} - -// Copy constructor -inline LLUUID::LLUUID(const LLUUID& rhs) -{ -	U32 *tmp = (U32 *)mData; -	U32 *rhstmp = (U32 *)rhs.mData; -	tmp[0] = rhstmp[0]; -	tmp[1] = rhstmp[1]; -	tmp[2] = rhstmp[2]; -	tmp[3] = rhstmp[3]; -} - -inline LLUUID::~LLUUID() -{ -} - -// Assignment -inline LLUUID& LLUUID::operator=(const LLUUID& rhs) -{ -	// No need to check the case where this==&rhs.  The branch is slower than the write. -	U32 *tmp = (U32 *)mData; -	U32 *rhstmp = (U32 *)rhs.mData; -	tmp[0] = rhstmp[0]; -	tmp[1] = rhstmp[1]; -	tmp[2] = rhstmp[2]; -	tmp[3] = rhstmp[3]; -	 -	return *this; -} - - -inline LLUUID::LLUUID(const char *in_string) -{ -	if (!in_string || in_string[0] == 0) -	{ -		setNull(); -		return; -	} -  -	set(in_string); -} - -inline LLUUID::LLUUID(const std::string& in_string) -{ -	if (in_string.empty()) -	{ -		setNull(); -		return; -	} - -	set(in_string); -} - -// IW: DON'T "optimize" these w/ U32s or you'll scoogie the sort order -// IW: this will make me very sad -inline bool LLUUID::operator<(const LLUUID &rhs) const -{ -	U32 i; -	for( i = 0; i < (UUID_BYTES - 1); i++ ) -	{ -		if( mData[i] != rhs.mData[i] ) -		{ -			return (mData[i] < rhs.mData[i]); -		} -	} -	return (mData[UUID_BYTES - 1] < rhs.mData[UUID_BYTES - 1]); -} - -inline bool LLUUID::operator>(const LLUUID &rhs) const -{ -	U32 i; -	for( i = 0; i < (UUID_BYTES - 1); i++ ) -	{ -		if( mData[i] != rhs.mData[i] ) -		{ -			return (mData[i] > rhs.mData[i]); -		} -	} -	return (mData[UUID_BYTES - 1] > rhs.mData[UUID_BYTES - 1]); -} - -inline U16 LLUUID::getCRC16() const -{ -	// A UUID is 16 bytes, or 8 shorts. -	U16 *short_data = (U16*)mData; -	U16 out = 0; -	out += short_data[0]; -	out += short_data[1]; -	out += short_data[2]; -	out += short_data[3]; -	out += short_data[4]; -	out += short_data[5]; -	out += short_data[6]; -	out += short_data[7]; -	return out; -} - -inline U32 LLUUID::getCRC32() const -{ -	U32 *tmp = (U32*)mData; -	return tmp[0] + tmp[1] + tmp[2] + tmp[3]; -} -  // Helper structure for ordering lluuids in stl containers.  // eg: 	std::map<LLUUID, LLWidget*, lluuid_less> widget_map; @@ -329,3 +158,5 @@ public:  };  #endif + + diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index e8d80c09d8..572f2f707e 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -54,9 +54,13 @@  #include "llviewerobjectlist.h"  #include "llviewerregion.h"  #include "v4color.h" +#include "pipeline.h" +#include "llfloaterreg.h"  #define DEFAULT_BEACON_WIDTH 6 +LLHandle<LLFloaterPathfindingObjects> LLFloaterPathfindingObjects::sInstanceHandle; +  //---------------------------------------------------------------------------  // LLFloaterPathfindingObjects  //--------------------------------------------------------------------------- @@ -144,6 +148,7 @@ LLFloaterPathfindingObjects::LLFloaterPathfindingObjects(const LLSD &pSeed)  	mSelectAllButton(NULL),  	mSelectNoneButton(NULL),  	mShowBeaconCheckBox(NULL), +	mShowPhysicsCapsuleCheckBox(NULL),  	mTakeButton(NULL),  	mTakeCopyButton(NULL),  	mReturnButton(NULL), @@ -158,8 +163,10 @@ LLFloaterPathfindingObjects::LLFloaterPathfindingObjects(const LLSD &pSeed)  	mObjectList(),  	mObjectsSelection(),  	mSelectionUpdateSlot(), -	mRegionBoundaryCrossingSlot() +	mRegionBoundaryCrossingSlot(), +	mSelfHandle()  { +	mSelfHandle.bind(this);  }  LLFloaterPathfindingObjects::~LLFloaterPathfindingObjects() @@ -196,6 +203,10 @@ BOOL LLFloaterPathfindingObjects::postBuild()  	mShowBeaconCheckBox = findChild<LLCheckBoxCtrl>("show_beacon");  	llassert(mShowBeaconCheckBox != NULL); +	mShowPhysicsCapsuleCheckBox = findChild<LLCheckBoxCtrl>("show_physics_capsule"); +	llassert(mShowPhysicsCapsuleCheckBox != NULL); +	mShowPhysicsCapsuleCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onShowPhysicsCapsuleClicked, this)); +  	mTakeButton = findChild<LLButton>("take_objects");  	llassert(mTakeButton != NULL);  	mTakeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onTakeClicked, this)); @@ -657,6 +668,7 @@ void LLFloaterPathfindingObjects::updateStateOnEditFields()  	bool isEditEnabled = (numSelectedItems > 0);  	mShowBeaconCheckBox->setEnabled(isEditEnabled); +	//prep#mShowPhysicsCapsuleCheckBox->setEnabled( false );  	mTakeButton->setEnabled(isEditEnabled && visible_take_object());  	mTakeCopyButton->setEnabled(isEditEnabled && enable_object_take_copy());  	mReturnButton->setEnabled(isEditEnabled && enable_object_return()); @@ -675,3 +687,80 @@ LLPathfindingObjectPtr LLFloaterPathfindingObjects::findObject(const LLScrollLis  	return objectPtr;  } + +void LLFloaterPathfindingObjects::onShowPhysicsCapsuleClicked() +{ +	 if ( mShowPhysicsCapsuleCheckBox->get() ) +	 { +		//We want to hide the VO and display the the objects physics capsule		 +		LLVector3 pos; +		LLUUID id = getUUIDFromSelection( pos ); +		if ( id.notNull() ) +		{ +			gPipeline.hideObject( id ); +		}		 +	 } +	 else +	 { +		 //We want to restore the selected objects vo and disable the physics capsule rendering	 +		  LLVector3 pos; +		  LLUUID id = getUUIDFromSelection( pos ); +		  if ( id.notNull() ) +		  {	 +			gPipeline.restoreHiddenObject( id ); +		  }		 +	 } +} + +BOOL LLFloaterPathfindingObjects::isPhysicsCapsuleEnabled( LLUUID& id, LLVector3& pos ) +{ +	BOOL result = false; +	if ( mShowPhysicsCapsuleCheckBox->get() ) +	{	 +		 id = getUUIDFromSelection( pos ); +		 result = true; +	} +	else +	{ +		id.setNull(); +	} +	return result; +} + +LLUUID LLFloaterPathfindingObjects::getUUIDFromSelection( LLVector3& pos ) +{ 	 +	std::vector<LLScrollListItem*> selectedItems = mObjectsScrollList->getAllSelected(); +	if ( selectedItems.size() > 1 ) +	{ +		return LLUUID::null; +	} +	if (selectedItems.size() == 1) +	{ +		std::vector<LLScrollListItem*>::const_reference selectedItemRef = selectedItems.front(); +		const LLScrollListItem *selectedItem = selectedItemRef; +		llassert(mObjectList != NULL);	 +		LLViewerObject *viewerObject = gObjectList.findObject( selectedItem->getUUID() ); +		if ( viewerObject != NULL ) +		{ +			pos = viewerObject->getRenderPosition(); +		} +		//prep#llinfos<<"id : "<<selectedItem->getUUID()<<llendl; +		return selectedItem->getUUID(); +	} + +	return LLUUID::null; +} + +LLHandle<LLFloaterPathfindingObjects> LLFloaterPathfindingObjects::getInstanceHandle() +{ +	if ( sInstanceHandle.isDead() ) +	{ +		LLFloaterPathfindingObjects *floaterInstance = LLFloaterReg::getTypedInstance<LLFloaterPathfindingObjects>("pathfinding_characters"); +		if (floaterInstance != NULL) +		{ +			sInstanceHandle = floaterInstance->mSelfHandle; +		} +	} + +	return sInstanceHandle; +} diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h index 34eb129864..f9c099e1a2 100644 --- a/indra/newview/llfloaterpathfindingobjects.h +++ b/indra/newview/llfloaterpathfindingobjects.h @@ -98,6 +98,11 @@ protected:  	EMessagingState                    getMessagingState() const; +public: +	LLUUID getUUIDFromSelection( LLVector3& pos ); +	BOOL isPhysicsCapsuleEnabled( LLUUID& id, LLVector3& pos ); +	void onShowPhysicsCapsuleClicked(); +  private:  	LLFloaterPathfindingObjects(const LLFloaterPathfindingObjects &pOther); @@ -128,6 +133,7 @@ private:  	LLButton                           *mSelectAllButton;  	LLButton                           *mSelectNoneButton;  	LLCheckBoxCtrl                     *mShowBeaconCheckBox; +	LLCheckBoxCtrl                     *mShowPhysicsCapsuleCheckBox;  	LLButton                           *mTakeButton;  	LLButton                           *mTakeCopyButton;  	LLButton                           *mReturnButton; @@ -148,6 +154,11 @@ private:  	boost::signals2::connection        mSelectionUpdateSlot;  	boost::signals2::connection        mRegionBoundaryCrossingSlot; +public: +	 +	LLRootHandle<LLFloaterPathfindingObjects>     mSelfHandle; +	static LLHandle<LLFloaterPathfindingObjects>  sInstanceHandle; +	static LLHandle<LLFloaterPathfindingObjects> getInstanceHandle();  };  #endif // LL_LLFLOATERPATHFINDINGOBJECTS_H diff --git a/indra/newview/llpathfindingcharacter.cpp b/indra/newview/llpathfindingcharacter.cpp index 0696783bf7..011a736568 100644 --- a/indra/newview/llpathfindingcharacter.cpp +++ b/indra/newview/llpathfindingcharacter.cpp @@ -31,12 +31,16 @@  #include "llpathfindingobject.h"  #include "llsd.h" +#include "llpathinglib.h"  #define CHARACTER_CPU_TIME_FIELD   "cpu_time"  #define CHARACTER_HORIZONTAL_FIELD "horizontal"  #define CHARACTER_LENGTH_FIELD     "length"  #define CHARACTER_RADIUS_FIELD     "radius" +//prep# +#define SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE +  //---------------------------------------------------------------------------  // LLPathfindingCharacter  //--------------------------------------------------------------------------- @@ -119,5 +123,9 @@ 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 +	LLPathingLib::getInstance()->createPhysicsCapsuleRep( mLength, mRadius, mIsHorizontal, LLVector3(0,0,0), getUUID() ); +  #endif // SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE  } diff --git a/indra/newview/llpathfindingcharacterlist.cpp b/indra/newview/llpathfindingcharacterlist.cpp index 9b0ed14e35..15eaac771f 100644 --- a/indra/newview/llpathfindingcharacterlist.cpp +++ b/indra/newview/llpathfindingcharacterlist.cpp @@ -33,6 +33,7 @@  #include "llpathfindingobject.h"  #include "llpathfindingobjectlist.h"  #include "llsd.h" +#include "llpathinglib.h"  //---------------------------------------------------------------------------  // LLPathfindingCharacterList @@ -46,6 +47,13 @@ LLPathfindingCharacterList::LLPathfindingCharacterList()  LLPathfindingCharacterList::LLPathfindingCharacterList(const LLSD& pCharacterListData)  	: LLPathfindingObjectList()  { +	if ( LLPathingLib::getInstance() == NULL ) +	{ +		LLPathingLib::initSystem(); +	} +	 +	LLPathingLib::getInstance()->cleanupPhysicsCapsuleRepResiduals( ); +  	parseCharacterListData(pCharacterListData);  } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index cdcf468a4d..46d257bd87 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -106,6 +106,7 @@  #include "llnotifications.h"  #include "llpathinglib.h"  #include "llfloaterpathfindingconsole.h" +#include "llfloaterpathfindingobjects.h"  #include "llpathfindingpathtool.h"  #ifdef _DEBUG @@ -4359,6 +4360,49 @@ void LLPipeline::renderDebug()  		LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance();  		if ( llPathingLibInstance != NULL )   		{ +			//character floater renderables +			 +			LLHandle<LLFloaterPathfindingObjects> pathfindingCharacterHandle = LLFloaterPathfindingObjects::getInstanceHandle(); +			if ( !pathfindingCharacterHandle.isDead() ) +			{ +				LLFloaterPathfindingObjects *pathfindingCharacter = pathfindingCharacterHandle.get(); + +				if ( pathfindingCharacter->getVisible() || gAgentCamera.cameraMouselook() )			 +				{	 +					if (LLGLSLShader::sNoFixedFunction) +					{					 +						gPathfindingProgram.bind();			 +						gPathfindingProgram.uniform1f("tint", 1.f); +						gPathfindingProgram.uniform1f("ambiance", 1.f); +						gPathfindingProgram.uniform1f("alpha_scale", 1.f); +					} + +					LLUUID id; +					LLVector3 pos; +					if ( pathfindingCharacter->isPhysicsCapsuleEnabled( id, pos ) ) +					{						 +						if (LLGLSLShader::sNoFixedFunction) +						{					 +							//remove blending artifacts +							gGL.setColorMask(false, false); +							llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_START ); +							llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_END );						 +							gGL.setColorMask(true, false); +							LLGLEnable blend(GL_BLEND); +							gPathfindingProgram.uniform1f("alpha_scale", 0.90f); +							llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos ); +							gPathfindingProgram.bind(); +						} +						else +						{ +							llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos ); +						} +					} +				} +			} +			 + +			//pathing console renderables  			LLHandle<LLFloaterPathfindingConsole> pathfindingConsoleHandle = LLFloaterPathfindingConsole::getInstanceHandle();  			if (!pathfindingConsoleHandle.isDead())  			{ @@ -10145,21 +10189,7 @@ void LLPipeline::hidePermanentObjects( std::vector<U32>& restoreList )  			if ( pDrawable )  			{  				restoreList.push_back( i ); -				pDrawable->setState( LLDrawable::FORCE_INVISIBLE ); -				markRebuild( pDrawable, LLDrawable::REBUILD_ALL, TRUE ); -				//hide children -				LLViewerObject::const_child_list_t& child_list = pDrawable->getVObj()->getChildren(); -				for ( LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); -					  iter != child_list.end(); iter++ ) -				{ -					LLViewerObject* child = *iter; -					LLDrawable* drawable = child->mDrawable;					 -					if (drawable) -					{ -						drawable->setState( LLDrawable::FORCE_INVISIBLE ); -						markRebuild( drawable, LLDrawable::REBUILD_ALL, TRUE ); -					} -				} +				hideDrawable( pDrawable );			  			}  		}  	} @@ -10191,20 +10221,7 @@ void LLPipeline::restorePermanentObjects( const std::vector<U32>& restoreList )  			if ( pDrawable )  			{  				pDrawable->clearState( LLDrawable::FORCE_INVISIBLE ); -				markRebuild( pDrawable, LLDrawable::REBUILD_ALL, TRUE ); -				//restore children -				LLViewerObject::const_child_list_t& child_list = pDrawable->getVObj()->getChildren(); -				for ( LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); -					  iter != child_list.end(); iter++) -				{ -					LLViewerObject* child = *iter; -					LLDrawable* drawable = child->mDrawable;					 -					if (drawable) -					{ -						drawable->clearState( LLDrawable::FORCE_INVISIBLE ); -						markRebuild( drawable, LLDrawable::REBUILD_ALL, TRUE ); -					} -				} +				unhideDrawable( pDrawable );				  			}  		}  		++itCurrent; @@ -10227,3 +10244,72 @@ void LLPipeline::skipRenderingOfTerrain( BOOL flag )  		++iter;  	}  } + +void LLPipeline::hideObject( const LLUUID& id ) +{ +	LLViewerObject *pVO = gObjectList.findObject( id ); +	 +	if ( pVO ) +	{ +		LLDrawable *pDrawable = pVO->mDrawable; +		 +		if ( pDrawable ) +		{ +			hideDrawable( pDrawable );		 +		}		 +	} +} + +void LLPipeline::hideDrawable( LLDrawable *pDrawable ) +{ +	pDrawable->setState( LLDrawable::FORCE_INVISIBLE ); +	markRebuild( pDrawable, LLDrawable::REBUILD_ALL, TRUE ); +	//hide the children +	LLViewerObject::const_child_list_t& child_list = pDrawable->getVObj()->getChildren(); +	for ( LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); +		  iter != child_list.end(); iter++ ) +	{ +		LLViewerObject* child = *iter; +		LLDrawable* drawable = child->mDrawable;					 +		if ( drawable ) +		{ +			drawable->setState( LLDrawable::FORCE_INVISIBLE ); +			markRebuild( drawable, LLDrawable::REBUILD_ALL, TRUE ); +		} +	} +} +void LLPipeline::unhideDrawable( LLDrawable *pDrawable ) +{ +	pDrawable->clearState( LLDrawable::FORCE_INVISIBLE ); +	markRebuild( pDrawable, LLDrawable::REBUILD_ALL, TRUE ); +	//restore children +	LLViewerObject::const_child_list_t& child_list = pDrawable->getVObj()->getChildren(); +	for ( LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); +		  iter != child_list.end(); iter++) +	{ +		LLViewerObject* child = *iter; +		LLDrawable* drawable = child->mDrawable;					 +		if ( drawable ) +		{ +			drawable->clearState( LLDrawable::FORCE_INVISIBLE ); +			markRebuild( drawable, LLDrawable::REBUILD_ALL, TRUE ); +		} +	} +} +void LLPipeline::restoreHiddenObject( const LLUUID& id ) +{ +	LLViewerObject *pVO = gObjectList.findObject( id ); +	 +	if ( pVO ) +	{ +		LLDrawable *pDrawable = pVO->mDrawable; +		if ( pDrawable ) +		{ +			unhideDrawable( pDrawable );			 +		} +	} +} + + + + diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index f431576702..117b18be80 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -371,6 +371,8 @@ public:  	void hidePermanentObjects( std::vector<U32>& restoreList );  	void restorePermanentObjects( const std::vector<U32>& restoreList );  	void skipRenderingOfTerrain( BOOL flag ); +	void hideObject( const LLUUID& id ); +	void restoreHiddenObject( const LLUUID& id );  private:  	void unloadShaders(); @@ -379,7 +381,8 @@ private:  	BOOL updateDrawableGeom(LLDrawable* drawable, BOOL priority);  	void assertInitializedDoError();  	bool assertInitialized() { const bool is_init = isInit(); if (!is_init) assertInitializedDoError(); return is_init; }; -	 +	void hideDrawable( LLDrawable *pDrawable ); +	void unhideDrawable( LLDrawable *pDrawable );  public:  	enum {GPU_CLASS_MAX = 3 }; diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml index a81c4cb891..fac6ee05bb 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml @@ -147,6 +147,15 @@          top_pad="-16"          left_pad="0"          width="90" /> +    <check_box +     height="19" +     follows="left|bottom" +     label="Show physics capsule" +     layout="topleft" +     name="show_physics_capsule" +     top_pad="-19" +     left_pad="10" +     width="90" />      <button          follows="left|bottom"          height="22" diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml index 3ae5301cc2..063aa7bef0 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml @@ -300,6 +300,15 @@          left_pad="0"          top_pad="-16"          width="90" /> +    <check_box +     height="19" +     follows="left|bottom" +     label="Show physics capsule" +     layout="topleft" +     name="show_physics_capsule" +     top_pad="-19" +     left_pad="10" +     width="90" />      <button          follows="left|bottom"          height="21" | 
