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/newview/llvoavatar.cpp | |
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/newview/llvoavatar.cpp')
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
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; |