Adjust join changes

master
Ansariel 2025-04-22 12:51:27 +02:00
parent af9254e3e3
commit 82673191e2
4 changed files with 18 additions and 11 deletions

View File

@ -7268,8 +7268,8 @@ const LLUUID& LLVOAvatar::getID() const
//-----------------------------------------------------------------------------
// RN: avatar joints are multi-rooted to include screen-based attachments
//<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 )
//LLJoint *LLVOAvatar::getJoint(const std::string &name)
LLJoint *LLVOAvatar::getJoint(const JointKey &name)
// </FS:ND>
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
@ -7373,10 +7373,17 @@ LLJoint *LLVOAvatar::getJoint( S32 joint_num )
void LLVOAvatar::initAllJoints()
{
getJointAliases();
for (auto& alias : mJointAliasMap)
// <FS:Ansariel> Lookup performance changes
//for (auto& alias : mJointAliasMap)
//{
// mJointMap[alias.first] = mRoot->findJoint(alias.second);
// mJointMap[JointKey::construct(alias.first).mKey] = mRoot->findJoint(alias.second);
//}
for (const auto& alias : mJointAliasMap)
{
mJointMap[alias.first] = mRoot->findJoint(alias.second);
mJointMap[JointKey::construct(alias.first).mKey] = mRoot->findJoint(alias.second);
}
// </FS:Ansariel>
// ignore mScreen and mRoot
}

View File

@ -205,9 +205,9 @@ public:
void dumpAnimationState();
//<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 ) ); }
//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>
LLJoint* getJoint(S32 num);
void initAllJoints();

View File

@ -1030,8 +1030,8 @@ void LLVOAvatarSelf::idleUpdate(LLAgent &agent, const F64 &time)
// virtual
//<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 )
//LLJoint *LLVOAvatarSelf::getJoint(const std::string &name)
LLJoint *LLVOAvatarSelf::getJoint(const JointKey& name)
// </FS:ND>
{
std::lock_guard lock(mJointMapMutex);

View File

@ -92,8 +92,8 @@ public:
/*virtual*/ void requestStopMotion(LLMotion* motion);
//<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 );
// /*virtual*/ LLJoint* getJoint(const std::string &name);
/*virtual*/ LLJoint* getJoint(const JointKey& name);
// </FS:ND>
/*virtual*/ void renderJoints();