summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-10-14 22:00:09 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-10-14 22:00:09 +0300
commit80dd72ff2b30fd345482f0c2ede516e9b4bba8f3 (patch)
treec4e90216ac4bd5082c15d0320d37b2938ea285ff /indra/newview/llvoavatar.cpp
parent42fa322e76757073ecc8e884f7fd0fb80e0dd4ad (diff)
parenta2c8c8238cfb109e0da81363995e08e99173426f (diff)
Merge branch 'master' into DRTVWR-514-keymappings
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 10f51f7896..0aee4a3398 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1578,13 +1578,16 @@ void LLVOAvatar::renderCollisionVolumes()
}
}
-void LLVOAvatar::renderBones()
+void LLVOAvatar::renderBones(const std::string &selected_joint)
{
LLGLEnable blend(GL_BLEND);
avatar_joint_list_t::iterator iter = mSkeleton.begin();
- avatar_joint_list_t::iterator end = mSkeleton.end();
+ avatar_joint_list_t::iterator end = mSkeleton.end();
+ // For selected joints
+ static LLVector3 SELECTED_COLOR_OCCLUDED(1.0f, 1.0f, 0.0f);
+ static LLVector3 SELECTED_COLOR_VISIBLE(0.5f, 0.5f, 0.5f);
// For bones with position overrides defined
static LLVector3 OVERRIDE_COLOR_OCCLUDED(1.0f, 0.0f, 0.0f);
static LLVector3 OVERRIDE_COLOR_VISIBLE(0.5f, 0.5f, 0.5f);
@@ -1611,7 +1614,18 @@ void LLVOAvatar::renderBones()
LLVector3 pos;
LLUUID mesh_id;
- if (jointp->hasAttachmentPosOverride(pos,mesh_id))
+ F32 sphere_scale = SPHERE_SCALEF;
+
+ // We are in render, so it is preferable to implement selection
+ // in a different way, but since this is for debug/preview, this
+ // is low priority
+ if (jointp->getName() == selected_joint)
+ {
+ sphere_scale *= 16;
+ occ_color = SELECTED_COLOR_OCCLUDED;
+ visible_color = SELECTED_COLOR_VISIBLE;
+ }
+ else if (jointp->hasAttachmentPosOverride(pos,mesh_id))
{
occ_color = OVERRIDE_COLOR_OCCLUDED;
visible_color = OVERRIDE_COLOR_VISIBLE;
@@ -1632,7 +1646,6 @@ void LLVOAvatar::renderBones()
LLVector3 begin_pos(0,0,0);
LLVector3 end_pos(jointp->getEnd());
- F32 sphere_scale = SPHERE_SCALEF;
gGL.pushMatrix();
gGL.multMatrix( &jointp->getXform()->getWorldMatrix().mMatrix[0][0] );