diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llmanipscale.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/linden/indra/newview/llmanipscale.cpp b/linden/indra/newview/llmanipscale.cpp index 65f99ef..969ee43 100644 --- a/linden/indra/newview/llmanipscale.cpp +++ b/linden/indra/newview/llmanipscale.cpp | |||
@@ -63,6 +63,8 @@ | |||
63 | #include "v2math.h" | 63 | #include "v2math.h" |
64 | #include "llvoavatar.h" | 64 | #include "llvoavatar.h" |
65 | 65 | ||
66 | #include "hippoLimits.h" | ||
67 | |||
66 | 68 | ||
67 | const F32 MAX_MANIP_SELECT_DISTANCE_SQUARED = 11.f * 11.f; | 69 | const F32 MAX_MANIP_SELECT_DISTANCE_SQUARED = 11.f * 11.f; |
68 | const F32 SNAP_GUIDE_SCREEN_OFFSET = 0.05f; | 70 | const F32 SNAP_GUIDE_SCREEN_OFFSET = 0.05f; |
@@ -70,8 +72,6 @@ const F32 SNAP_GUIDE_SCREEN_LENGTH = 0.7f; | |||
70 | const F32 SELECTED_MANIPULATOR_SCALE = 1.2f; | 72 | const F32 SELECTED_MANIPULATOR_SCALE = 1.2f; |
71 | const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f; | 73 | const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f; |
72 | const S32 NUM_MANIPULATORS = 14; | 74 | const S32 NUM_MANIPULATORS = 14; |
73 | const F32 DEFAULT_LL_MAX_PRIM_SCALE = 10.f; | ||
74 | const F32 DEFAULT_OPENSIM_MAX_PRIM_SCALE = 128.f; | ||
75 | 75 | ||
76 | const LLManip::EManipPart MANIPULATOR_IDS[NUM_MANIPULATORS] = | 76 | const LLManip::EManipPart MANIPULATOR_IDS[NUM_MANIPULATORS] = |
77 | { | 77 | { |
@@ -176,7 +176,6 @@ LLManipScale::LLManipScale( LLToolComposite* composite ) | |||
176 | mScaledBoxHandleSize( 1.f ), | 176 | mScaledBoxHandleSize( 1.f ), |
177 | mLastMouseX( -1 ), | 177 | mLastMouseX( -1 ), |
178 | mLastMouseY( -1 ), | 178 | mLastMouseY( -1 ), |
179 | mMaxPrimSize(0.f), | ||
180 | mSendUpdateOnMouseUp( FALSE ), | 179 | mSendUpdateOnMouseUp( FALSE ), |
181 | mLastUpdateFlags( 0 ), | 180 | mLastUpdateFlags( 0 ), |
182 | mScaleSnapUnit1(1.f), | 181 | mScaleSnapUnit1(1.f), |
@@ -205,7 +204,6 @@ void LLManipScale::render() | |||
205 | LLGLDepthTest gls_depth(GL_TRUE); | 204 | LLGLDepthTest gls_depth(GL_TRUE); |
206 | LLGLEnable gl_blend(GL_BLEND); | 205 | LLGLEnable gl_blend(GL_BLEND); |
207 | LLGLEnable gls_alpha_test(GL_ALPHA_TEST); | 206 | LLGLEnable gls_alpha_test(GL_ALPHA_TEST); |
208 | mMaxPrimSize = gSavedSettings.getBOOL("LoggedIntoOpenSim") ? DEFAULT_OPENSIM_MAX_PRIM_SCALE : DEFAULT_LL_MAX_PRIM_SCALE; | ||
209 | 207 | ||
210 | if( canAffectSelection() ) | 208 | if( canAffectSelection() ) |
211 | { | 209 | { |
@@ -957,8 +955,9 @@ void LLManipScale::dragCorner( S32 x, S32 y ) | |||
957 | mInSnapRegime = FALSE; | 955 | mInSnapRegime = FALSE; |
958 | } | 956 | } |
959 | 957 | ||
960 | F32 max_scale_factor = mMaxPrimSize / MIN_PRIM_SCALE; | 958 | F32 maxScale = gHippoLimits->getMaxPrimScale(); |
961 | F32 min_scale_factor = MIN_PRIM_SCALE / mMaxPrimSize; | 959 | F32 max_scale_factor = maxScale / MIN_PRIM_SCALE; |
960 | F32 min_scale_factor = MIN_PRIM_SCALE / maxScale; | ||
962 | 961 | ||
963 | // find max and min scale factors that will make biggest object hit max absolute scale and smallest object hit min absolute scale | 962 | // find max and min scale factors that will make biggest object hit max absolute scale and smallest object hit min absolute scale |
964 | for (LLObjectSelection::iterator iter = mObjectSelection->begin(); | 963 | for (LLObjectSelection::iterator iter = mObjectSelection->begin(); |
@@ -970,7 +969,7 @@ void LLManipScale::dragCorner( S32 x, S32 y ) | |||
970 | { | 969 | { |
971 | const LLVector3& scale = selectNode->mSavedScale; | 970 | const LLVector3& scale = selectNode->mSavedScale; |
972 | 971 | ||
973 | F32 cur_max_scale_factor = llmin( mMaxPrimSize / scale.mV[VX], mMaxPrimSize / scale.mV[VY], mMaxPrimSize / scale.mV[VZ] ); | 972 | F32 cur_max_scale_factor = llmin( maxScale / scale.mV[VX], maxScale / scale.mV[VY], maxScale / scale.mV[VZ] ); |
974 | max_scale_factor = llmin( max_scale_factor, cur_max_scale_factor ); | 973 | max_scale_factor = llmin( max_scale_factor, cur_max_scale_factor ); |
975 | 974 | ||
976 | F32 cur_min_scale_factor = llmax( MIN_PRIM_SCALE / scale.mV[VX], MIN_PRIM_SCALE / scale.mV[VY], MIN_PRIM_SCALE / scale.mV[VZ] ); | 975 | F32 cur_min_scale_factor = llmax( MIN_PRIM_SCALE / scale.mV[VX], MIN_PRIM_SCALE / scale.mV[VY], MIN_PRIM_SCALE / scale.mV[VZ] ); |
@@ -1267,7 +1266,8 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto | |||
1267 | 1266 | ||
1268 | F32 denom = axis * dir_local; | 1267 | F32 denom = axis * dir_local; |
1269 | F32 desired_delta_size = is_approx_zero(denom) ? 0.f : (delta_local_mag / denom); // in meters | 1268 | F32 desired_delta_size = is_approx_zero(denom) ? 0.f : (delta_local_mag / denom); // in meters |
1270 | F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, mMaxPrimSize); | 1269 | F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, |
1270 | gHippoLimits->getMaxPrimScale()); | ||
1271 | // propagate scale constraint back to position offset | 1271 | // propagate scale constraint back to position offset |
1272 | desired_delta_size = desired_scale - selectNode->mSavedScale.mV[axis_index]; // propagate constraint back to position | 1272 | desired_delta_size = desired_scale - selectNode->mSavedScale.mV[axis_index]; // propagate constraint back to position |
1273 | 1273 | ||
@@ -1967,7 +1967,7 @@ F32 LLManipScale::partToMaxScale( S32 part, const LLBBox &bbox ) const | |||
1967 | max_extent = bbox_extents.mV[i]; | 1967 | max_extent = bbox_extents.mV[i]; |
1968 | } | 1968 | } |
1969 | } | 1969 | } |
1970 | max_scale_factor = bbox_extents.magVec() * mMaxPrimSize / max_extent; | 1970 | max_scale_factor = bbox_extents.magVec() * gHippoLimits->getMaxPrimScale() / max_extent; |
1971 | 1971 | ||
1972 | if (getUniform()) | 1972 | if (getUniform()) |
1973 | { | 1973 | { |
@@ -1982,7 +1982,7 @@ F32 LLManipScale::partToMinScale( S32 part, const LLBBox &bbox ) const | |||
1982 | { | 1982 | { |
1983 | LLVector3 bbox_extents = unitVectorToLocalBBoxExtent( partToUnitVector( part ), bbox ); | 1983 | LLVector3 bbox_extents = unitVectorToLocalBBoxExtent( partToUnitVector( part ), bbox ); |
1984 | bbox_extents.abs(); | 1984 | bbox_extents.abs(); |
1985 | F32 min_extent = mMaxPrimSize; | 1985 | F32 min_extent = gHippoLimits->getMaxPrimScale(); |
1986 | for (U32 i = VX; i <= VZ; i++) | 1986 | for (U32 i = VX; i <= VZ; i++) |
1987 | { | 1987 | { |
1988 | if (bbox_extents.mV[i] > 0.f && bbox_extents.mV[i] < min_extent) | 1988 | if (bbox_extents.mV[i] > 0.f && bbox_extents.mV[i] < min_extent) |
@@ -2057,13 +2057,3 @@ BOOL LLManipScale::canAffectSelection() | |||
2057 | } | 2057 | } |
2058 | return can_scale; | 2058 | return can_scale; |
2059 | } | 2059 | } |
2060 | |||
2061 | //static | ||
2062 | F32 LLManipScale::getMaxPrimSize() | ||
2063 | { | ||
2064 | if (gSavedSettings.getBOOL("LoggedIntoOpenSim")) | ||
2065 | { | ||
2066 | return DEFAULT_OPENSIM_MAX_PRIM_SCALE; | ||
2067 | } | ||
2068 | return DEFAULT_LL_MAX_PRIM_SCALE; | ||
2069 | } | ||