Pull and merge from ssh://hg@bitbucket.org/stinson_linden/viewer-development-havokai.
commit
fc1dd55833
|
|
@ -1110,9 +1110,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>b9904a8c89f467c689ffa2986e545bbd</string>
|
||||
<string>88021d6f90389261ae1d96a999307111</string>
|
||||
<key>url</key>
|
||||
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/stinson_llpathinglibrary/rev/257807/arch/Darwin/installer/llphysicsextensions-0.1-darwin-20120522.tar.bz2</string>
|
||||
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/stinson_llpathinglibrary/rev/258508/arch/Darwin/installer/llphysicsextensions-0.1-darwin-20120531.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin</string>
|
||||
|
|
@ -1122,9 +1122,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>ab48cd6af728c6109e3db71edaed07e1</string>
|
||||
<string>3ca5e28190aeb0d8eb2b7fa898f99cd2</string>
|
||||
<key>url</key>
|
||||
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/stinson_llpathinglibrary/rev/257807/arch/Linux/installer/llphysicsextensions-0.1-linux-20120522.tar.bz2</string>
|
||||
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/stinson_llpathinglibrary/rev/258508/arch/Linux/installer/llphysicsextensions-0.1-linux-20120531.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux</string>
|
||||
|
|
@ -1134,9 +1134,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>d5d65bb5774b91562218e48d0b69d5c7</string>
|
||||
<string>17ecbfa939cffb5cf732d90fd7d3f440</string>
|
||||
<key>url</key>
|
||||
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/stinson_llpathinglibrary/rev/257807/arch/CYGWIN/installer/llphysicsextensions-0.1-windows-20120522.tar.bz2</string>
|
||||
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/stinson_llpathinglibrary/rev/258508/arch/CYGWIN/installer/llphysicsextensions-0.1-windows-20120531.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
@ -154,6 +158,7 @@ LLFloaterPathfindingObjects::LLFloaterPathfindingObjects(const LLSD &pSeed)
|
|||
mSelectAllButton(NULL),
|
||||
mSelectNoneButton(NULL),
|
||||
mShowBeaconCheckBox(NULL),
|
||||
mShowPhysicsCapsuleCheckBox(NULL),
|
||||
mTakeButton(NULL),
|
||||
mTakeCopyButton(NULL),
|
||||
mReturnButton(NULL),
|
||||
|
|
@ -168,8 +173,10 @@ LLFloaterPathfindingObjects::LLFloaterPathfindingObjects(const LLSD &pSeed)
|
|||
mObjectList(),
|
||||
mObjectsSelection(),
|
||||
mSelectionUpdateSlot(),
|
||||
mRegionBoundaryCrossingSlot()
|
||||
mRegionBoundaryCrossingSlot(),
|
||||
mSelfHandle()
|
||||
{
|
||||
mSelfHandle.bind(this);
|
||||
}
|
||||
|
||||
LLFloaterPathfindingObjects::~LLFloaterPathfindingObjects()
|
||||
|
|
@ -206,6 +213,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));
|
||||
|
|
@ -638,6 +649,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());
|
||||
|
|
@ -688,3 +700,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,28 +98,33 @@ protected:
|
|||
|
||||
EMessagingState getMessagingState() const;
|
||||
|
||||
public:
|
||||
LLUUID getUUIDFromSelection( LLVector3& pos );
|
||||
BOOL isPhysicsCapsuleEnabled( LLUUID& id, LLVector3& pos );
|
||||
void onShowPhysicsCapsuleClicked();
|
||||
|
||||
private:
|
||||
LLFloaterPathfindingObjects(const LLFloaterPathfindingObjects &pOther);
|
||||
|
||||
void setMessagingState(EMessagingState pMessagingState);
|
||||
void setMessagingState(EMessagingState pMessagingState);
|
||||
|
||||
void onRefreshObjectsClicked();
|
||||
void onSelectAllObjectsClicked();
|
||||
void onSelectNoneObjectsClicked();
|
||||
void onTakeClicked();
|
||||
void onTakeCopyClicked();
|
||||
void onReturnClicked();
|
||||
void onDeleteClicked();
|
||||
void onTeleportClicked();
|
||||
void onRefreshObjectsClicked();
|
||||
void onSelectAllObjectsClicked();
|
||||
void onSelectNoneObjectsClicked();
|
||||
void onTakeClicked();
|
||||
void onTakeCopyClicked();
|
||||
void onReturnClicked();
|
||||
void onDeleteClicked();
|
||||
void onTeleportClicked();
|
||||
|
||||
void onScrollListSelectionChanged();
|
||||
void onScrollListSelectionChanged();
|
||||
void onInWorldSelectionListChanged();
|
||||
void onRegionBoundaryCrossed();
|
||||
void onRegionBoundaryCrossed();
|
||||
void onGodLevelChange(U8 pGodLevel);
|
||||
|
||||
void updateMessagingStatus();
|
||||
void updateStateOnListActionControls();
|
||||
void updateStateOnEditFields();
|
||||
void updateMessagingStatus();
|
||||
void updateStateOnListActionControls();
|
||||
void updateStateOnEditFields();
|
||||
void updateOnScrollListChange();
|
||||
|
||||
LLPathfindingObjectPtr findObject(const LLScrollListItem *pListItem) const;
|
||||
|
|
@ -130,6 +135,7 @@ private:
|
|||
LLButton *mSelectAllButton;
|
||||
LLButton *mSelectNoneButton;
|
||||
LLCheckBoxCtrl *mShowBeaconCheckBox;
|
||||
LLCheckBoxCtrl *mShowPhysicsCapsuleCheckBox;
|
||||
LLButton *mTakeButton;
|
||||
LLButton *mTakeCopyButton;
|
||||
LLButton *mReturnButton;
|
||||
|
|
@ -151,6 +157,11 @@ private:
|
|||
boost::signals2::connection mSelectionUpdateSlot;
|
||||
boost::signals2::connection mRegionBoundaryCrossingSlot;
|
||||
LLAgent::god_level_change_slot_t mGodLevelChangeSlot;
|
||||
public:
|
||||
|
||||
LLRootHandle<LLFloaterPathfindingObjects> mSelfHandle;
|
||||
static LLHandle<LLFloaterPathfindingObjects> sInstanceHandle;
|
||||
static LLHandle<LLFloaterPathfindingObjects> getInstanceHandle();
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERPATHFINDINGOBJECTS_H
|
||||
|
|
|
|||
|
|
@ -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,11 @@ 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);
|
||||
const LLUUID id = getUUID();
|
||||
LLPathingLib::getInstance()->createPhysicsCapsuleRep( mLength, mRadius, mIsHorizontal, empty, id );
|
||||
|
||||
#endif // SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue