Merge with firestorm-lgpl.

master
Nicky 2016-09-17 19:35:49 +02:00
commit 44ab8b8f4b
22 changed files with 2679 additions and 2424 deletions

View File

@ -141,7 +141,7 @@ public:
// <FS:ND> This map gets queried a huge amount of time.
// typedef std::map<std::string, LLJoint*> joint_map_t;
typedef boost::unordered_map<std::string, LLJoint*> joint_map_t;
typedef boost::unordered_map< U32, LLJoint*> joint_map_t;
// </FS:ND>
joint_map_t mJointMap;

View File

@ -111,6 +111,14 @@ LLJoint *LLCharacter::getJoint( const std::string &name )
return joint;
}
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// Default fallback is string.
LLJoint *LLCharacter::getJoint( const JointKey &name )
{
return getJoint( name.mName );
}
// </FS:ND>
//-----------------------------------------------------------------------------
// registerMotion()
//-----------------------------------------------------------------------------

View File

@ -76,7 +76,13 @@ public:
// get the specified joint
// default implementation does recursive search,
// subclasses may optimize/cache results.
virtual LLJoint *getJoint( const std::string &name );
// virtual LLJoint *getJoint( const std::string &name );
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
virtual LLJoint *getJoint( const JointKey &name );
// </FS:ND>
LLJoint *getJoint( const std::string &name );
// get the position of the character
virtual LLVector3 getCharacterPosition() = 0;

View File

@ -35,6 +35,28 @@
#include "llcallstack.h"
#include <boost/algorithm/string.hpp>
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
#include <boost/unordered_map.hpp>
boost::unordered_map< std::string, U32 > mpStringToKeys;
JointKey JointKey::construct( std::string aName )
{
boost::unordered_map< std::string, U32 >::iterator itr = mpStringToKeys.find( aName );
if( mpStringToKeys.end() == itr )
{
U32 size = mpStringToKeys.size() + 1;
JointKey key{ aName, size };
mpStringToKeys[ aName ] = size;
return key;
}
return JointKey{ aName, itr->second };
}
// </FS:ND>
S32 LLJoint::sNumUpdates = 0;
S32 LLJoint::sNumTouches = 0;

View File

@ -39,6 +39,32 @@
#include "llquaternion.h"
#include "xform.h"
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
struct JointKey
{
std::string mName;
U32 mKey;
static JointKey construct( std::string aName );
};
inline bool operator==(JointKey const &aLHS, JointKey const &aRHS)
{
return aLHS.mName == aRHS.mName;
}
inline bool operator!=(JointKey const &aLHS, JointKey const &aRHS)
{
return ! (aLHS == aRHS);
}
inline std::ostream& operator<<(std::ostream &aLHS, JointKey const &aRHS)
{
return aLHS << aRHS.mName << " (" << aRHS.mKey << ")";
}
// </FS:ND>
const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15;
// Need to set this to count of animate-able joints,
// currently = #bones + #collision_volumes + #attachments + 2,

View File

@ -1370,7 +1370,10 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
{
name = mJointMap[name];
}
model->mSkinInfo.mJointNames.push_back(name);
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// model->mSkinInfo.mJointNames.push_back( name );
model->mSkinInfo.mJointNames.push_back( JointKey::construct( name ) );
// </FS:ND>
}
}
else
@ -1387,7 +1390,10 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
{
name = mJointMap[name];
}
model->mSkinInfo.mJointNames.push_back(name);
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// model->mSkinInfo.mJointNames.push_back( name );
model->mSkinInfo.mJointNames.push_back( JointKey::construct( name ) );
// </FS:ND>
}
}
}
@ -1427,7 +1433,11 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
//a skinned asset attached to a node in a file that contains an entire skeleton,
//but does not use the skeleton).
buildJointToNodeMappingFromScene( root );
critiqueRigForUploadApplicability( model->mSkinInfo.mJointNames );
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// critiqueRigForUploadApplicability( model->mSkinInfo.mJointNames );
critiqueRigForUploadApplicability( toStringVector( model->mSkinInfo.mJointNames ) );
// </FS:ND>
if ( !missingSkeletonOrScene )
{
@ -1472,7 +1482,13 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
//in the same order as they were stored in the joint buffer. The joints associated
//with the skeleton are not stored in the same order as they are in the exported joint buffer.
//This remaps the skeletal joints to be in the same order as the joints stored in the model.
std::vector<std::string> :: const_iterator jointIt = model->mSkinInfo.mJointNames.begin();
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// std::vector<std::string> ::const_iterator jointIt = model->mSkinInfo.mJointNames.begin();
std::vector< std::string > jointNames = toStringVector( model->mSkinInfo.mJointNames );
std::vector<std::string> ::const_iterator jointIt = jointNames.begin();
// </FS:ND>
const int jointCnt = model->mSkinInfo.mJointNames.size();
for ( int i=0; i<jointCnt; ++i, ++jointIt )
{

View File

@ -1406,7 +1406,10 @@ void LLMeshSkinInfo::fromLLSD(LLSD& skin)
{
for (U32 i = 0; i < skin["joint_names"].size(); ++i)
{
mJointNames.push_back(skin["joint_names"][i]);
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// mJointNames.push_back( skin[ "joint_names" ][ i ] );
mJointNames.push_back( JointKey::construct( skin[ "joint_names" ][ i ] ) );
// </FS>ND>
}
}
@ -1467,7 +1470,10 @@ LLSD LLMeshSkinInfo::asLLSD(bool include_joints) const
for (U32 i = 0; i < mJointNames.size(); ++i)
{
ret["joint_names"][i] = mJointNames[i];
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// ret[ "joint_names" ][ i ] = mJointNames[ i ];
ret[ "joint_names" ][ i ] = mJointNames[ i ].mName;
// </FS:ND>
for (U32 j = 0; j < 4; j++)
{

View File

@ -33,6 +33,8 @@
#include "m4math.h"
#include <queue>
#include "lljoint.h"
class daeElement;
class domMesh;
@ -43,7 +45,11 @@ class LLMeshSkinInfo
{
public:
LLUUID mMeshID;
std::vector<std::string> mJointNames;
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// std::vector<std::string> mJointNames;
std::vector< JointKey > mJointNames;
// </FS:ND>
std::vector<LLMatrix4> mInvBindMatrix;
std::vector<LLMatrix4> mAlternateBindMatrix;
std::vector<U32> mJointRemap;

View File

@ -281,7 +281,10 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
if (!loaded_model->mSkinInfo.mJointNames.empty())
{
//check to see if rig is valid
critiqueRigForUploadApplicability( loaded_model->mSkinInfo.mJointNames );
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// critiqueRigForUploadApplicability( loaded_model->mSkinInfo.mJointNames );
critiqueRigForUploadApplicability( toStringVector( loaded_model->mSkinInfo.mJointNames ) );
// </FS:ND>
}
else if (mCacheOnlyHitIfRigged)
{

View File

@ -185,6 +185,17 @@ public:
}
protected:
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
std::vector< std::string > toStringVector( std::vector< JointKey > const &aIn ) const
{
std::vector< std::string > out;
for( std::vector< JointKey >::const_iterator itr = aIn.begin(); itr != aIn.end(); ++itr )
out.push_back( itr->mName );
return out;
}
// </FS:ND>
LLModelLoader::load_callback_t mLoadCallback;
LLModelLoader::joint_lookup_func_t mJointLookupFunc;

View File

@ -114,6 +114,12 @@ LLFontFreetype::LLFontFreetype()
mStyle(0),
mPointSize(0)
{
// <FS:ND> Set up kerning cache, size is 256x256, the initial cache lines are all null
mKerningCache = new F32*[ 256 ];
for( int i = 0; i < 256; ++i )
mKerningCache[i] = NULL;
// </FS:ND>
}
@ -130,6 +136,13 @@ LLFontFreetype::~LLFontFreetype()
delete mFontBitmapCachep;
// mFallbackFonts cleaned up by LLPointer destructor
// <FS:ND> Delete the kerning cache
for( int i = 0; i < 256; ++i )
delete[] mKerningCache[i];
delete[] mKerningCache;
// </FS:ND>
}
BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback)
@ -307,10 +320,32 @@ F32 LLFontFreetype::getXKerning(llwchar char_left, llwchar char_right) const
LLFontGlyphInfo* right_glyph_info = getGlyphInfo(char_right);
U32 right_glyph = right_glyph_info ? right_glyph_info->mGlyphIndex : 0;
// <FS:ND> Use cached kerning if possible, only do so for glyphs < 256 for now
if( right_glyph < 256 && left_glyph < 256 )
{
if( mKerningCache[ left_glyph ] && mKerningCache[ left_glyph ][ right_glyph ] < FLT_MAX )
return mKerningCache[ left_glyph ][ right_glyph ];
}
// </FS:ND>
FT_Vector delta;
llverify(!FT_Get_Kerning(mFTFace, left_glyph, right_glyph, ft_kerning_unfitted, &delta));
// <FS:ND> Cache kerning if possible, only do so for glyphs < 256 for now
if( right_glyph < 256 && left_glyph < 256 )
{
if( !mKerningCache[ left_glyph ] )
{
mKerningCache[ left_glyph ] = new F32[ 256 ];
for( int i = 0; i < 256; ++i )
mKerningCache[ left_glyph ][ i ] = FLT_MAX;
}
mKerningCache[ left_glyph ][ right_glyph ] = delta.x*(1.f / 64.f);
}
// </FS:ND>
return delta.x*(1.f/64.f);
}
@ -322,10 +357,31 @@ F32 LLFontFreetype::getXKerning(const LLFontGlyphInfo* left_glyph_info, const LL
U32 left_glyph = left_glyph_info ? left_glyph_info->mGlyphIndex : 0;
U32 right_glyph = right_glyph_info ? right_glyph_info->mGlyphIndex : 0;
// <FS:ND> Use cached kerning if possible, only do so for glyphs < 256 for now
if( right_glyph < 256 && left_glyph < 256 )
{
if( mKerningCache[ left_glyph ] && mKerningCache[ left_glyph ][ right_glyph ] < FLT_MAX )
return mKerningCache[ left_glyph ][ right_glyph ];
}
// </FS:ND>
FT_Vector delta;
llverify(!FT_Get_Kerning(mFTFace, left_glyph, right_glyph, ft_kerning_unfitted, &delta));
// <FS:ND> Cache kerning if possible, only do so for glyphs < 256 for now
if( right_glyph < 256 && left_glyph < 256 )
{
if( !mKerningCache[ left_glyph ] )
{
mKerningCache[ left_glyph ] = new F32[ 256 ];
for( int i = 0; i < 256; ++i )
mKerningCache[ left_glyph ][ i ] = FLT_MAX;
}
mKerningCache[ left_glyph ][ right_glyph ] = delta.x*(1.f / 64.f);
}
// </FS:ND>
return delta.x*(1.f/64.f);
}

View File

@ -189,6 +189,12 @@ private:
mutable S32 mRenderGlyphCount;
mutable S32 mAddGlyphCount;
// <FS:ND> Save X-kerning data, so far only for all glyphs with index small than 256 (to not waste too much memory)
// right now it is 256 slots with 256 glyphs each, maybe consider splitting it into smaller slices to use less memory if we
// we want to cache 0xFFFF glyphs
F32 **mKerningCache;
// </FS:ND<
};
#endif // LL_FONTFREETYPE_H

File diff suppressed because it is too large Load Diff

View File

@ -3550,7 +3550,10 @@ LLJoint* LLModelPreview::lookupJointByName(const std::string& str, void* opaque)
LLModelPreview* pPreview = static_cast< LLModelPreview* >(opaque);
if (pPreview)
{
return pPreview->getPreviewAvatar()->getJoint(str);
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// return pPreview->getPreviewAvatar()->getJoint( str );
return pPreview->getPreviewAvatar()->getJoint( JointKey::construct( str ) );
// <FS:ND>
}
return NULL;
}

