From e91a192301db37f99a4f5a817f3b4c47b448417a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 26 Jan 2016 11:11:52 -0500 Subject: SL-315 WIP - added callstack info to joint debugging. Made joint debugging run-time configurable via debug setting DebugAvatarJoints --- indra/llcharacter/lljoint.cpp | 27 ++++++++++++++++++++++++++- indra/llcharacter/lljoint.h | 4 ++++ 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'indra/llcharacter') diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 8fcab454dc..a314692edc 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -32,6 +32,8 @@ #include "lljoint.h" #include "llmath.h" +#include "llcallstack.h" +#include S32 LLJoint::sNumUpdates = 0; S32 LLJoint::sNumTouches = 0; @@ -313,7 +315,11 @@ const LLVector3& LLJoint::getPosition() bool do_debug_joint(const std::string& name) { - return false; + if (std::find(LLJoint::s_debugJointNames.begin(), LLJoint::s_debugJointNames.end(),name) != LLJoint::s_debugJointNames.end()) + { + return true; + } + return false; } //-------------------------------------------------------------------- @@ -325,7 +331,9 @@ void LLJoint::setPosition( const LLVector3& pos ) { if (do_debug_joint(getName())) { + LLCallStack cs; LL_DEBUGS("Avatar") << " joint " << getName() << " set pos " << pos << LL_ENDL; + LL_DEBUGS("Avatar") << "STACK:\n" << "====================\n" << cs << "====================" << LL_ENDL; } } mXform.setPosition(pos); @@ -427,6 +435,23 @@ void LLJoint::updatePos(const std::string& av_info) setPosition(pos); } +// init static +LLJoint::debug_joint_name_t LLJoint::s_debugJointNames = debug_joint_name_t(); + +//-------------------------------------------------------------------- +// setDebugJointNames +//-------------------------------------------------------------------- +void LLJoint::setDebugJointNames(const debug_joint_name_t& names) +{ + s_debugJointNames = names; +} +void LLJoint::setDebugJointNames(const std::string& names_string) +{ + debug_joint_name_t names; + boost::split(names, names_string, boost::is_any_of(" :,")); + setDebugJointNames(names); +} + //-------------------------------------------------------------------- // getWorldPosition() //-------------------------------------------------------------------- diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 424f172318..ab21f73122 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -130,6 +130,10 @@ public: // debug statics static S32 sNumTouches; static S32 sNumUpdates; + typedef std::set debug_joint_name_t; + static debug_joint_name_t s_debugJointNames; + static void setDebugJointNames(const debug_joint_name_t& names); + static void setDebugJointNames(const std::string& names_string); LLPosOverrideMap m_attachmentOverrides; LLVector3 m_posBeforeOverrides; -- cgit v1.2.3