diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-11-17 16:41:55 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-11-17 16:41:55 -0500 |
commit | 94d7d6a623d755424c2bd8c2526bff0d46101915 (patch) | |
tree | 32541d7d757c6647a939241412ef458a523d2d33 /indra | |
parent | 3bfc2564a685f87dda38d423ca3c32f96efeedf1 (diff) |
SL-271 WIP, SL-201 WIP - add support for end point to joints, use for debug rendering display to show bones.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llappearance/llavatarappearance.cpp | 12 | ||||
-rwxr-xr-x | indra/llcharacter/lljoint.cpp | 1 | ||||
-rwxr-xr-x | indra/llcharacter/lljoint.h | 8 | ||||
-rwxr-xr-x | indra/newview/llspatialpartition.cpp | 11 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 48 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_notifications_tabbed.xml | 6 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/menu_viewer.xml | 10 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_notification_list_item.xml | 13 |
9 files changed, 99 insertions, 11 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 81834204f5..142120cb6c 100755 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -92,6 +92,7 @@ private: std::string mAliases; BOOL mIsJoint; LLVector3 mPos; + LLVector3 mEnd; LLVector3 mRot; LLVector3 mScale; LLVector3 mPivot; @@ -610,6 +611,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent info->mRot.mV[VZ], LLQuaternion::XYZ)); joint->setScale(info->mScale); joint->setSupport(info->mSupport); + joint->setEnd(info->mEnd); if (info->mIsJoint) { @@ -1572,10 +1574,18 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node) return FALSE; } + // BENTO rename leaf->end + static LLStdStringHandle end_string = LLXmlTree::addAttributeString("leaf"); + if (!node->getFastAttributeVector3(end_string, mEnd)) + { + LL_WARNS() << "Bone without end " << mName << LL_ENDL; + mEnd = LLVector3(1.0f, 0.0f, 0.0f); + } + static LLStdStringHandle support_string = LLXmlTree::addAttributeString("support"); if (!node->getFastAttributeString(support_string,mSupport)) { - LL_WARNS() << "Bone without support" << LL_ENDL; + LL_WARNS() << "Bone without support " << mName << LL_ENDL; mSupport = "base"; } diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 2c6278fe45..8fcab454dc 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -109,6 +109,7 @@ void LLJoint::init() mDirtyFlags = MATRIX_DIRTY | ROTATION_DIRTY | POSITION_DIRTY; mUpdateXform = TRUE; mSupport = SUPPORT_BASE; + mEnd = LLVector3(0.0f, 0.0f, 0.0f); } LLJoint::LLJoint() : diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 8d380cdc82..f11cbacaaa 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -117,6 +117,10 @@ public: // describes the skin binding pose LLVector3 mSkinOffset; + // Endpoint of the bone, if applicable. This is only relevant for + // external programs like Blender, and for diagnostic display. + LLVector3 mEnd; + S32 mJointNum; // child joints @@ -156,6 +160,10 @@ public: SupportCategory getSupport() const { return mSupport; } void setSupport( const SupportCategory& support) { mSupport = support; } void setSupport( const std::string& support_string); + + // get/set end point + void setEnd( const LLVector3& end) { mEnd = end; } + const LLVector3& getEnd() const { return mEnd; } // getParent LLJoint *getParent() { return mParent; } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 5e342099d7..28e038b828 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -3216,6 +3216,11 @@ void renderAvatarCollisionVolumes(LLVOAvatar* avatar) avatar->renderCollisionVolumes(); } +void renderAvatarBones(LLVOAvatar* avatar) +{ + avatar->renderBones(); +} + void renderAgentTarget(LLVOAvatar* avatar) { // render these for self only (why, i don't know) @@ -3374,6 +3379,11 @@ public: renderAvatarCollisionVolumes(avatar); } + if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_JOINTS)) + { + renderAvatarBones(avatar); + } + if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AGENT_TARGET)) { renderAgentTarget(avatar); @@ -3664,6 +3674,7 @@ void LLSpatialPartition::renderDebug() LLPipeline::RENDER_DEBUG_TEXTURE_ANIM | LLPipeline::RENDER_DEBUG_RAYCAST | LLPipeline::RENDER_DEBUG_AVATAR_VOLUME | + LLPipeline::RENDER_DEBUG_AVATAR_JOINTS | LLPipeline::RENDER_DEBUG_AGENT_TARGET | //LLPipeline::RENDER_DEBUG_BUILD_QUEUE | LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA | diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3b482e1bc0..5fed8ce938 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1360,6 +1360,54 @@ void LLVOAvatar::renderCollisionVolumes() addDebugText(ostr.str()); } +void LLVOAvatar::renderBones() +{ + std::ostringstream ostr; + std::ostringstream nullstr; + + avatar_joint_list_t::iterator iter = mSkeleton.begin(); + avatar_joint_list_t::iterator end = mSkeleton.end(); + + for (; iter != end; ++iter) + { + LLJoint* jointp = *iter; + if (!jointp) + { + continue; + } + + ostr << jointp->getName() << ", "; + + jointp->updateWorldMatrix(); + + gGL.pushMatrix(); + gGL.multMatrix( &jointp->getXform()->getWorldMatrix().mMatrix[0][0] ); + + gGL.diffuseColor3f( 1.f, 0.f, 1.f ); + + gGL.begin(LLRender::LINES); + + LLVector3 v[] = + { + LLVector3(0,0,0), + LLVector3(0,0,0), + }; + v[1] = jointp->getEnd(); + + gGL.vertex3fv(v[0].mV); + gGL.vertex3fv(v[1].mV); + + gGL.end(); + + gGL.popMatrix(); + } + + mDebugText.clear(); + addDebugText(ostr.str()); + addDebugText(nullstr.str()); +} + + void LLVOAvatar::renderJoints() { std::ostringstream ostr; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 002359ebac..f6879c4b78 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -399,6 +399,7 @@ public: F32 getLastSkinTime() { return mLastSkinTime; } U32 renderTransparent(BOOL first_pass); void renderCollisionVolumes(); + void renderBones(); void renderJoints(); static void deleteCachedImages(bool clearAll=true); static void destroyGL(); diff --git a/indra/newview/skins/default/xui/en/floater_notifications_tabbed.xml b/indra/newview/skins/default/xui/en/floater_notifications_tabbed.xml index afc609de52..c17d2a1f37 100644 --- a/indra/newview/skins/default/xui/en/floater_notifications_tabbed.xml +++ b/indra/newview/skins/default/xui/en/floater_notifications_tabbed.xml @@ -136,15 +136,15 @@ </tab_container> <layout_stack width="336" height="26" enabled="true" orientation="horizontal" follows="left|right" name="ButtonsStack"> - <layout_panel width="336" height="30" enabled="true" orientation="horizontal" name="CondenseAllButtonPanel"> + <layout_panel width="336" height="30" enabled="true" name="CondenseAllButtonPanel"> <button width="93" height="21" left="2" label="Collapse all" name="collapse_all_button"> </button> </layout_panel> - <layout_panel width="336" height="30" enabled="true" orientation="horizontal" name="GapLayoutPanel"> + <layout_panel width="336" height="30" enabled="true" name="GapLayoutPanel"> <panel width="90" height="21" left="2" label="Gap Panel" border="false" name="GapPanel"> </panel> </layout_panel> - <layout_panel width="336" height="30" enabled="true" orientation="horizontal" name="DeleteAllButtonPanel"> + <layout_panel width="336" height="30" enabled="true" name="DeleteAllButtonPanel"> <button width="93" height="21" left="2" label="Delete all" name="delete_all_button"> </button> </layout_panel> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 3f557d0d0f..3b5f3a3184 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3555,6 +3555,16 @@ parameter="collision skeleton" /> </menu_item_check> <menu_item_check + label="Show Bones" + name="Show Bones"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="joints" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="joints" /> + </menu_item_check> + <menu_item_check label="Display Agent Target" name="Display Agent Target"> <menu_item_check.on_check diff --git a/indra/newview/skins/default/xui/en/panel_notification_list_item.xml b/indra/newview/skins/default/xui/en/panel_notification_list_item.xml index a909028f9f..efaaefd0e4 100644 --- a/indra/newview/skins/default/xui/en/panel_notification_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_notification_list_item.xml @@ -9,7 +9,6 @@ left="0" width="331" height="202" - can_resize="true" layout="topleft" follows="left|top|right|bottom" > <!-- background_opaque="false" --> @@ -45,12 +44,12 @@ <layout_panel top="0" left="0" height="30" follows="left|top|right|bottom" layout="topleft" name="layout_panel_condensed_view" visible="false" background_opaque="false" background_visible="true" bg_alpha_color="SysWellItemUnselected"> <panel border="true" top="0" left="5" height="30" bevel_style="none" layout="topleft" follows="left|top|right|bottom" name="panel_condensed_view"> <layout_stack top="0" left="0" width="325" height="50" orientation="horizontal" follows="left|top|right|bottom" name="horizontal_stack"> - <layout_panel width="30" height="39" orientation="horizontal" follows="left|top|right|bottom" name="layout_panel_right"> + <layout_panel width="30" height="39" follows="left|top|right|bottom" name="layout_panel_right"> <group_icon left="5" top="6" width="25" height="25" mouse_opaque="true" name="group_icon" tool_tip="Group" default_icon_name="Generic_Group" visible="true"/> <avatar_icon left="5" top="6" width="25" height="25" mouse_opaque="true" name="avatar_icon" tool_tip="Avatar" default_icon_name="Generic_Person" visible="false"/> <icon left="5" top="6" width="25" height="25" mouse_opaque="true" name="system_notification_icon" tool_tip="Icon" image_name="System_Notification" visible="false"/> </layout_panel> - <layout_panel width="260" height="50" orientation="horizontal" name="layout_panel_middle"> + <layout_panel width="260" height="50" name="layout_panel_middle"> <panel border="false" top="0" width="260" height="38" bevel_style="none" follows="left|top|right" layout="topleft" name="main_info_panel"> <panel border="false" top="0" left="0" width="260" height="19" bevel_style="none" follows="left|top|right|bottom" layout="topleft" name="notification_title_panel"> <text allow_scroll="false" font="SansSerifSmall" top="6" left="0" width="260" height="12" layout="topleft" follows="right|left" text_color="White" @@ -69,7 +68,7 @@ </panel> </panel> </layout_panel> - <layout_panel width="18" height="48" orientation="horizontal" follows="right|top|bottom" name="layout_panel_right"> + <layout_panel width="18" height="48" follows="right|top|bottom" name="layout_panel_right"> <panel top="0" left="0" width="17" height="39" follows="left|top|right|bottom" layout="topleft" name="close_expand_panel"> <button top="0" left="0" width="17" height="17" layout="topleft" follows="top" name="close_btn" mouse_opaque="true" tab_stop="false" image_unselected="Icon_Close_Foreground" image_selected="Icon_Close_Press" /> @@ -83,13 +82,13 @@ <layout_panel top="0" left="0" height="196" follows="left|top|right|bottom" layout="topleft" name="layout_panel_expanded_view" visible="true" background_opaque="false" background_visible="true" bg_alpha_color="SysWellItemUnselected"> <panel border="true" top="0" left="5" height="196" bevel_style="none" follows="left|top|right|bottom" layout="topleft" name="panel_expanded_view"> <layout_stack top="0" left="0" width="325" height="196" orientation="horizontal" follows="left|top|right|bottom" name="horizontal_stack"> - <layout_panel width="30" height="170" orientation="horizontal" follows="left|top|bottom" name="layout_panel_right_exp"> + <layout_panel width="30" height="170" follows="left|top|bottom" name="layout_panel_right_exp"> <group_icon left="5" top="6" width="25" height="25" mouse_opaque="true" name="group_icon_exp" tool_tip="Group" default_icon_name="Generic_Group" visible="true"/> <avatar_icon left="5" top="6" width="25" height="25" mouse_opaque="true" name="avatar_icon_exp" tool_tip="Avatar" default_icon_name="Generic_Person" visible="false"/> <icon left="5" top="6" width="25" height="25" mouse_opaque="true" name="system_notification_icon_exp" tool_tip="Icon" image_name="System_Notification" visible="false"/> <icon left="12" top="144" width="20" height="20" name="attachment_icon_exp" tool_tip="Attachment" image_name="Icon_Attachment_Large" follows="left" mouse_opaque="true" visible="false"/> </layout_panel> - <layout_panel width="230" height="196" orientation="horizontal" follows="left|top|right|bottom" name="layout_panel_middle_exp"> + <layout_panel width="230" height="196" follows="left|top|right|bottom" name="layout_panel_middle_exp"> <panel border="false" top="0" width="230" height="196" bevel_style="none" follows="left|top|right|bottom" layout="topleft" name="main_info_panel_expanded"> <panel border="false" top="0" left="0" width="230" height="30" bevel_style="none" follows="left|top|right" layout="topleft" name="notification_title_panel_exp" > <text allow_scroll="false" font="SansSerif" top="6" left="0" width="233" height="10" layout="topleft" follows="right|left" text_color="White" @@ -128,7 +127,7 @@ </panel> </panel> </layout_panel> - <layout_panel width="18" orientation="horizontal" follows="right|top|bottom" name="layout_panel_left_exp"> + <layout_panel width="18" follows="right|top|bottom" name="layout_panel_left_exp"> <panel top="0" left="0" width="17" follows="left|top|right|bottom" layout="topleft" name="close_expand_panel_exp"> <button top="0" left="2" width="17" height="17" layout="topleft" follows="top" name="close_expanded_btn" mouse_opaque="true" tab_stop="false" image_unselected="Icon_Close_Foreground" image_selected="Icon_Close_Press" /> |