diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-06-27 21:02:01 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-06-27 21:02:01 +0000 |
commit | 926ea0b39afd04cab469ca17b28f95ebf969e669 (patch) | |
tree | 40d5653e19160f72e7a0b80fadb9bdb93ef3575c /indra/newview/llviewerjoint.cpp | |
parent | 41877d457ab9542dca22b99f3eddb1bfcfe7c1d6 (diff) |
QAR-669 1.20 Viewer RC11
QAR-648 1.20 Viewer RC10
merge Branch_1-20-Viewer-2 -r 88724:90511 -> release
Diffstat (limited to 'indra/newview/llviewerjoint.cpp')
-rw-r--r-- | indra/newview/llviewerjoint.cpp | 304 |
1 files changed, 153 insertions, 151 deletions
diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp index 176bf9273a..71d98b73de 100644 --- a/indra/newview/llviewerjoint.cpp +++ b/indra/newview/llviewerjoint.cpp @@ -118,123 +118,124 @@ void LLViewerJoint::setValid( BOOL valid, BOOL recursive ) //-------------------------------------------------------------------- // renderSkeleton() +// DEBUG (UNUSED) //-------------------------------------------------------------------- -void LLViewerJoint::renderSkeleton(BOOL recursive) -{ - F32 nc = 0.57735f; - - //---------------------------------------------------------------- - // push matrix stack - //---------------------------------------------------------------- - glPushMatrix(); - - //---------------------------------------------------------------- - // render the bone to my parent - //---------------------------------------------------------------- - if (mComponents & SC_BONE) - { - drawBone(); - } - - //---------------------------------------------------------------- - // offset to joint position and - // rotate to our orientation - //---------------------------------------------------------------- - glLoadIdentity(); - glMultMatrixf( &getWorldMatrix().mMatrix[0][0] ); - - //---------------------------------------------------------------- - // render joint axes - //---------------------------------------------------------------- - if (mComponents & SC_AXES) - { - gGL.begin(LLVertexBuffer::LINES); - gGL.color3f( 1.0f, 0.0f, 0.0f ); - gGL.vertex3f( 0.0f, 0.0f, 0.0f ); - gGL.vertex3f( 0.1f, 0.0f, 0.0f ); - - gGL.color3f( 0.0f, 1.0f, 0.0f ); - gGL.vertex3f( 0.0f, 0.0f, 0.0f ); - gGL.vertex3f( 0.0f, 0.1f, 0.0f ); - - gGL.color3f( 0.0f, 0.0f, 1.0f ); - gGL.vertex3f( 0.0f, 0.0f, 0.0f ); - gGL.vertex3f( 0.0f, 0.0f, 0.1f ); - gGL.end(); - } - - //---------------------------------------------------------------- - // render the joint graphic - //---------------------------------------------------------------- - if (mComponents & SC_JOINT) - { - gGL.color3f( 1.0f, 1.0f, 0.0f ); - - gGL.begin(LLVertexBuffer::TRIANGLES); - - // joint top half - glNormal3f(nc, nc, nc); - gGL.vertex3f(0.0f, 0.0f, 0.05f); - gGL.vertex3f(0.05f, 0.0f, 0.0f); - gGL.vertex3f(0.0f, 0.05f, 0.0f); - - glNormal3f(-nc, nc, nc); - gGL.vertex3f(0.0f, 0.0f, 0.05f); - gGL.vertex3f(0.0f, 0.05f, 0.0f); - gGL.vertex3f(-0.05f, 0.0f, 0.0f); +// void LLViewerJoint::renderSkeleton(BOOL recursive) +// { +// F32 nc = 0.57735f; + +// //---------------------------------------------------------------- +// // push matrix stack +// //---------------------------------------------------------------- +// glPushMatrix(); + +// //---------------------------------------------------------------- +// // render the bone to my parent +// //---------------------------------------------------------------- +// if (mComponents & SC_BONE) +// { +// drawBone(); +// } + +// //---------------------------------------------------------------- +// // offset to joint position and +// // rotate to our orientation +// //---------------------------------------------------------------- +// glLoadIdentity(); +// glMultMatrixf( &getWorldMatrix().mMatrix[0][0] ); + +// //---------------------------------------------------------------- +// // render joint axes +// //---------------------------------------------------------------- +// if (mComponents & SC_AXES) +// { +// gGL.begin(LLVertexBuffer::LINES); +// gGL.color3f( 1.0f, 0.0f, 0.0f ); +// gGL.vertex3f( 0.0f, 0.0f, 0.0f ); +// gGL.vertex3f( 0.1f, 0.0f, 0.0f ); + +// gGL.color3f( 0.0f, 1.0f, 0.0f ); +// gGL.vertex3f( 0.0f, 0.0f, 0.0f ); +// gGL.vertex3f( 0.0f, 0.1f, 0.0f ); + +// gGL.color3f( 0.0f, 0.0f, 1.0f ); +// gGL.vertex3f( 0.0f, 0.0f, 0.0f ); +// gGL.vertex3f( 0.0f, 0.0f, 0.1f ); +// gGL.end(); +// } + +// //---------------------------------------------------------------- +// // render the joint graphic +// //---------------------------------------------------------------- +// if (mComponents & SC_JOINT) +// { +// gGL.color3f( 1.0f, 1.0f, 0.0f ); + +// gGL.begin(LLVertexBuffer::TRIANGLES); + +// // joint top half +// glNormal3f(nc, nc, nc); +// gGL.vertex3f(0.0f, 0.0f, 0.05f); +// gGL.vertex3f(0.05f, 0.0f, 0.0f); +// gGL.vertex3f(0.0f, 0.05f, 0.0f); + +// glNormal3f(-nc, nc, nc); +// gGL.vertex3f(0.0f, 0.0f, 0.05f); +// gGL.vertex3f(0.0f, 0.05f, 0.0f); +// gGL.vertex3f(-0.05f, 0.0f, 0.0f); - glNormal3f(-nc, -nc, nc); - gGL.vertex3f(0.0f, 0.0f, 0.05f); - gGL.vertex3f(-0.05f, 0.0f, 0.0f); - gGL.vertex3f(0.0f, -0.05f, 0.0f); - - glNormal3f(nc, -nc, nc); - gGL.vertex3f(0.0f, 0.0f, 0.05f); - gGL.vertex3f(0.0f, -0.05f, 0.0f); - gGL.vertex3f(0.05f, 0.0f, 0.0f); +// glNormal3f(-nc, -nc, nc); +// gGL.vertex3f(0.0f, 0.0f, 0.05f); +// gGL.vertex3f(-0.05f, 0.0f, 0.0f); +// gGL.vertex3f(0.0f, -0.05f, 0.0f); + +// glNormal3f(nc, -nc, nc); +// gGL.vertex3f(0.0f, 0.0f, 0.05f); +// gGL.vertex3f(0.0f, -0.05f, 0.0f); +// gGL.vertex3f(0.05f, 0.0f, 0.0f); - // joint bottom half - glNormal3f(nc, nc, -nc); - gGL.vertex3f(0.0f, 0.0f, -0.05f); - gGL.vertex3f(0.0f, 0.05f, 0.0f); - gGL.vertex3f(0.05f, 0.0f, 0.0f); - - glNormal3f(-nc, nc, -nc); - gGL.vertex3f(0.0f, 0.0f, -0.05f); - gGL.vertex3f(-0.05f, 0.0f, 0.0f); - gGL.vertex3f(0.0f, 0.05f, 0.0f); +// // joint bottom half +// glNormal3f(nc, nc, -nc); +// gGL.vertex3f(0.0f, 0.0f, -0.05f); +// gGL.vertex3f(0.0f, 0.05f, 0.0f); +// gGL.vertex3f(0.05f, 0.0f, 0.0f); + +// glNormal3f(-nc, nc, -nc); +// gGL.vertex3f(0.0f, 0.0f, -0.05f); +// gGL.vertex3f(-0.05f, 0.0f, 0.0f); +// gGL.vertex3f(0.0f, 0.05f, 0.0f); - glNormal3f(-nc, -nc, -nc); - gGL.vertex3f(0.0f, 0.0f, -0.05f); - gGL.vertex3f(0.0f, -0.05f, 0.0f); - gGL.vertex3f(-0.05f, 0.0f, 0.0f); - - glNormal3f(nc, -nc, -nc); - gGL.vertex3f(0.0f, 0.0f, -0.05f); - gGL.vertex3f(0.05f, 0.0f, 0.0f); - gGL.vertex3f(0.0f, -0.05f, 0.0f); +// glNormal3f(-nc, -nc, -nc); +// gGL.vertex3f(0.0f, 0.0f, -0.05f); +// gGL.vertex3f(0.0f, -0.05f, 0.0f); +// gGL.vertex3f(-0.05f, 0.0f, 0.0f); + +// glNormal3f(nc, -nc, -nc); +// gGL.vertex3f(0.0f, 0.0f, -0.05f); +// gGL.vertex3f(0.05f, 0.0f, 0.0f); +// gGL.vertex3f(0.0f, -0.05f, 0.0f); - gGL.end(); - } - - //---------------------------------------------------------------- - // render children - //---------------------------------------------------------------- - if (recursive) - { - for (child_list_t::iterator iter = mChildren.begin(); - iter != mChildren.end(); ++iter) - { - LLViewerJoint* joint = (LLViewerJoint*)(*iter); - joint->renderSkeleton(); - } - } - - //---------------------------------------------------------------- - // pop matrix stack - //---------------------------------------------------------------- - glPopMatrix(); -} +// gGL.end(); +// } + +// //---------------------------------------------------------------- +// // render children +// //---------------------------------------------------------------- +// if (recursive) +// { +// for (child_list_t::iterator iter = mChildren.begin(); +// iter != mChildren.end(); ++iter) +// { +// LLViewerJoint* joint = (LLViewerJoint*)(*iter); +// joint->renderSkeleton(); +// } +// } + +// //---------------------------------------------------------------- +// // pop matrix stack +// //---------------------------------------------------------------- +// glPopMatrix(); +// } //-------------------------------------------------------------------- @@ -330,59 +331,60 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass ) //-------------------------------------------------------------------- // drawBone() +// DEBUG (UNUSED) //-------------------------------------------------------------------- -void LLViewerJoint::drawBone() -{ - if ( mParent == NULL ) - return; +// void LLViewerJoint::drawBone() +// { +// if ( mParent == NULL ) +// return; - F32 boneSize = 0.02f; +// F32 boneSize = 0.02f; - // rotate to point to child (bone direction) - glPushMatrix(); +// // rotate to point to child (bone direction) +// glPushMatrix(); - LLVector3 boneX = getPosition(); - F32 length = boneX.normVec(); +// LLVector3 boneX = getPosition(); +// F32 length = boneX.normVec(); - LLVector3 boneZ(1.0f, 0.0f, 1.0f); +// LLVector3 boneZ(1.0f, 0.0f, 1.0f); - LLVector3 boneY = boneZ % boneX; - boneY.normVec(); +// LLVector3 boneY = boneZ % boneX; +// boneY.normVec(); - boneZ = boneX % boneY; +// boneZ = boneX % boneY; - LLMatrix4 rotateMat; - rotateMat.setFwdRow( boneX ); - rotateMat.setLeftRow( boneY ); - rotateMat.setUpRow( boneZ ); - glMultMatrixf( &rotateMat.mMatrix[0][0] ); +// LLMatrix4 rotateMat; +// rotateMat.setFwdRow( boneX ); +// rotateMat.setLeftRow( boneY ); +// rotateMat.setUpRow( boneZ ); +// glMultMatrixf( &rotateMat.mMatrix[0][0] ); - // render the bone - gGL.color3f( 0.5f, 0.5f, 0.0f ); +// // render the bone +// gGL.color3f( 0.5f, 0.5f, 0.0f ); - gGL.begin(LLVertexBuffer::TRIANGLES); +// gGL.begin(LLVertexBuffer::TRIANGLES); - gGL.vertex3f( length, 0.0f, 0.0f); - gGL.vertex3f( 0.0f, boneSize, 0.0f); - gGL.vertex3f( 0.0f, 0.0f, boneSize); +// gGL.vertex3f( length, 0.0f, 0.0f); +// gGL.vertex3f( 0.0f, boneSize, 0.0f); +// gGL.vertex3f( 0.0f, 0.0f, boneSize); - gGL.vertex3f( length, 0.0f, 0.0f); - gGL.vertex3f( 0.0f, 0.0f, -boneSize); - gGL.vertex3f( 0.0f, boneSize, 0.0f); +// gGL.vertex3f( length, 0.0f, 0.0f); +// gGL.vertex3f( 0.0f, 0.0f, -boneSize); +// gGL.vertex3f( 0.0f, boneSize, 0.0f); - gGL.vertex3f( length, 0.0f, 0.0f); - gGL.vertex3f( 0.0f, -boneSize, 0.0f); - gGL.vertex3f( 0.0f, 0.0f, -boneSize); +// gGL.vertex3f( length, 0.0f, 0.0f); +// gGL.vertex3f( 0.0f, -boneSize, 0.0f); +// gGL.vertex3f( 0.0f, 0.0f, -boneSize); - gGL.vertex3f( length, 0.0f, 0.0f); - gGL.vertex3f( 0.0f, 0.0f, boneSize); - gGL.vertex3f( 0.0f, -boneSize, 0.0f); +// gGL.vertex3f( length, 0.0f, 0.0f); +// gGL.vertex3f( 0.0f, 0.0f, boneSize); +// gGL.vertex3f( 0.0f, -boneSize, 0.0f); - gGL.end(); +// gGL.end(); - // restore matrix - glPopMatrix(); -} +// // restore matrix +// glPopMatrix(); +// } //-------------------------------------------------------------------- // isTransparent() @@ -437,13 +439,13 @@ void LLViewerJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind) } } -void LLViewerJoint::updateGeometry() +void LLViewerJoint::updateJointGeometry() { for (child_list_t::iterator iter = mChildren.begin(); iter != mChildren.end(); ++iter) { LLViewerJoint* joint = (LLViewerJoint*)(*iter); - joint->updateGeometry(); + joint->updateJointGeometry(); } } |