diff options
author | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
commit | cd17687f01420952712a500107e0f93e7ab8d5f8 (patch) | |
tree | ce48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llmaniptranslate.cpp | |
parent | Second Life viewer sources 1.19.0.5 (diff) | |
download | meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2 meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz |
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/llmaniptranslate.cpp')
-rw-r--r-- | linden/indra/newview/llmaniptranslate.cpp | 416 |
1 files changed, 211 insertions, 205 deletions
diff --git a/linden/indra/newview/llmaniptranslate.cpp b/linden/indra/newview/llmaniptranslate.cpp index 2642f95..c1457b3 100644 --- a/linden/indra/newview/llmaniptranslate.cpp +++ b/linden/indra/newview/llmaniptranslate.cpp | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "llmaniptranslate.h" | 38 | #include "llmaniptranslate.h" |
39 | 39 | ||
40 | #include "llgl.h" | 40 | #include "llgl.h" |
41 | #include "llglimmediate.h" | ||
41 | 42 | ||
42 | #include "llagent.h" | 43 | #include "llagent.h" |
43 | #include "llbbox.h" | 44 | #include "llbbox.h" |
@@ -99,11 +100,6 @@ const U32 ARROW_TO_AXIS[4] = | |||
99 | VZ | 100 | VZ |
100 | }; | 101 | }; |
101 | 102 | ||
102 | BOOL sort_manip_by_end_z(LLManipTranslate::ManipulatorHandle *new_manip, LLManipTranslate::ManipulatorHandle *test_manip) | ||
103 | { | ||
104 | return (new_manip->mEndPosition.mV[VZ] < test_manip->mEndPosition.mV[VZ]); | ||
105 | } | ||
106 | |||
107 | LLManipTranslate::LLManipTranslate( LLToolComposite* composite ) | 103 | LLManipTranslate::LLManipTranslate( LLToolComposite* composite ) |
108 | : LLManip( "Move", composite ), | 104 | : LLManip( "Move", composite ), |
109 | mLastHoverMouseX(-1), | 105 | mLastHoverMouseX(-1), |
@@ -124,8 +120,6 @@ LLManipTranslate::LLManipTranslate( LLToolComposite* composite ) | |||
124 | mPlaneScales(1.f, 1.f, 1.f), | 120 | mPlaneScales(1.f, 1.f, 1.f), |
125 | mPlaneManipPositions(1.f, 1.f, 1.f, 1.f) | 121 | mPlaneManipPositions(1.f, 1.f, 1.f, 1.f) |
126 | { | 122 | { |
127 | mProjectedManipulators.setInsertBefore(sort_manip_by_end_z); | ||
128 | |||
129 | if (sGridTex == 0) | 123 | if (sGridTex == 0) |
130 | { | 124 | { |
131 | restoreGL(); | 125 | restoreGL(); |
@@ -140,7 +134,6 @@ void LLManipTranslate::restoreGL() | |||
140 | U32 mip = 0; | 134 | U32 mip = 0; |
141 | 135 | ||
142 | GLuint* d = new GLuint[rez*rez]; | 136 | GLuint* d = new GLuint[rez*rez]; |
143 | LLGLEnable tex2d(GL_TEXTURE_2D); | ||
144 | glGenTextures(1, &sGridTex); | 137 | glGenTextures(1, &sGridTex); |
145 | glBindTexture(GL_TEXTURE_2D, sGridTex); | 138 | glBindTexture(GL_TEXTURE_2D, sGridTex); |
146 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); | 139 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); |
@@ -253,7 +246,7 @@ void LLManipTranslate::restoreGL() | |||
253 | 246 | ||
254 | LLManipTranslate::~LLManipTranslate() | 247 | LLManipTranslate::~LLManipTranslate() |
255 | { | 248 | { |
256 | mProjectedManipulators.deleteAllData(); | 249 | for_each(mProjectedManipulators.begin(), mProjectedManipulators.end(), DeletePointer()); |
257 | } | 250 | } |
258 | 251 | ||
259 | 252 | ||
@@ -841,8 +834,6 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y) | |||
841 | transform *= projMatrix; | 834 | transform *= projMatrix; |
842 | } | 835 | } |
843 | 836 | ||
844 | mProjectedManipulators.deleteAllData(); | ||
845 | |||
846 | S32 numManips = 0; | 837 | S32 numManips = 0; |
847 | 838 | ||
848 | // edges | 839 | // edges |
@@ -898,6 +889,9 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y) | |||
898 | planar_manip_xy_visible = TRUE; | 889 | planar_manip_xy_visible = TRUE; |
899 | } | 890 | } |
900 | 891 | ||
892 | for_each(mProjectedManipulators.begin(), mProjectedManipulators.end(), DeletePointer()); | ||
893 | mProjectedManipulators.clear(); | ||
894 | |||
901 | for (S32 i = 0; i < num_arrow_manips; i+= 2) | 895 | for (S32 i = 0; i < num_arrow_manips; i+= 2) |
902 | { | 896 | { |
903 | LLVector4 projected_start = mManipulatorVertices[i] * transform; | 897 | LLVector4 projected_start = mManipulatorVertices[i] * transform; |
@@ -911,7 +905,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y) | |||
911 | LLVector3(projected_end.mV[VX], projected_end.mV[VY], projected_end.mV[VZ]), | 905 | LLVector3(projected_end.mV[VX], projected_end.mV[VY], projected_end.mV[VZ]), |
912 | MANIPULATOR_IDS[i / 2], | 906 | MANIPULATOR_IDS[i / 2], |
913 | 10.f); // 10 pixel hotspot for arrows | 907 | 10.f); // 10 pixel hotspot for arrows |
914 | mProjectedManipulators.addDataSorted(projManipulator); | 908 | mProjectedManipulators.insert(projManipulator); |
915 | } | 909 | } |
916 | 910 | ||
917 | if (planar_manip_yz_visible) | 911 | if (planar_manip_yz_visible) |
@@ -928,7 +922,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y) | |||
928 | LLVector3(projected_end.mV[VX], projected_end.mV[VY], projected_end.mV[VZ]), | 922 | LLVector3(projected_end.mV[VX], projected_end.mV[VY], projected_end.mV[VZ]), |
929 | MANIPULATOR_IDS[i / 2], | 923 | MANIPULATOR_IDS[i / 2], |
930 | 20.f); // 20 pixels for planar manipulators | 924 | 20.f); // 20 pixels for planar manipulators |
931 | mProjectedManipulators.addDataSorted(projManipulator); | 925 | mProjectedManipulators.insert(projManipulator); |
932 | } | 926 | } |
933 | 927 | ||
934 | if (planar_manip_xz_visible) | 928 | if (planar_manip_xz_visible) |
@@ -945,7 +939,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y) | |||
945 | LLVector3(projected_end.mV[VX], projected_end.mV[VY], projected_end.mV[VZ]), | 939 | LLVector3(projected_end.mV[VX], projected_end.mV[VY], projected_end.mV[VZ]), |
946 | MANIPULATOR_IDS[i / 2], | 940 | MANIPULATOR_IDS[i / 2], |
947 | 20.f); // 20 pixels for planar manipulators | 941 | 20.f); // 20 pixels for planar manipulators |
948 | mProjectedManipulators.addDataSorted(projManipulator); | 942 | mProjectedManipulators.insert(projManipulator); |
949 | } | 943 | } |
950 | 944 | ||
951 | if (planar_manip_xy_visible) | 945 | if (planar_manip_xy_visible) |
@@ -962,7 +956,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y) | |||
962 | LLVector3(projected_end.mV[VX], projected_end.mV[VY], projected_end.mV[VZ]), | 956 | LLVector3(projected_end.mV[VX], projected_end.mV[VY], projected_end.mV[VZ]), |
963 | MANIPULATOR_IDS[i / 2], | 957 | MANIPULATOR_IDS[i / 2], |
964 | 20.f); // 20 pixels for planar manipulators | 958 | 20.f); // 20 pixels for planar manipulators |
965 | mProjectedManipulators.addDataSorted(projManipulator); | 959 | mProjectedManipulators.insert(projManipulator); |
966 | } | 960 | } |
967 | 961 | ||
968 | LLVector2 manip_start_2d; | 962 | LLVector2 manip_start_2d; |
@@ -973,9 +967,10 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y) | |||
973 | LLVector2 mousePos((F32)x - half_width, (F32)y - half_height); | 967 | LLVector2 mousePos((F32)x - half_width, (F32)y - half_height); |
974 | LLVector2 mouse_delta; | 968 | LLVector2 mouse_delta; |
975 | 969 | ||
976 | for (ManipulatorHandle* manipulator = mProjectedManipulators.getFirstData(); | 970 | for (minpulator_list_t::iterator iter = mProjectedManipulators.begin(); |
977 | manipulator; | 971 | iter != mProjectedManipulators.end(); ++iter) |
978 | manipulator = mProjectedManipulators.getNextData()) | 972 | { |
973 | ManipulatorHandle* manipulator = *iter; | ||
979 | { | 974 | { |
980 | manip_start_2d.setVec(manipulator->mStartPosition.mV[VX] * half_width, manipulator->mStartPosition.mV[VY] * half_height); | 975 | manip_start_2d.setVec(manipulator->mStartPosition.mV[VX] * half_width, manipulator->mStartPosition.mV[VY] * half_height); |
981 | manip_end_2d.setVec(manipulator->mEndPosition.mV[VX] * half_width, manipulator->mEndPosition.mV[VY] * half_height); | 976 | manip_end_2d.setVec(manipulator->mEndPosition.mV[VX] * half_width, manipulator->mEndPosition.mV[VY] * half_height); |
@@ -996,6 +991,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y) | |||
996 | break; | 991 | break; |
997 | } | 992 | } |
998 | } | 993 | } |
994 | } | ||
999 | } | 995 | } |
1000 | 996 | ||
1001 | F32 LLManipTranslate::getMinGridScale() | 997 | F32 LLManipTranslate::getMinGridScale() |
@@ -1057,7 +1053,7 @@ BOOL LLManipTranslate::handleMouseUp(S32 x, S32 y, MASK mask) | |||
1057 | void LLManipTranslate::render() | 1053 | void LLManipTranslate::render() |
1058 | { | 1054 | { |
1059 | glMatrixMode(GL_MODELVIEW); | 1055 | glMatrixMode(GL_MODELVIEW); |
1060 | glPushMatrix(); | 1056 | gGL.pushMatrix(); |
1061 | if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) | 1057 | if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) |
1062 | { | 1058 | { |
1063 | F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom; | 1059 | F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom; |
@@ -1071,7 +1067,7 @@ void LLManipTranslate::render() | |||
1071 | renderTranslationHandles(); | 1067 | renderTranslationHandles(); |
1072 | renderSnapGuides(); | 1068 | renderSnapGuides(); |
1073 | } | 1069 | } |
1074 | glPopMatrix(); | 1070 | gGL.popMatrix(); |
1075 | 1071 | ||
1076 | renderText(); | 1072 | renderText(); |
1077 | } | 1073 | } |
@@ -1257,31 +1253,31 @@ void LLManipTranslate::renderSnapGuides() | |||
1257 | { | 1253 | { |
1258 | LLColor4 line_color = setupSnapGuideRenderPass(pass); | 1254 | LLColor4 line_color = setupSnapGuideRenderPass(pass); |
1259 | 1255 | ||
1260 | glBegin(GL_LINES); | 1256 | gGL.begin(GL_LINES); |
1261 | { | 1257 | { |
1262 | LLVector3 line_start = selection_center + (mSnapOffsetMeters * mSnapOffsetAxis) + (translate_axis * (guide_size_meters * 0.5f + offset_nearest_grid_unit)); | 1258 | LLVector3 line_start = selection_center + (mSnapOffsetMeters * mSnapOffsetAxis) + (translate_axis * (guide_size_meters * 0.5f + offset_nearest_grid_unit)); |
1263 | LLVector3 line_end = selection_center + (mSnapOffsetMeters * mSnapOffsetAxis) - (translate_axis * (guide_size_meters * 0.5f + offset_nearest_grid_unit)); | 1259 | LLVector3 line_end = selection_center + (mSnapOffsetMeters * mSnapOffsetAxis) - (translate_axis * (guide_size_meters * 0.5f + offset_nearest_grid_unit)); |
1264 | LLVector3 line_mid = (line_start + line_end) * 0.5f; | 1260 | LLVector3 line_mid = (line_start + line_end) * 0.5f; |
1265 | 1261 | ||
1266 | glColor4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW] * 0.2f); | 1262 | gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW] * 0.2f); |
1267 | glVertex3fv(line_start.mV); | 1263 | gGL.vertex3fv(line_start.mV); |
1268 | glColor4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); | 1264 | gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); |
1269 | glVertex3fv(line_mid.mV); | 1265 | gGL.vertex3fv(line_mid.mV); |
1270 | glVertex3fv(line_mid.mV); | 1266 | gGL.vertex3fv(line_mid.mV); |
1271 | glColor4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW] * 0.2f); | 1267 | gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW] * 0.2f); |
1272 | glVertex3fv(line_end.mV); | 1268 | gGL.vertex3fv(line_end.mV); |
1273 | 1269 | ||
1274 | line_start.setVec(selection_center + (mSnapOffsetAxis * -mSnapOffsetMeters) + (translate_axis * guide_size_meters * 0.5f)); | 1270 | line_start.setVec(selection_center + (mSnapOffsetAxis * -mSnapOffsetMeters) + (translate_axis * guide_size_meters * 0.5f)); |
1275 | line_end.setVec(selection_center + (mSnapOffsetAxis * -mSnapOffsetMeters) - (translate_axis * guide_size_meters * 0.5f)); | 1271 | line_end.setVec(selection_center + (mSnapOffsetAxis * -mSnapOffsetMeters) - (translate_axis * guide_size_meters * 0.5f)); |
1276 | line_mid = (line_start + line_end) * 0.5f; | 1272 | line_mid = (line_start + line_end) * 0.5f; |
1277 | 1273 | ||
1278 | glColor4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW] * 0.2f); | 1274 | gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW] * 0.2f); |
1279 | glVertex3fv(line_start.mV); | 1275 | gGL.vertex3fv(line_start.mV); |
1280 | glColor4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); | 1276 | gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); |
1281 | glVertex3fv(line_mid.mV); | 1277 | gGL.vertex3fv(line_mid.mV); |
1282 | glVertex3fv(line_mid.mV); | 1278 | gGL.vertex3fv(line_mid.mV); |
1283 | glColor4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW] * 0.2f); | 1279 | gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW] * 0.2f); |
1284 | glVertex3fv(line_end.mV); | 1280 | gGL.vertex3fv(line_end.mV); |
1285 | 1281 | ||
1286 | for (S32 i = -num_ticks_per_side; i <= num_ticks_per_side; i++) | 1282 | for (S32 i = -num_ticks_per_side; i <= num_ticks_per_side; i++) |
1287 | { | 1283 | { |
@@ -1314,53 +1310,53 @@ void LLManipTranslate::renderSnapGuides() | |||
1314 | 1310 | ||
1315 | tick_end = tick_start + (mSnapOffsetAxis * mSnapOffsetMeters * tick_scale); | 1311 | tick_end = tick_start + (mSnapOffsetAxis * mSnapOffsetMeters * tick_scale); |
1316 | 1312 | ||
1317 | glColor4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); | 1313 | gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); |
1318 | glVertex3fv(tick_start.mV); | 1314 | gGL.vertex3fv(tick_start.mV); |
1319 | glVertex3fv(tick_end.mV); | 1315 | gGL.vertex3fv(tick_end.mV); |
1320 | 1316 | ||
1321 | tick_start = selection_center + (mSnapOffsetAxis * -mSnapOffsetMeters) + | 1317 | tick_start = selection_center + (mSnapOffsetAxis * -mSnapOffsetMeters) + |
1322 | (translate_axis * (getMinGridScale() / (F32)(max_subdivisions) * (F32)i - offset_nearest_grid_unit)); | 1318 | (translate_axis * (getMinGridScale() / (F32)(max_subdivisions) * (F32)i - offset_nearest_grid_unit)); |
1323 | tick_end = tick_start - (mSnapOffsetAxis * mSnapOffsetMeters * tick_scale); | 1319 | tick_end = tick_start - (mSnapOffsetAxis * mSnapOffsetMeters * tick_scale); |
1324 | 1320 | ||
1325 | glVertex3fv(tick_start.mV); | 1321 | gGL.vertex3fv(tick_start.mV); |
1326 | glVertex3fv(tick_end.mV); | 1322 | gGL.vertex3fv(tick_end.mV); |
1327 | } | 1323 | } |
1328 | } | 1324 | } |
1329 | glEnd(); | 1325 | gGL.end(); |
1330 | 1326 | ||
1331 | if (mInSnapRegime) | 1327 | if (mInSnapRegime) |
1332 | { | 1328 | { |
1333 | LLVector3 line_start = selection_center - mSnapOffsetAxis * mSnapOffsetMeters; | 1329 | LLVector3 line_start = selection_center - mSnapOffsetAxis * mSnapOffsetMeters; |
1334 | LLVector3 line_end = selection_center + mSnapOffsetAxis * mSnapOffsetMeters; | 1330 | LLVector3 line_end = selection_center + mSnapOffsetAxis * mSnapOffsetMeters; |
1335 | 1331 | ||
1336 | glBegin(GL_LINES); | 1332 | gGL.begin(GL_LINES); |
1337 | { | 1333 | { |
1338 | glColor4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); | 1334 | gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); |
1339 | 1335 | ||
1340 | glVertex3fv(line_start.mV); | 1336 | gGL.vertex3fv(line_start.mV); |
1341 | glVertex3fv(line_end.mV); | 1337 | gGL.vertex3fv(line_end.mV); |
1342 | } | 1338 | } |
1343 | glEnd(); | 1339 | gGL.end(); |
1344 | 1340 | ||
1345 | // draw snap guide arrow | 1341 | // draw snap guide arrow |
1346 | glBegin(GL_TRIANGLES); | 1342 | gGL.begin(GL_TRIANGLES); |
1347 | { | 1343 | { |
1348 | glColor4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); | 1344 | gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); |
1349 | 1345 | ||
1350 | LLVector3 arrow_dir; | 1346 | LLVector3 arrow_dir; |
1351 | LLVector3 arrow_span = translate_axis; | 1347 | LLVector3 arrow_span = translate_axis; |
1352 | 1348 | ||
1353 | arrow_dir = -mSnapOffsetAxis; | 1349 | arrow_dir = -mSnapOffsetAxis; |
1354 | glVertex3fv((line_start + arrow_dir * mConeSize * SNAP_ARROW_SCALE).mV); | 1350 | gGL.vertex3fv((line_start + arrow_dir * mConeSize * SNAP_ARROW_SCALE).mV); |
1355 | glVertex3fv((line_start + arrow_span * mConeSize * SNAP_ARROW_SCALE).mV); | 1351 | gGL.vertex3fv((line_start + arrow_span * mConeSize * SNAP_ARROW_SCALE).mV); |
1356 | glVertex3fv((line_start - arrow_span * mConeSize * SNAP_ARROW_SCALE).mV); | 1352 | gGL.vertex3fv((line_start - arrow_span * mConeSize * SNAP_ARROW_SCALE).mV); |
1357 | 1353 | ||
1358 | arrow_dir = mSnapOffsetAxis; | 1354 | arrow_dir = mSnapOffsetAxis; |
1359 | glVertex3fv((line_end + arrow_dir * mConeSize * SNAP_ARROW_SCALE).mV); | 1355 | gGL.vertex3fv((line_end + arrow_dir * mConeSize * SNAP_ARROW_SCALE).mV); |
1360 | glVertex3fv((line_end + arrow_span * mConeSize * SNAP_ARROW_SCALE).mV); | 1356 | gGL.vertex3fv((line_end + arrow_span * mConeSize * SNAP_ARROW_SCALE).mV); |
1361 | glVertex3fv((line_end - arrow_span * mConeSize * SNAP_ARROW_SCALE).mV); | 1357 | gGL.vertex3fv((line_end - arrow_span * mConeSize * SNAP_ARROW_SCALE).mV); |
1362 | } | 1358 | } |
1363 | glEnd(); | 1359 | gGL.end(); |
1364 | } | 1360 | } |
1365 | } | 1361 | } |
1366 | 1362 | ||
@@ -1444,7 +1440,6 @@ void LLManipTranslate::renderSnapGuides() | |||
1444 | LLVector3 help_text_pos = selection_center_start + (snap_offset_meters_up * 3.f * mSnapOffsetAxis); | 1440 | LLVector3 help_text_pos = selection_center_start + (snap_offset_meters_up * 3.f * mSnapOffsetAxis); |
1445 | const LLFontGL* big_fontp = LLFontGL::sSansSerif; | 1441 | const LLFontGL* big_fontp = LLFontGL::sSansSerif; |
1446 | 1442 | ||
1447 | LLGLSTexture gls_texture; | ||
1448 | std::string help_text = "Move mouse cursor over ruler to snap"; | 1443 | std::string help_text = "Move mouse cursor over ruler to snap"; |
1449 | LLColor4 help_text_color = LLColor4::white; | 1444 | LLColor4 help_text_color = LLColor4::white; |
1450 | help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f); | 1445 | help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f); |
@@ -1498,19 +1493,20 @@ void LLManipTranslate::renderSnapGuides() | |||
1498 | break; | 1493 | break; |
1499 | } | 1494 | } |
1500 | 1495 | ||
1496 | LLImageGL::unbindTexture(0); | ||
1501 | highlightIntersection(normal, selection_center, grid_rotation, inner_color); | 1497 | highlightIntersection(normal, selection_center, grid_rotation, inner_color); |
1502 | 1498 | ||
1503 | glPushMatrix(); | 1499 | gGL.pushMatrix(); |
1504 | 1500 | ||
1505 | F32 x,y,z,angle_radians; | 1501 | F32 x,y,z,angle_radians; |
1506 | grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z); | 1502 | grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z); |
1507 | glTranslatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]); | 1503 | gGL.translatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]); |
1508 | glRotatef(angle_radians * RAD_TO_DEG, x, y, z); | 1504 | glRotatef(angle_radians * RAD_TO_DEG, x, y, z); |
1509 | 1505 | ||
1510 | F32 sz = mGridSizeMeters; | 1506 | F32 sz = mGridSizeMeters; |
1511 | F32 tiles = sz; | 1507 | F32 tiles = sz; |
1512 | glMatrixMode(GL_TEXTURE); | 1508 | glMatrixMode(GL_TEXTURE); |
1513 | glPushMatrix(); | 1509 | gGL.pushMatrix(); |
1514 | usc = 1.0f/usc; | 1510 | usc = 1.0f/usc; |
1515 | vsc = 1.0f/vsc; | 1511 | vsc = 1.0f/vsc; |
1516 | 1512 | ||
@@ -1524,37 +1520,41 @@ void LLManipTranslate::renderSnapGuides() | |||
1524 | } | 1520 | } |
1525 | 1521 | ||
1526 | glScalef(usc, vsc, 1.0f); | 1522 | glScalef(usc, vsc, 1.0f); |
1527 | glTranslatef(u, v, 0); | 1523 | gGL.translatef(u, v, 0); |
1528 | 1524 | ||
1529 | float a = line_alpha; | 1525 | float a = line_alpha; |
1530 | 1526 | ||
1531 | LLColor4 col = gColors.getColor("SilhouetteChildColor"); | 1527 | LLColor4 col = gColors.getColor("SilhouetteChildColor"); |
1532 | { | 1528 | { |
1533 | //draw grid behind objects | 1529 | //draw grid behind objects |
1534 | LLGLSTexture tex2d; | ||
1535 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); | 1530 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); |
1536 | 1531 | ||
1537 | { | 1532 | { |
1538 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GREATER); | 1533 | LLGLDisable stencil(GL_STENCIL_TEST); |
1539 | glBindTexture(GL_TEXTURE_2D, sGridTex); | 1534 | { |
1540 | glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA); | 1535 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GREATER); |
1541 | renderGrid(u,v,tiles,0.9f, 0.9f, 0.9f,a*0.15f); | 1536 | glBindTexture(GL_TEXTURE_2D, sGridTex); |
1542 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 1537 | gGL.flush(); |
1543 | } | 1538 | gGL.blendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA); |
1544 | 1539 | renderGrid(u,v,tiles,0.9f, 0.9f, 0.9f,a*0.15f); | |
1545 | { | 1540 | gGL.flush(); |
1546 | LLGLDisable alpha_test(GL_ALPHA_TEST); | 1541 | gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
1547 | //draw black overlay | 1542 | } |
1548 | glBindTexture(GL_TEXTURE_2D, 0); | 1543 | |
1549 | renderGrid(u,v,tiles,0.0f, 0.0f, 0.0f,a*0.16f); | 1544 | { |
1550 | 1545 | LLGLDisable alpha_test(GL_ALPHA_TEST); | |
1551 | //draw grid top | 1546 | //draw black overlay |
1552 | glBindTexture(GL_TEXTURE_2D, sGridTex); | 1547 | LLImageGL::unbindTexture(0); |
1553 | renderGrid(u,v,tiles,1,1,1,a); | 1548 | renderGrid(u,v,tiles,0.0f, 0.0f, 0.0f,a*0.16f); |
1554 | 1549 | ||
1555 | glPopMatrix(); | 1550 | //draw grid top |
1556 | glMatrixMode(GL_MODELVIEW); | 1551 | glBindTexture(GL_TEXTURE_2D, sGridTex); |
1557 | glPopMatrix(); | 1552 | renderGrid(u,v,tiles,1,1,1,a); |
1553 | |||
1554 | gGL.popMatrix(); | ||
1555 | glMatrixMode(GL_MODELVIEW); | ||
1556 | gGL.popMatrix(); | ||
1557 | } | ||
1558 | 1558 | ||
1559 | { | 1559 | { |
1560 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); | 1560 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); |
@@ -1564,6 +1564,7 @@ void LLManipTranslate::renderSnapGuides() | |||
1564 | { | 1564 | { |
1565 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GREATER); | 1565 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GREATER); |
1566 | LLGLEnable stipple(GL_LINE_STIPPLE); | 1566 | LLGLEnable stipple(GL_LINE_STIPPLE); |
1567 | gGL.flush(); | ||
1567 | glLineStipple(1, 0x3333); | 1568 | glLineStipple(1, 0x3333); |
1568 | 1569 | ||
1569 | switch (mManipPart) | 1570 | switch (mManipPart) |
@@ -1580,6 +1581,7 @@ void LLManipTranslate::renderSnapGuides() | |||
1580 | default: | 1581 | default: |
1581 | break; | 1582 | break; |
1582 | } | 1583 | } |
1584 | gGL.flush(); | ||
1583 | } | 1585 | } |
1584 | } | 1586 | } |
1585 | } | 1587 | } |
@@ -1592,32 +1594,32 @@ void LLManipTranslate::renderGrid(F32 x, F32 y, F32 size, F32 r, F32 g, F32 b, F | |||
1592 | 1594 | ||
1593 | for (F32 xx = -size-d; xx < size+d; xx += d) | 1595 | for (F32 xx = -size-d; xx < size+d; xx += d) |
1594 | { | 1596 | { |
1595 | glBegin(GL_TRIANGLE_STRIP); | 1597 | gGL.begin(GL_TRIANGLE_STRIP); |
1596 | for (F32 yy = -size-d; yy < size+d; yy += d) | 1598 | for (F32 yy = -size-d; yy < size+d; yy += d) |
1597 | { | 1599 | { |
1598 | float dx, dy, da; | 1600 | float dx, dy, da; |
1599 | 1601 | ||
1600 | dx = xx; dy = yy; | 1602 | dx = xx; dy = yy; |
1601 | da = sqrtf(llmax(0.0f, 1.0f-sqrtf(dx*dx+dy*dy)/size))*a; | 1603 | da = sqrtf(llmax(0.0f, 1.0f-sqrtf(dx*dx+dy*dy)/size))*a; |
1602 | glTexCoord2f(dx, dy); | 1604 | gGL.texCoord2f(dx, dy); |
1603 | renderGridVert(dx,dy,r,g,b,da); | 1605 | renderGridVert(dx,dy,r,g,b,da); |
1604 | 1606 | ||
1605 | dx = xx+d; dy = yy; | 1607 | dx = xx+d; dy = yy; |
1606 | da = sqrtf(llmax(0.0f, 1.0f-sqrtf(dx*dx+dy*dy)/size))*a; | 1608 | da = sqrtf(llmax(0.0f, 1.0f-sqrtf(dx*dx+dy*dy)/size))*a; |
1607 | glTexCoord2f(dx, dy); | 1609 | gGL.texCoord2f(dx, dy); |
1608 | renderGridVert(dx,dy,r,g,b,da); | 1610 | renderGridVert(dx,dy,r,g,b,da); |
1609 | 1611 | ||
1610 | dx = xx; dy = yy+d; | 1612 | dx = xx; dy = yy+d; |
1611 | da = sqrtf(llmax(0.0f, 1.0f-sqrtf(dx*dx+dy*dy)/size))*a; | 1613 | da = sqrtf(llmax(0.0f, 1.0f-sqrtf(dx*dx+dy*dy)/size))*a; |
1612 | glTexCoord2f(dx, dy); | 1614 | gGL.texCoord2f(dx, dy); |
1613 | renderGridVert(dx,dy,r,g,b,da); | 1615 | renderGridVert(dx,dy,r,g,b,da); |
1614 | 1616 | ||
1615 | dx = xx+d; dy = yy+d; | 1617 | dx = xx+d; dy = yy+d; |
1616 | da = sqrtf(llmax(0.0f, 1.0f-sqrtf(dx*dx+dy*dy)/size))*a; | 1618 | da = sqrtf(llmax(0.0f, 1.0f-sqrtf(dx*dx+dy*dy)/size))*a; |
1617 | glTexCoord2f(dx, dy); | 1619 | gGL.texCoord2f(dx, dy); |
1618 | renderGridVert(dx,dy,r,g,b,da); | 1620 | renderGridVert(dx,dy,r,g,b,da); |
1619 | } | 1621 | } |
1620 | glEnd(); | 1622 | gGL.end(); |
1621 | } | 1623 | } |
1622 | 1624 | ||
1623 | 1625 | ||
@@ -1633,10 +1635,12 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, | |||
1633 | return; | 1635 | return; |
1634 | } | 1636 | } |
1635 | 1637 | ||
1636 | U32 types[] = { LLRenderPass::PASS_SIMPLE, LLRenderPass::PASS_ALPHA, LLRenderPass::PASS_FULLBRIGHT }; | 1638 | U32 types[] = { LLRenderPass::PASS_SIMPLE, LLRenderPass::PASS_ALPHA, LLRenderPass::PASS_FULLBRIGHT, LLRenderPass::PASS_SHINY }; |
1639 | U32 num_types = sizeof(types)/sizeof(U32); | ||
1637 | 1640 | ||
1638 | GLuint stencil_mask = 0xFFFFFFFF; | 1641 | GLuint stencil_mask = 0xFFFFFFFF; |
1639 | //stencil in volumes | 1642 | //stencil in volumes |
1643 | gGL.stop(); | ||
1640 | { | 1644 | { |
1641 | glStencilMask(stencil_mask); | 1645 | glStencilMask(stencil_mask); |
1642 | glClearStencil(1); | 1646 | glClearStencil(1); |
@@ -1646,7 +1650,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, | |||
1646 | LLGLDepthTest depth (GL_TRUE, GL_FALSE, GL_ALWAYS); | 1650 | LLGLDepthTest depth (GL_TRUE, GL_FALSE, GL_ALWAYS); |
1647 | glStencilFunc(GL_ALWAYS, 0, stencil_mask); | 1651 | glStencilFunc(GL_ALWAYS, 0, stencil_mask); |
1648 | glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); | 1652 | glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); |
1649 | LLGLDisable tex(GL_TEXTURE_2D); | 1653 | LLImageGL::unbindTexture(0); |
1650 | glColor4f(1,1,1,1); | 1654 | glColor4f(1,1,1,1); |
1651 | 1655 | ||
1652 | //setup clip plane | 1656 | //setup clip plane |
@@ -1675,14 +1679,14 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, | |||
1675 | //stencil in volumes | 1679 | //stencil in volumes |
1676 | glStencilOp(GL_INCR, GL_INCR, GL_INCR); | 1680 | glStencilOp(GL_INCR, GL_INCR, GL_INCR); |
1677 | glCullFace(GL_FRONT); | 1681 | glCullFace(GL_FRONT); |
1678 | for (U32 i = 0; i < 3; i++) | 1682 | for (U32 i = 0; i < num_types; i++) |
1679 | { | 1683 | { |
1680 | gPipeline.renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE); | 1684 | gPipeline.renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE); |
1681 | } | 1685 | } |
1682 | 1686 | ||
1683 | glStencilOp(GL_DECR, GL_DECR, GL_DECR); | 1687 | glStencilOp(GL_DECR, GL_DECR, GL_DECR); |
1684 | glCullFace(GL_BACK); | 1688 | glCullFace(GL_BACK); |
1685 | for (U32 i = 0; i < 3; i++) | 1689 | for (U32 i = 0; i < num_types; i++) |
1686 | { | 1690 | { |
1687 | gPipeline.renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE); | 1691 | gPipeline.renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE); |
1688 | } | 1692 | } |
@@ -1698,12 +1702,13 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, | |||
1698 | 1702 | ||
1699 | glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); | 1703 | glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); |
1700 | } | 1704 | } |
1705 | gGL.start(); | ||
1701 | 1706 | ||
1702 | glPushMatrix(); | 1707 | gGL.pushMatrix(); |
1703 | 1708 | ||
1704 | F32 x,y,z,angle_radians; | 1709 | F32 x,y,z,angle_radians; |
1705 | grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z); | 1710 | grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z); |
1706 | glTranslatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]); | 1711 | gGL.translatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]); |
1707 | glRotatef(angle_radians * RAD_TO_DEG, x, y, z); | 1712 | glRotatef(angle_radians * RAD_TO_DEG, x, y, z); |
1708 | 1713 | ||
1709 | F32 sz = mGridSizeMeters; | 1714 | F32 sz = mGridSizeMeters; |
@@ -1711,7 +1716,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, | |||
1711 | 1716 | ||
1712 | //draw volume/plane intersections | 1717 | //draw volume/plane intersections |
1713 | { | 1718 | { |
1714 | LLGLDisable tex(GL_TEXTURE_2D); | 1719 | LLImageGL::unbindTexture(0); |
1715 | LLGLDepthTest depth(GL_FALSE); | 1720 | LLGLDepthTest depth(GL_FALSE); |
1716 | LLGLEnable stencil(GL_STENCIL_TEST); | 1721 | LLGLEnable stencil(GL_STENCIL_TEST); |
1717 | glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); | 1722 | glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); |
@@ -1719,7 +1724,11 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, | |||
1719 | renderGrid(0,0,tiles,inner_color.mV[0], inner_color.mV[1], inner_color.mV[2], 0.25f); | 1724 | renderGrid(0,0,tiles,inner_color.mV[0], inner_color.mV[1], inner_color.mV[2], 0.25f); |
1720 | } | 1725 | } |
1721 | 1726 | ||
1722 | glPopMatrix(); | 1727 | glStencilFunc(GL_ALWAYS, 255, 0xFFFFFFFF); |
1728 | glStencilMask(0xFFFFFFFF); | ||
1729 | glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); | ||
1730 | |||
1731 | gGL.popMatrix(); | ||
1723 | } | 1732 | } |
1724 | 1733 | ||
1725 | void LLManipTranslate::renderText() | 1734 | void LLManipTranslate::renderText() |
@@ -1830,9 +1839,9 @@ void LLManipTranslate::renderTranslationHandles() | |||
1830 | mConeSize = mArrowLengthMeters / 4.f; | 1839 | mConeSize = mArrowLengthMeters / 4.f; |
1831 | 1840 | ||
1832 | glMatrixMode(GL_MODELVIEW); | 1841 | glMatrixMode(GL_MODELVIEW); |
1833 | glPushMatrix(); | 1842 | gGL.pushMatrix(); |
1834 | { | 1843 | { |
1835 | glTranslatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]); | 1844 | gGL.translatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]); |
1836 | 1845 | ||
1837 | F32 angle_radians, x, y, z; | 1846 | F32 angle_radians, x, y, z; |
1838 | grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z); | 1847 | grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z); |
@@ -1884,9 +1893,9 @@ void LLManipTranslate::renderTranslationHandles() | |||
1884 | if ((mManipPart == LL_NO_PART || mManipPart == LL_YZ_PLANE) && llabs(relative_camera_dir.mV[VX]) > MIN_PLANE_MANIP_DOT_PRODUCT) | 1893 | if ((mManipPart == LL_NO_PART || mManipPart == LL_YZ_PLANE) && llabs(relative_camera_dir.mV[VX]) > MIN_PLANE_MANIP_DOT_PRODUCT) |
1885 | { | 1894 | { |
1886 | // render YZ plane manipulator | 1895 | // render YZ plane manipulator |
1887 | glPushMatrix(); | 1896 | gGL.pushMatrix(); |
1888 | glScalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]); | 1897 | glScalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]); |
1889 | glTranslatef(0.f, mPlaneManipOffsetMeters, mPlaneManipOffsetMeters); | 1898 | gGL.translatef(0.f, mPlaneManipOffsetMeters, mPlaneManipOffsetMeters); |
1890 | glScalef(mPlaneScales.mV[VX], mPlaneScales.mV[VX], mPlaneScales.mV[VX]); | 1899 | glScalef(mPlaneScales.mV[VX], mPlaneScales.mV[VX], mPlaneScales.mV[VX]); |
1891 | if (mHighlightedPart == LL_YZ_PLANE) | 1900 | if (mHighlightedPart == LL_YZ_PLANE) |
1892 | { | 1901 | { |
@@ -1898,49 +1907,49 @@ void LLManipTranslate::renderTranslationHandles() | |||
1898 | color1.setVec(0.f, 1.f, 0.f, 0.6f); | 1907 | color1.setVec(0.f, 1.f, 0.f, 0.6f); |
1899 | color2.setVec(0.f, 0.f, 1.f, 0.6f); | 1908 | color2.setVec(0.f, 0.f, 1.f, 0.6f); |
1900 | } | 1909 | } |
1901 | glBegin(GL_TRIANGLES); | 1910 | gGL.begin(GL_TRIANGLES); |
1902 | { | 1911 | { |
1903 | glColor4fv(color1.mV); | 1912 | gGL.color4fv(color1.mV); |
1904 | glVertex3f(0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f)); | 1913 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f)); |
1905 | glVertex3f(0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.75f)); | 1914 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.75f)); |
1906 | glVertex3f(0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); | 1915 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); |
1907 | 1916 | ||
1908 | glColor4fv(color2.mV); | 1917 | gGL.color4fv(color2.mV); |
1909 | glVertex3f(0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); | 1918 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); |
1910 | glVertex3f(0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.75f), mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); | 1919 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.75f), mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); |
1911 | glVertex3f(0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f)); | 1920 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f)); |
1912 | } | 1921 | } |
1913 | glEnd(); | 1922 | gGL.end(); |
1914 | 1923 | ||
1915 | LLUI::setLineWidth(3.0f); | 1924 | LLUI::setLineWidth(3.0f); |
1916 | glBegin(GL_LINES); | 1925 | gGL.begin(GL_LINES); |
1917 | { | 1926 | { |
1918 | glColor4f(0.f, 0.f, 0.f, 0.3f); | 1927 | gGL.color4f(0.f, 0.f, 0.f, 0.3f); |
1919 | glVertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); | 1928 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); |
1920 | glVertex3f(0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); | 1929 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); |
1921 | glVertex3f(0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); | 1930 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); |
1922 | glVertex3f(0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.1f); | 1931 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.1f); |
1923 | glVertex3f(0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); | 1932 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); |
1924 | glVertex3f(0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.4f); | 1933 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.4f); |
1925 | 1934 | ||
1926 | glVertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); | 1935 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); |
1927 | glVertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f); | 1936 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f); |
1928 | glVertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f); | 1937 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f); |
1929 | glVertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.1f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f); | 1938 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.1f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f); |
1930 | glVertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f); | 1939 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f); |
1931 | glVertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.4f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f); | 1940 | gGL.vertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.4f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f); |
1932 | } | 1941 | } |
1933 | glEnd(); | 1942 | gGL.end(); |
1934 | LLUI::setLineWidth(1.0f); | 1943 | LLUI::setLineWidth(1.0f); |
1935 | glPopMatrix(); | 1944 | gGL.popMatrix(); |
1936 | } | 1945 | } |
1937 | 1946 | ||
1938 | if ((mManipPart == LL_NO_PART || mManipPart == LL_XZ_PLANE) && llabs(relative_camera_dir.mV[VY]) > MIN_PLANE_MANIP_DOT_PRODUCT) | 1947 | if ((mManipPart == LL_NO_PART || mManipPart == LL_XZ_PLANE) && llabs(relative_camera_dir.mV[VY]) > MIN_PLANE_MANIP_DOT_PRODUCT) |
1939 | { | 1948 | { |
1940 | // render XZ plane manipulator | 1949 | // render XZ plane manipulator |
1941 | glPushMatrix(); | 1950 | gGL.pushMatrix(); |
1942 | glScalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]); | 1951 | glScalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]); |
1943 | glTranslatef(mPlaneManipOffsetMeters, 0.f, mPlaneManipOffsetMeters); | 1952 | gGL.translatef(mPlaneManipOffsetMeters, 0.f, mPlaneManipOffsetMeters); |
1944 | glScalef(mPlaneScales.mV[VY], mPlaneScales.mV[VY], mPlaneScales.mV[VY]); | 1953 | glScalef(mPlaneScales.mV[VY], mPlaneScales.mV[VY], mPlaneScales.mV[VY]); |
1945 | if (mHighlightedPart == LL_XZ_PLANE) | 1954 | if (mHighlightedPart == LL_XZ_PLANE) |
1946 | { | 1955 | { |
@@ -1953,48 +1962,48 @@ void LLManipTranslate::renderTranslationHandles() | |||
1953 | color2.setVec(1.f, 0.f, 0.f, 0.6f); | 1962 | color2.setVec(1.f, 0.f, 0.f, 0.6f); |
1954 | } | 1963 | } |
1955 | 1964 | ||
1956 | glBegin(GL_TRIANGLES); | 1965 | gGL.begin(GL_TRIANGLES); |
1957 | { | 1966 | { |
1958 | glColor4fv(color1.mV); | 1967 | gGL.color4fv(color1.mV); |
1959 | glVertex3f(mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); | 1968 | gGL.vertex3f(mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); |
1960 | glVertex3f(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.75f), 0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); | 1969 | gGL.vertex3f(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.75f), 0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); |
1961 | glVertex3f(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f)); | 1970 | gGL.vertex3f(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f)); |
1962 | 1971 | ||
1963 | glColor4fv(color2.mV); | 1972 | gGL.color4fv(color2.mV); |
1964 | glVertex3f(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f)); | 1973 | gGL.vertex3f(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f)); |
1965 | glVertex3f(mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.75f)); | 1974 | gGL.vertex3f(mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.75f)); |
1966 | glVertex3f(mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); | 1975 | gGL.vertex3f(mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); |
1967 | } | 1976 | } |
1968 | glEnd(); | 1977 | gGL.end(); |
1969 | 1978 | ||
1970 | LLUI::setLineWidth(3.0f); | 1979 | LLUI::setLineWidth(3.0f); |
1971 | glBegin(GL_LINES); | 1980 | gGL.begin(GL_LINES); |
1972 | { | 1981 | { |
1973 | glColor4f(0.f, 0.f, 0.f, 0.3f); | 1982 | gGL.color4f(0.f, 0.f, 0.f, 0.3f); |
1974 | glVertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); | 1983 | gGL.vertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); |
1975 | glVertex3f(mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); | 1984 | gGL.vertex3f(mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); |
1976 | glVertex3f(mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); | 1985 | gGL.vertex3f(mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); |
1977 | glVertex3f(mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.1f); | 1986 | gGL.vertex3f(mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.1f); |
1978 | glVertex3f(mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); | 1987 | gGL.vertex3f(mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); |
1979 | glVertex3f(mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.4f); | 1988 | gGL.vertex3f(mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.4f); |
1980 | 1989 | ||
1981 | glVertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); | 1990 | gGL.vertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); |
1982 | glVertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f); | 1991 | gGL.vertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f); |
1983 | glVertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f); | 1992 | gGL.vertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f); |
1984 | glVertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.1f, 0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f); | 1993 | gGL.vertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.1f, 0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f); |
1985 | glVertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f); | 1994 | gGL.vertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.25f); |
1986 | glVertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.4f, 0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f); | 1995 | gGL.vertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.4f, 0.f, mPlaneManipOffsetMeters * PLANE_TICK_SIZE * 0.1f); |
1987 | } | 1996 | } |
1988 | glEnd(); | 1997 | gGL.end(); |
1989 | LLUI::setLineWidth(1.0f); | 1998 | LLUI::setLineWidth(1.0f); |
1990 | 1999 | ||
1991 | glPopMatrix(); | 2000 | gGL.popMatrix(); |
1992 | } | 2001 | } |
1993 | 2002 | ||
1994 | if ((mManipPart == LL_NO_PART || mManipPart == LL_XY_PLANE) && llabs(relative_camera_dir.mV[VZ]) > MIN_PLANE_MANIP_DOT_PRODUCT) | 2003 | if ((mManipPart == LL_NO_PART || mManipPart == LL_XY_PLANE) && llabs(relative_camera_dir.mV[VZ]) > MIN_PLANE_MANIP_DOT_PRODUCT) |
1995 | { | 2004 | { |
1996 | // render XY plane manipulator | 2005 | // render XY plane manipulator |
1997 | glPushMatrix(); | 2006 | gGL.pushMatrix(); |
1998 | glScalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]); | 2007 | glScalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]); |
1999 | 2008 | ||
2000 | /* Y | 2009 | /* Y |
@@ -2008,13 +2017,13 @@ void LLManipTranslate::renderTranslationHandles() | |||
2008 | LLVector3 v0,v1,v2,v3; | 2017 | LLVector3 v0,v1,v2,v3; |
2009 | #if 0 | 2018 | #if 0 |
2010 | // This should theoretically work but looks off; could be tuned later -SJB | 2019 | // This should theoretically work but looks off; could be tuned later -SJB |
2011 | glTranslatef(-mPlaneManipOffsetMeters, -mPlaneManipOffsetMeters, 0.f); | 2020 | gGL.translatef(-mPlaneManipOffsetMeters, -mPlaneManipOffsetMeters, 0.f); |
2012 | v0 = LLVector3(mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), 0.f); | 2021 | v0 = LLVector3(mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), 0.f); |
2013 | v1 = LLVector3(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.75f), 0.f); | 2022 | v1 = LLVector3(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.75f), 0.f); |
2014 | v2 = LLVector3(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), 0.f); | 2023 | v2 = LLVector3(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), 0.f); |
2015 | v3 = LLVector3(mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.75f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), 0.f); | 2024 | v3 = LLVector3(mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.75f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), 0.f); |
2016 | #else | 2025 | #else |
2017 | glTranslatef(mPlaneManipOffsetMeters, mPlaneManipOffsetMeters, 0.f); | 2026 | gGL.translatef(mPlaneManipOffsetMeters, mPlaneManipOffsetMeters, 0.f); |
2018 | v0 = LLVector3(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), 0.f); | 2027 | v0 = LLVector3(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), 0.f); |
2019 | v1 = LLVector3(mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.75f), 0.f); | 2028 | v1 = LLVector3(mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.75f), 0.f); |
2020 | v2 = LLVector3(mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), 0.f); | 2029 | v2 = LLVector3(mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), 0.f); |
@@ -2032,44 +2041,44 @@ void LLManipTranslate::renderTranslationHandles() | |||
2032 | color2.setVec(0.f, 0.8f, 0.f, 0.6f); | 2041 | color2.setVec(0.f, 0.8f, 0.f, 0.6f); |
2033 | } | 2042 | } |
2034 | 2043 | ||
2035 | glBegin(GL_TRIANGLES); | 2044 | gGL.begin(GL_TRIANGLES); |
2036 | { | 2045 | { |
2037 | glColor4fv(color1.mV); | 2046 | gGL.color4fv(color1.mV); |
2038 | glVertex3fv(v0.mV); | 2047 | gGL.vertex3fv(v0.mV); |
2039 | glVertex3fv(v1.mV); | 2048 | gGL.vertex3fv(v1.mV); |
2040 | glVertex3fv(v2.mV); | 2049 | gGL.vertex3fv(v2.mV); |
2041 | 2050 | ||
2042 | glColor4fv(color2.mV); | 2051 | gGL.color4fv(color2.mV); |
2043 | glVertex3fv(v2.mV); | 2052 | gGL.vertex3fv(v2.mV); |
2044 | glVertex3fv(v3.mV); | 2053 | gGL.vertex3fv(v3.mV); |
2045 | glVertex3fv(v0.mV); | 2054 | gGL.vertex3fv(v0.mV); |
2046 | } | 2055 | } |
2047 | glEnd(); | 2056 | gGL.end(); |
2048 | 2057 | ||
2049 | LLUI::setLineWidth(3.0f); | 2058 | LLUI::setLineWidth(3.0f); |
2050 | glBegin(GL_LINES); | 2059 | gGL.begin(GL_LINES); |
2051 | { | 2060 | { |
2052 | glColor4f(0.f, 0.f, 0.f, 0.3f); | 2061 | gGL.color4f(0.f, 0.f, 0.f, 0.3f); |
2053 | LLVector3 v12 = (v1 + v2) * .5f; | 2062 | LLVector3 v12 = (v1 + v2) * .5f; |
2054 | glVertex3fv(v0.mV); | 2063 | gGL.vertex3fv(v0.mV); |
2055 | glVertex3fv(v12.mV); | 2064 | gGL.vertex3fv(v12.mV); |
2056 | glVertex3fv(v12.mV); | 2065 | gGL.vertex3fv(v12.mV); |
2057 | glVertex3fv((v12 + (v0-v12)*.3f + (v2-v12)*.3f).mV); | 2066 | gGL.vertex3fv((v12 + (v0-v12)*.3f + (v2-v12)*.3f).mV); |
2058 | glVertex3fv(v12.mV); | 2067 | gGL.vertex3fv(v12.mV); |
2059 | glVertex3fv((v12 + (v0-v12)*.3f + (v1-v12)*.3f).mV); | 2068 | gGL.vertex3fv((v12 + (v0-v12)*.3f + (v1-v12)*.3f).mV); |
2060 | 2069 | ||
2061 | LLVector3 v23 = (v2 + v3) * .5f; | 2070 | LLVector3 v23 = (v2 + v3) * .5f; |
2062 | glVertex3fv(v0.mV); | 2071 | gGL.vertex3fv(v0.mV); |
2063 | glVertex3fv(v23.mV); | 2072 | gGL.vertex3fv(v23.mV); |
2064 | glVertex3fv(v23.mV); | 2073 | gGL.vertex3fv(v23.mV); |
2065 | glVertex3fv((v23 + (v0-v23)*.3f + (v3-v23)*.3f).mV); | 2074 | gGL.vertex3fv((v23 + (v0-v23)*.3f + (v3-v23)*.3f).mV); |
2066 | glVertex3fv(v23.mV); | 2075 | gGL.vertex3fv(v23.mV); |
2067 | glVertex3fv((v23 + (v0-v23)*.3f + (v2-v23)*.3f).mV); | 2076 | gGL.vertex3fv((v23 + (v0-v23)*.3f + (v2-v23)*.3f).mV); |
2068 | } | 2077 | } |
2069 | glEnd(); | 2078 | gGL.end(); |
2070 | LLUI::setLineWidth(1.0f); | 2079 | LLUI::setLineWidth(1.0f); |
2071 | 2080 | ||
2072 | glPopMatrix(); | 2081 | gGL.popMatrix(); |
2073 | } | 2082 | } |
2074 | } | 2083 | } |
2075 | { | 2084 | { |
@@ -2141,7 +2150,7 @@ void LLManipTranslate::renderTranslationHandles() | |||
2141 | } | 2150 | } |
2142 | } | 2151 | } |
2143 | } | 2152 | } |
2144 | glPopMatrix(); | 2153 | gGL.popMatrix(); |
2145 | } | 2154 | } |
2146 | 2155 | ||
2147 | 2156 | ||
@@ -2150,11 +2159,11 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_ | |||
2150 | LLGLSNoTexture gls_ui_no_texture; | 2159 | LLGLSNoTexture gls_ui_no_texture; |
2151 | LLGLEnable gls_blend(GL_BLEND); | 2160 | LLGLEnable gls_blend(GL_BLEND); |
2152 | LLGLEnable gls_color_material(GL_COLOR_MATERIAL); | 2161 | LLGLEnable gls_color_material(GL_COLOR_MATERIAL); |
2153 | 2162 | ||
2154 | for (S32 pass = 1; pass <= 2; pass++) | 2163 | for (S32 pass = 1; pass <= 2; pass++) |
2155 | { | 2164 | { |
2156 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, pass == 1 ? GL_LEQUAL : GL_GREATER); | 2165 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, pass == 1 ? GL_LEQUAL : GL_GREATER); |
2157 | glPushMatrix(); | 2166 | gGL.pushMatrix(); |
2158 | 2167 | ||
2159 | S32 index = 0; | 2168 | S32 index = 0; |
2160 | 2169 | ||
@@ -2175,27 +2184,23 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_ | |||
2175 | color.mV[index] = pass == 1 ? .8f : .35f ; // red, green, or blue | 2184 | color.mV[index] = pass == 1 ? .8f : .35f ; // red, green, or blue |
2176 | color.mV[VALPHA] = 0.6f; | 2185 | color.mV[VALPHA] = 0.6f; |
2177 | } | 2186 | } |
2178 | glColor4fv( color.mV ); | 2187 | gGL.color4fv( color.mV ); |
2179 | 2188 | ||
2180 | LLVector3 vec; | 2189 | LLVector3 vec; |
2181 | 2190 | ||
2182 | { | 2191 | { |
2183 | // Stipple looks OK, but not great - SJB | ||
2184 | // LLGLEnable stipple(GL_LINE_STIPPLE); | ||
2185 | // glLineStipple(1, 0x3333); | ||
2186 | |||
2187 | LLUI::setLineWidth(2.0f); | 2192 | LLUI::setLineWidth(2.0f); |
2188 | glBegin(GL_LINES); | 2193 | gGL.begin(GL_LINES); |
2189 | vec.mV[index] = box_size; | 2194 | vec.mV[index] = box_size; |
2190 | glVertex3f(vec.mV[0], vec.mV[1], vec.mV[2]); | 2195 | gGL.vertex3f(vec.mV[0], vec.mV[1], vec.mV[2]); |
2191 | 2196 | ||
2192 | vec.mV[index] = arrow_size; | 2197 | vec.mV[index] = arrow_size; |
2193 | glVertex3f(vec.mV[0], vec.mV[1], vec.mV[2]); | 2198 | gGL.vertex3f(vec.mV[0], vec.mV[1], vec.mV[2]); |
2194 | glEnd(); | 2199 | gGL.end(); |
2195 | LLUI::setLineWidth(1.0f); | 2200 | LLUI::setLineWidth(1.0f); |
2196 | } | 2201 | } |
2197 | 2202 | ||
2198 | glTranslatef(vec.mV[0], vec.mV[1], vec.mV[2]); | 2203 | gGL.translatef(vec.mV[0], vec.mV[1], vec.mV[2]); |
2199 | glScalef(handle_size, handle_size, handle_size); | 2204 | glScalef(handle_size, handle_size, handle_size); |
2200 | 2205 | ||
2201 | F32 rot = 0.0f; | 2206 | F32 rot = 0.0f; |
@@ -2220,31 +2225,32 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_ | |||
2220 | break; | 2225 | break; |
2221 | } | 2226 | } |
2222 | 2227 | ||
2228 | glColor4fv(color.mV); | ||
2223 | glRotatef(rot, axis.mV[0], axis.mV[1], axis.mV[2]); | 2229 | glRotatef(rot, axis.mV[0], axis.mV[1], axis.mV[2]); |
2224 | glScalef(mArrowScales.mV[index], mArrowScales.mV[index], mArrowScales.mV[index] * 1.5f); | 2230 | glScalef(mArrowScales.mV[index], mArrowScales.mV[index], mArrowScales.mV[index] * 1.5f); |
2225 | 2231 | ||
2226 | gCone.render(CONE_LOD_HIGHEST); | 2232 | gCone.render(CONE_LOD_HIGHEST); |
2227 | 2233 | ||
2228 | glPopMatrix(); | 2234 | gGL.popMatrix(); |
2229 | } | 2235 | } |
2230 | } | 2236 | } |
2231 | 2237 | ||
2232 | void LLManipTranslate::renderGridVert(F32 x_trans, F32 y_trans, F32 r, F32 g, F32 b, F32 alpha) | 2238 | void LLManipTranslate::renderGridVert(F32 x_trans, F32 y_trans, F32 r, F32 g, F32 b, F32 alpha) |
2233 | { | 2239 | { |
2234 | glColor4f(r, g, b, alpha); | 2240 | gGL.color4f(r, g, b, alpha); |
2235 | switch (mManipPart) | 2241 | switch (mManipPart) |
2236 | { | 2242 | { |
2237 | case LL_YZ_PLANE: | 2243 | case LL_YZ_PLANE: |
2238 | glVertex3f(0, x_trans, y_trans); | 2244 | gGL.vertex3f(0, x_trans, y_trans); |
2239 | break; | 2245 | break; |
2240 | case LL_XZ_PLANE: | 2246 | case LL_XZ_PLANE: |
2241 | glVertex3f(x_trans, 0, y_trans); | 2247 | gGL.vertex3f(x_trans, 0, y_trans); |
2242 | break; | 2248 | break; |
2243 | case LL_XY_PLANE: | 2249 | case LL_XY_PLANE: |
2244 | glVertex3f(x_trans, y_trans, 0); | 2250 | gGL.vertex3f(x_trans, y_trans, 0); |
2245 | break; | 2251 | break; |
2246 | default: | 2252 | default: |
2247 | glVertex3f(0,0,0); | 2253 | gGL.vertex3f(0,0,0); |
2248 | break; | 2254 | break; |
2249 | } | 2255 | } |
2250 | 2256 | ||