View File

@ -146,8 +146,11 @@ void LLMorphView::updateCamera()
{
if (!mCameraTargetJoint)
{
setCameraTargetJoint(gAgentAvatarp->getJoint("mHead"));
}
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// setCameraTargetJoint( gAgentAvatarp->getJoint( "mHead" ) );
setCameraTargetJoint( gAgentAvatarp->getJoint( JointKey::construct( "mHead" ) ) );
// </FS:ND>
}
if (!isAgentAvatarValid()) return;
LLJoint* root_joint = gAgentAvatarp->getRootJoint();

View File

@ -1262,11 +1262,15 @@ void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BO
value_map_t sorted_params;
getSortedParams(sorted_params, edit_group);
LLJoint* jointp = gAgentAvatarp->getJoint( subpart_entry->mTargetJoint );
if (!jointp)
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// LLJoint* jointp = gAgentAvatarp->getJoint( subpart_entry->mTargetJoint );
LLJoint* jointp = gAgentAvatarp->getJoint( JointKey::construct( subpart_entry->mTargetJoint ) );
if( !jointp )
{
jointp = gAgentAvatarp->getJoint("mHead");
}
// jointp = gAgentAvatarp->getJoint( "mHead" );
jointp = gAgentAvatarp->getJoint( JointKey::construct( "mHead" ) );
}
// </FS:ND>
buildParamList(panel_list, sorted_params, tab, jointp);
@ -1334,7 +1338,11 @@ void LLPanelEditWearable::changeCamera(U8 subpart)
}
// Update the camera
gMorphView->setCameraTargetJoint( gAgentAvatarp->getJoint( subpart_entry->mTargetJoint ) );
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
//gMorphView->setCameraTargetJoint( gAgentAvatarp->getJoint( subpart_entry->mTargetJoint ) );
gMorphView->setCameraTargetJoint( gAgentAvatarp->getJoint( JointKey::construct( subpart_entry->mTargetJoint ) ) );
// </FS>ND>
gMorphView->setCameraTargetOffset( subpart_entry->mTargetOffset );
gMorphView->setCameraOffset( subpart_entry->mCameraOffset );
if (gSavedSettings.getBOOL("AppearanceCameraMovement"))

