diff options
Diffstat (limited to 'indra/newview/llmaniprotate.cpp')
-rw-r--r-- | indra/newview/llmaniprotate.cpp | 85 |
1 files changed, 42 insertions, 43 deletions
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 6ee095475f..04dd2be583 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -130,12 +130,12 @@ void LLManipRotate::render() return; } - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { F32 zoom = gAgentCamera.mHUDCurZoom; - glScalef(zoom, zoom, zoom); + gGL.scalef(zoom, zoom, zoom); } @@ -145,7 +145,7 @@ void LLManipRotate::render() LLColor4 highlight_inside( 0.7f, 0.7f, 0.f, 0.5f ); F32 width_meters = WIDTH_PIXELS * mRadiusMeters / RADIUS_PIXELS; - glPushMatrix(); + gGL.pushMatrix(); { // are we in the middle of a constrained drag? if (mManipPart >= LL_ROT_X && mManipPart <= LL_ROT_Z) @@ -156,11 +156,11 @@ void LLManipRotate::render() { LLGLEnable cull_face(GL_CULL_FACE); LLGLDepthTest gls_depth(GL_FALSE); - glPushMatrix(); + gGL.pushMatrix(); { // Draw "sphere" (intersection of sphere with tangent cone that has apex at camera) - glTranslatef( mCenterToProfilePlane.mV[VX], mCenterToProfilePlane.mV[VY], mCenterToProfilePlane.mV[VZ] ); - glTranslatef( center.mV[VX], center.mV[VY], center.mV[VZ] ); + gGL.translatef( mCenterToProfilePlane.mV[VX], mCenterToProfilePlane.mV[VY], mCenterToProfilePlane.mV[VZ] ); + gGL.translatef( center.mV[VX], center.mV[VY], center.mV[VZ] ); // Inverse change of basis vectors LLVector3 forward = mCenterToCamNorm; @@ -177,14 +177,14 @@ void LLManipRotate::render() LLMatrix4 mat; mat.initRows(a, b, c, LLVector4(0.f, 0.f, 0.f, 1.f)); - glMultMatrixf( &mat.mMatrix[0][0] ); + gGL.multMatrix( &mat.mMatrix[0][0] ); - glRotatef( -90, 0.f, 1.f, 0.f); + gGL.rotatef( -90, 0.f, 1.f, 0.f); LLColor4 color; if (mManipPart == LL_ROT_ROLL || mHighlightedPart == LL_ROT_ROLL) { color.setVec(0.8f, 0.8f, 0.8f, 0.8f); - glScalef(mManipulatorScales.mV[VW], mManipulatorScales.mV[VW], mManipulatorScales.mV[VW]); + gGL.scalef(mManipulatorScales.mV[VW], mManipulatorScales.mV[VW], mManipulatorScales.mV[VW]); } else { @@ -199,13 +199,12 @@ void LLManipRotate::render() gl_circle_2d( 0, 0, mRadiusMeters, CIRCLE_STEPS, TRUE ); } - GLdouble plane_eqn[] = { 0, 0, 1, 0 }; - glClipPlane( GL_CLIP_PLANE0, plane_eqn ); + gGL.flush(); } - glPopMatrix(); + gGL.popMatrix(); } - glTranslatef( center.mV[VX], center.mV[VY], center.mV[VZ] ); + gGL.translatef( center.mV[VX], center.mV[VY], center.mV[VZ] ); LLQuaternion rot; F32 angle_radians, x, y, z; @@ -217,41 +216,41 @@ void LLManipRotate::render() LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z); - glRotatef(angle_radians * RAD_TO_DEG, x, y, z); + gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z); if (mManipPart == LL_ROT_Z) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); - glPushMatrix(); + gGL.pushMatrix(); { // selected part - glScalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); + gGL.scalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); renderActiveRing( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 1.f, 1.f) , LLColor4( 0.f, 0.f, 1.f, 0.3f )); } - glPopMatrix(); + gGL.popMatrix(); } else if (mManipPart == LL_ROT_Y) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); - glPushMatrix(); + gGL.pushMatrix(); { - glRotatef( 90.f, 1.f, 0.f, 0.f ); - glScalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); + gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); + gGL.scalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); renderActiveRing( mRadiusMeters, width_meters, LLColor4( 0.f, 1.f, 0.f, 1.f), LLColor4( 0.f, 1.f, 0.f, 0.3f)); } - glPopMatrix(); + gGL.popMatrix(); } else if (mManipPart == LL_ROT_X) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); - glPushMatrix(); + gGL.pushMatrix(); { - glRotatef( 90.f, 0.f, 1.f, 0.f ); - glScalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); + gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); + gGL.scalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); renderActiveRing( mRadiusMeters, width_meters, LLColor4( 1.f, 0.f, 0.f, 1.f), LLColor4( 1.f, 0.f, 0.f, 0.3f)); } - glPopMatrix(); + gGL.popMatrix(); } else if (mManipPart == LL_ROT_ROLL) { @@ -271,12 +270,12 @@ void LLManipRotate::render() // First pass: centers. Second pass: sides. for( S32 i=0; i<2; i++ ) { - glPushMatrix(); + gGL.pushMatrix(); { if (mHighlightedPart == LL_ROT_Z) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); - glScalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); + gGL.scalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 1.f, 1.f ), LLColor4( 0.f, 0.f, 1.f, 0.5f ), CIRCLE_STEPS, i); } @@ -286,15 +285,15 @@ void LLManipRotate::render() gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 0.8f, 0.8f ), LLColor4( 0.f, 0.f, 0.8f, 0.4f ), CIRCLE_STEPS, i); } } - glPopMatrix(); + gGL.popMatrix(); - glPushMatrix(); + gGL.pushMatrix(); { - glRotatef( 90.f, 1.f, 0.f, 0.f ); + gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); if (mHighlightedPart == LL_ROT_Y) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); - glScalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); + gGL.scalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 1.f, 0.f, 1.f ), LLColor4( 0.f, 1.f, 0.f, 0.5f ), CIRCLE_STEPS, i); } @@ -304,15 +303,15 @@ void LLManipRotate::render() gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.8f, 0.f, 0.8f ), LLColor4( 0.f, 0.8f, 0.f, 0.4f ), CIRCLE_STEPS, i); } } - glPopMatrix(); + gGL.popMatrix(); - glPushMatrix(); + gGL.pushMatrix(); { - glRotatef( 90.f, 0.f, 1.f, 0.f ); + gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); if (mHighlightedPart == LL_ROT_X) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); - glScalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); + gGL.scalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 1.f, 0.f, 0.f, 1.f ), LLColor4( 1.f, 0.f, 0.f, 0.5f ), CIRCLE_STEPS, i); @@ -323,7 +322,7 @@ void LLManipRotate::render() gl_ring( mRadiusMeters, width_meters, LLColor4( 0.8f, 0.f, 0.f, 0.8f ), LLColor4( 0.8f, 0.f, 0.f, 0.4f ), CIRCLE_STEPS, i); } } - glPopMatrix(); + gGL.popMatrix(); if (mHighlightedPart == LL_ROT_ROLL) { @@ -332,8 +331,8 @@ void LLManipRotate::render() } } } - glPopMatrix(); - glPopMatrix(); + gGL.popMatrix(); + gGL.popMatrix(); LLVector3 euler_angles; LLQuaternion object_rot = first_object->getRotationEdit(); @@ -796,14 +795,14 @@ void LLManipRotate::renderSnapGuides() for (S32 pass = 0; pass < 3; pass++) { // render snap guide ring - glPushMatrix(); + gGL.pushMatrix(); LLQuaternion snap_guide_rot; F32 angle_radians, x, y, z; snap_guide_rot.shortestArc(LLVector3::z_axis, getConstraintAxis()); snap_guide_rot.getAngleAxis(&angle_radians, &x, &y, &z); - glTranslatef(center.mV[VX], center.mV[VY], center.mV[VZ]); - glRotatef(angle_radians * RAD_TO_DEG, x, y, z); + gGL.translatef(center.mV[VX], center.mV[VY], center.mV[VZ]); + gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z); LLColor4 line_color = setupSnapGuideRenderPass(pass); @@ -826,7 +825,7 @@ void LLManipRotate::renderSnapGuides() { gl_circle_2d(0.f, 0.f, mRadiusMeters * SNAP_GUIDE_INNER_RADIUS, CIRCLE_STEPS, FALSE); } - glPopMatrix(); + gGL.popMatrix(); for (S32 i = 0; i < 64; i++) { |