View File

@ -36,10 +36,16 @@ bool LLSkinningUtil::sIncludeEnhancedSkeleton = true;
namespace {
bool get_name_index(const std::string& name, std::vector<std::string>& names, U32& result)
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
//bool get_name_index( const std::string& name, std::vector<std::string>& names, U32& result )
bool get_name_index( const JointKey& name, std::vector<JointKey>& names, U32& result )
//</FS:ND>
{
std::vector<std::string>::const_iterator find_it =
std::find(names.begin(), names.end(), name);
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// std::vector<std::string>::const_iterator find_it =
std::vector<JointKey>::const_iterator find_it =
// </FS:ND>
std::find( names.begin(), names.end(), name );
if (find_it != names.end())
{
result = find_it - names.begin();
@ -54,15 +60,21 @@ bool get_name_index(const std::string& name, std::vector<std::string>& names, U3
// Find a name table index that is also a valid joint on the
// avatar. Order of preference is: requested name, mPelvis, first
// valid match in names table.
U32 get_valid_joint_index(const std::string& name, LLVOAvatar *avatar, std::vector<std::string>& joint_names)
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
//U32 get_valid_joint_index( const std::string& name, LLVOAvatar *avatar, std::vector<std::string>& joint_names )
U32 get_valid_joint_index( const JointKey& name, LLVOAvatar *avatar, std::vector<JointKey>& joint_names )
//</FS:ND>
{
U32 result;
if (avatar->getJoint(name) && get_name_index(name,joint_names,result))
{
return result;
}
if (get_name_index("mPelvis",joint_names,result))
{
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// if( get_name_index( "mPelvis", joint_names, result ) )
if( get_name_index( JointKey::construct( "mPelvis" ), joint_names, result ) )
// </FS:ND>
{
return result;
}
for (U32 j=0; j<joint_names.size(); j++)
@ -78,7 +90,10 @@ U32 get_valid_joint_index(const std::string& name, LLVOAvatar *avatar, std::vect
}
// Which joint will stand in for this joint?
U32 get_proxy_joint_index(U32 joint_index, LLVOAvatar *avatar, std::vector<std::string>& joint_names)
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
//U32 get_proxy_joint_index( U32 joint_index, LLVOAvatar *avatar, std::vector<std::string>& joint_names )
U32 get_proxy_joint_index( U32 joint_index, LLVOAvatar *avatar, std::vector<JointKey>& joint_names )
//</FS:ND>
{
bool include_enhanced = LLSkinningUtil::sIncludeEnhancedSkeleton;
U32 j_proxy = get_valid_joint_index(joint_names[joint_index], avatar, joint_names);
@ -95,8 +110,11 @@ U32 get_proxy_joint_index(U32 joint_index, LLVOAvatar *avatar, std::vector<std::
LLJoint *parent = joint->getParent();
if (!parent)
break;
if (!get_name_index(parent->getName(), joint_names, j_proxy))
{
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// if( !get_name_index( parent->getName(), joint_names, j_proxy ) )
if( !get_name_index( JointKey::construct( parent->getName() ), joint_names, j_proxy ) )
// </FS:ND>
{
break;
}
joint = parent;
@ -167,8 +185,11 @@ void LLSkinningUtil::remapSkinInfoJoints(LLVOAvatar *avatar, LLMeshSkinInfo* ski
// needed for handling of any legacy bad data.
if (!avatar->getJoint(skin->mJointNames[j]))
{
skin->mJointNames[j] = "mPelvis";
}
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// skin->mJointNames[ j ] = "mPelvis";
skin->mJointNames[ j ] = JointKey::construct( "mPelvis" );
//</FS:ND>
}
}
std::vector<U32> j_proxy(skin->mJointNames.size());
for (U32 j = 0; j < skin->mJointNames.size(); ++j)
@ -202,8 +223,11 @@ void LLSkinningUtil::remapSkinInfoJoints(LLVOAvatar *avatar, LLMeshSkinInfo* ski
// Apply the remap to mJointNames, mInvBindMatrix, and mAlternateBindMatrix
std::vector<std::string> new_joint_names;
std::vector<LLMatrix4> new_inv_bind_matrix;
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// std::vector<std::string> new_joint_names;
std::vector< JointKey > new_joint_names;
// </FS:ND>
std::vector<LLMatrix4> new_inv_bind_matrix;
std::vector<LLMatrix4> new_alternate_bind_matrix;
for (U32 j = 0; j < skin->mJointNames.size(); ++j)

View File

@ -5957,21 +5957,40 @@ const LLUUID& LLVOAvatar::getID() const
// getJoint()
//-----------------------------------------------------------------------------
// RN: avatar joints are multi-rooted to include screen-based attachments
LLJoint *LLVOAvatar::getJoint( const std::string &name )
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
//LLJoint *LLVOAvatar::getJoint( const std::string &name )
LLJoint *LLVOAvatar::getJoint( const JointKey &name )
// </FS:ND>
{
joint_map_t::iterator iter = mJointMap.find(name);
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
//joint_map_t::iterator iter = mJointMap.find( name );
//LLJoint* jointp = NULL;
//if( iter == mJointMap.end() || iter->second == NULL )
//{ //search for joint and cache found joint in lookup table
// jointp = mRoot->findJoint( name );
// mJointMap[ name ] = jointp;
//}
//else
//{ //return cached pointer
// jointp = iter->second;
//}
joint_map_t::iterator iter = mJointMap.find( name.mKey );
LLJoint* jointp = NULL;
if (iter == mJointMap.end() || iter->second == NULL)
if( iter == mJointMap.end() || iter->second == NULL )
{ //search for joint and cache found joint in lookup table
jointp = mRoot->findJoint(name);
mJointMap[name] = jointp;
jointp = mRoot->findJoint( name.mName );
mJointMap[ name.mKey ] = jointp;
}
else
{ //return cached pointer
jointp = iter->second;
}
// </FS:ND>
return jointp;
}
@ -6052,8 +6071,11 @@ bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name, const LLViewerOb
if ( vobj && vobj->isAttachment() && vobj->isMesh() && pSkinData )
{
if (std::find(pSkinData->mJointNames.begin(), pSkinData->mJointNames.end(), joint_name) !=
pSkinData->mJointNames.end())
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
//if( std::find( pSkinData->mJointNames.begin(), pSkinData->mJointNames.end(), joint_name ) !=
// </FS:ND>
if( std::find( pSkinData->mJointNames.begin(), pSkinData->mJointNames.end(), JointKey::construct( joint_name ) ) !=
pSkinData->mJointNames.end() )
{
return true;
}
@ -6169,7 +6191,11 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo)
{
for ( int i=0; i<jointCnt; ++i )
{
std::string lookingForJoint = pSkinData->mJointNames[i].c_str();
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// std::string lookingForJoint = pSkinData->mJointNames[ i ].c_str();
JointKey lookingForJoint = pSkinData->mJointNames[ i ];
// </FS:ND>
LLJoint* pJoint = getJoint( lookingForJoint );
if ( pJoint && pJoint->getId() != currentId )
{
@ -6182,7 +6208,10 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo)
if (override_changed)
{
//If joint is a pelvis then handle old/new pelvis to foot values
if ( lookingForJoint == "mPelvis" )
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// if( lookingForJoint == "mPelvis" )
if( lookingForJoint.mName == "mPelvis" )
// </FS:ND>
{
pelvisGotSet = true;
}
@ -6343,8 +6372,11 @@ void LLVOAvatar::resetJointPositionsOnDetach(const LLUUID& mesh_id)
avatar_joint_list_t::iterator iter = mSkeleton.begin();
avatar_joint_list_t::iterator end = mSkeleton.end();
LLJoint* pJointPelvis = getJoint("mPelvis");
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// LLJoint* pJointPelvis = getJoint( "mPelvis" );
LLJoint* pJointPelvis = getJoint( JointKey::construct( "mPelvis" ) );
// </FS:ND>
for (; iter != end; ++iter)
{
LLJoint* pJoint = (*iter);
@ -6533,7 +6565,12 @@ void LLVOAvatar::initAttachmentPoints(bool ignore_hud_joints)
}
attachment->setName(info->mName);
LLJoint *parent_joint = getJoint(info->mJointName);
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// LLJoint *parent_joint = getJoint(info->mJointName);
LLJoint *parent_joint = getJoint( JointKey::construct( info->mJointName ) );
// </FS:ND>
if (!parent_joint)
{
// If the intended parent for attachment point is unavailable, avatar_lad.xml is corrupt.

View File

@ -199,8 +199,12 @@ public:
void startDefaultMotions();
void dumpAnimationState();
virtual LLJoint* getJoint(const std::string &name);
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
//virtual LLJoint* getJoint( const std::string &name );
virtual LLJoint* getJoint( const JointKey &name );
LLJoint* getJoint( const std::string &name ) { return getJoint( JointKey::construct( name ) ); }
// </FS:ND>
void addAttachmentPosOverridesForObject(LLViewerObject *vo);
void resetJointPositionsOnDetach(const LLUUID& mesh_id);
void resetJointPositionsOnDetach(LLViewerObject *vo);

View File

@ -926,11 +926,17 @@ void LLVOAvatarSelf::idleUpdate(LLAgent &agent, const F64 &time)
}
// virtual
LLJoint *LLVOAvatarSelf::getJoint(const std::string &name)
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
//LLJoint *LLVOAvatarSelf::getJoint( const std::string &name )
LLJoint *LLVOAvatarSelf::getJoint( const JointKey &name )
// </FS:ND>
{
if (mScreenp)
{
LLJoint* jointp = mScreenp->findJoint(name);
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// LLJoint* jointp = mScreenp->findJoint( name );
LLJoint* jointp = mScreenp->findJoint( name.mName );
// </FS:ND>
if (jointp) return jointp;
}
return LLVOAvatar::getJoint(name);

View File

@ -90,8 +90,12 @@ public:
/*virtual*/ bool hasMotionFromSource(const LLUUID& source_id);
/*virtual*/ void stopMotionFromSource(const LLUUID& source_id);
/*virtual*/ void requestStopMotion(LLMotion* motion);
/*virtual*/ LLJoint* getJoint(const std::string &name);
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
// /*virtual*/ LLJoint* getJoint( const std::string &name );
/*virtual*/ LLJoint* getJoint( const JointKey &name );
// </FS:ND>
// <FS:Ansariel> [Legacy Bake]
///*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight);
///*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight);

View File

@ -969,7 +969,7 @@ bool LLVivoxVoiceClient::breakVoiceConnection(bool corowait)
else
{ // If we are not doing a corowait then we must sleep until the connector has responded
// otherwise we may very well close the socket too early.
#if LL_WINDOWS
#if LL_WINDOWSx
int count = 0;
while (!mShutdownComplete && 10 > count++)
{ // Rider: This comes out to a max wait time of 10 seconds.