aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-18 08:52:24 -0700
committerMcCabe Maxsted2009-09-18 08:52:24 -0700
commit4cdef469977e8907b06e1fafb4d7c54a6eff93f9 (patch)
tree0e51a35185676db5d5260a7bc5060f5cc68dc6a9 /linden/indra
parentMerge branch '1.2.0-streaminfo' into 1.2.0-next (diff)
downloadmeta-impy-4cdef469977e8907b06e1fafb4d7c54a6eff93f9.zip
meta-impy-4cdef469977e8907b06e1fafb4d7c54a6eff93f9.tar.gz
meta-impy-4cdef469977e8907b06e1fafb4d7c54a6eff93f9.tar.bz2
meta-impy-4cdef469977e8907b06e1fafb4d7c54a6eff93f9.tar.xz
Dynamically change max prim size depending upon LL/OpenSim grid (added setting for opensim detection: LoggedIntoOpenSim). OpenSim max is 128m
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/llmath/xform.h2
-rw-r--r--linden/indra/newview/app_settings/settings.xml11
-rw-r--r--linden/indra/newview/llmanipscale.cpp26
-rw-r--r--linden/indra/newview/llmanipscale.h3
-rw-r--r--linden/indra/newview/llpanelobject.cpp4
-rw-r--r--linden/indra/newview/llviewermessage.cpp10
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_tools.xml6
7 files changed, 52 insertions, 10 deletions
diff --git a/linden/indra/llmath/xform.h b/linden/indra/llmath/xform.h
index 6f880cb..b41219c 100644
--- a/linden/indra/llmath/xform.h
+++ b/linden/indra/llmath/xform.h
@@ -37,7 +37,7 @@
37 37
38const F32 MAX_OBJECT_Z = 4096.f; // should match REGION_HEIGHT_METERS, Pre-havok4: 768.f 38const F32 MAX_OBJECT_Z = 4096.f; // should match REGION_HEIGHT_METERS, Pre-havok4: 768.f
39const F32 MIN_OBJECT_Z = -256.f; 39const F32 MIN_OBJECT_Z = -256.f;
40const F32 DEFAULT_MAX_PRIM_SCALE = 10.f; 40//const F32 DEFAULT_MAX_PRIM_SCALE = 10.f; set in llmanipscale.cpp now
41const F32 MIN_PRIM_SCALE = 0.01f; 41const F32 MIN_PRIM_SCALE = 0.01f;
42const F32 MAX_PRIM_SCALE = 65536.f; // something very high but not near FLT_MAX 42const F32 MAX_PRIM_SCALE = 65536.f; // something very high but not near FLT_MAX
43 43
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index f92b47f..60abc1b 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -4720,6 +4720,17 @@
4720 <key>Value</key> 4720 <key>Value</key>
4721 <integer>0</integer> 4721 <integer>0</integer>
4722 </map> 4722 </map>
4723 <key>LoggedIntoOpenSim</key>
4724 <map>
4725 <key>Comment</key>
4726 <string>Check whether or not we're in an OpenSimulator (default 0)</string>
4727 <key>Persist</key>
4728 <integer>1</integer>
4729 <key>Type</key>
4730 <string>Boolean</string>
4731 <key>Value</key>
4732 <integer>0</integer>
4733 </map>
4723 <key>LoginAsGod</key> 4734 <key>LoginAsGod</key>
4724 <map> 4735 <map>
4725 <key>Comment</key> 4736 <key>Comment</key>
diff --git a/linden/indra/newview/llmanipscale.cpp b/linden/indra/newview/llmanipscale.cpp
index 10cb0c3..5a67937 100644
--- a/linden/indra/newview/llmanipscale.cpp
+++ b/linden/indra/newview/llmanipscale.cpp
@@ -69,6 +69,8 @@ const F32 SNAP_GUIDE_SCREEN_LENGTH = 0.7f;
69const F32 SELECTED_MANIPULATOR_SCALE = 1.2f; 69const F32 SELECTED_MANIPULATOR_SCALE = 1.2f;
70const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f; 70const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f;
71const S32 NUM_MANIPULATORS = 14; 71const S32 NUM_MANIPULATORS = 14;
72const F32 DEFAULT_LL_MAX_PRIM_SCALE = 10.f;
73const F32 DEFAULT_OPENSIM_MAX_PRIM_SCALE = 128.f;
72 74
73const LLManip::EManipPart MANIPULATOR_IDS[NUM_MANIPULATORS] = 75const LLManip::EManipPart MANIPULATOR_IDS[NUM_MANIPULATORS] =
74{ 76{
@@ -173,6 +175,7 @@ LLManipScale::LLManipScale( LLToolComposite* composite )
173 mScaledBoxHandleSize( 1.f ), 175 mScaledBoxHandleSize( 1.f ),
174 mLastMouseX( -1 ), 176 mLastMouseX( -1 ),
175 mLastMouseY( -1 ), 177 mLastMouseY( -1 ),
178 mMaxPrimSize(0.f),
176 mSendUpdateOnMouseUp( FALSE ), 179 mSendUpdateOnMouseUp( FALSE ),
177 mLastUpdateFlags( 0 ), 180 mLastUpdateFlags( 0 ),
178 mScaleSnapUnit1(1.f), 181 mScaleSnapUnit1(1.f),
@@ -201,6 +204,7 @@ void LLManipScale::render()
201 LLGLDepthTest gls_depth(GL_TRUE); 204 LLGLDepthTest gls_depth(GL_TRUE);
202 LLGLEnable gl_blend(GL_BLEND); 205 LLGLEnable gl_blend(GL_BLEND);
203 LLGLEnable gls_alpha_test(GL_ALPHA_TEST); 206 LLGLEnable gls_alpha_test(GL_ALPHA_TEST);
207 mMaxPrimSize = gSavedSettings.getBOOL("LoggedIntoOpenSim") ? DEFAULT_OPENSIM_MAX_PRIM_SCALE : DEFAULT_LL_MAX_PRIM_SCALE;
204 208
205 if( canAffectSelection() ) 209 if( canAffectSelection() )
206 { 210 {
@@ -952,8 +956,8 @@ void LLManipScale::dragCorner( S32 x, S32 y )
952 mInSnapRegime = FALSE; 956 mInSnapRegime = FALSE;
953 } 957 }
954 958
955 F32 max_scale_factor = DEFAULT_MAX_PRIM_SCALE / MIN_PRIM_SCALE; 959 F32 max_scale_factor = mMaxPrimSize / MIN_PRIM_SCALE;
956 F32 min_scale_factor = MIN_PRIM_SCALE / DEFAULT_MAX_PRIM_SCALE; 960 F32 min_scale_factor = MIN_PRIM_SCALE / mMaxPrimSize;
957 961
958 // 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
959 for (LLObjectSelection::iterator iter = mObjectSelection->begin(); 963 for (LLObjectSelection::iterator iter = mObjectSelection->begin();
@@ -965,7 +969,7 @@ void LLManipScale::dragCorner( S32 x, S32 y )
965 { 969 {
966 const LLVector3& scale = selectNode->mSavedScale; 970 const LLVector3& scale = selectNode->mSavedScale;
967 971
968 F32 cur_max_scale_factor = llmin( DEFAULT_MAX_PRIM_SCALE / scale.mV[VX], DEFAULT_MAX_PRIM_SCALE / scale.mV[VY], DEFAULT_MAX_PRIM_SCALE / scale.mV[VZ] ); 972 F32 cur_max_scale_factor = llmin( mMaxPrimSize / scale.mV[VX], mMaxPrimSize / scale.mV[VY], mMaxPrimSize / scale.mV[VZ] );
969 max_scale_factor = llmin( max_scale_factor, cur_max_scale_factor ); 973 max_scale_factor = llmin( max_scale_factor, cur_max_scale_factor );
970 974
971 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] );
@@ -1262,7 +1266,7 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto
1262 1266
1263 F32 denom = axis * dir_local; 1267 F32 denom = axis * dir_local;
1264 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
1265 F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, DEFAULT_MAX_PRIM_SCALE); 1269 F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, mMaxPrimSize);
1266 // propagate scale constraint back to position offset 1270 // propagate scale constraint back to position offset
1267 desired_delta_size = desired_scale - selectNode->mSavedScale.mV[axis_index]; // propagate constraint back to position 1271 desired_delta_size = desired_scale - selectNode->mSavedScale.mV[axis_index]; // propagate constraint back to position
1268 1272
@@ -1962,7 +1966,7 @@ F32 LLManipScale::partToMaxScale( S32 part, const LLBBox &bbox ) const
1962 max_extent = bbox_extents.mV[i]; 1966 max_extent = bbox_extents.mV[i];
1963 } 1967 }
1964 } 1968 }
1965 max_scale_factor = bbox_extents.magVec() * DEFAULT_MAX_PRIM_SCALE / max_extent; 1969 max_scale_factor = bbox_extents.magVec() * mMaxPrimSize / max_extent;
1966 1970
1967 if (getUniform()) 1971 if (getUniform())
1968 { 1972 {
@@ -1977,7 +1981,7 @@ F32 LLManipScale::partToMinScale( S32 part, const LLBBox &bbox ) const
1977{ 1981{
1978 LLVector3 bbox_extents = unitVectorToLocalBBoxExtent( partToUnitVector( part ), bbox ); 1982 LLVector3 bbox_extents = unitVectorToLocalBBoxExtent( partToUnitVector( part ), bbox );
1979 bbox_extents.abs(); 1983 bbox_extents.abs();
1980 F32 min_extent = DEFAULT_MAX_PRIM_SCALE; 1984 F32 min_extent = mMaxPrimSize;
1981 for (U32 i = VX; i <= VZ; i++) 1985 for (U32 i = VX; i <= VZ; i++)
1982 { 1986 {
1983 if (bbox_extents.mV[i] > 0.f && bbox_extents.mV[i] < min_extent) 1987 if (bbox_extents.mV[i] > 0.f && bbox_extents.mV[i] < min_extent)
@@ -2052,3 +2056,13 @@ BOOL LLManipScale::canAffectSelection()
2052 } 2056 }
2053 return can_scale; 2057 return can_scale;
2054} 2058}
2059
2060//static
2061F32 LLManipScale::getMaxPrimSize()
2062{
2063 if (gSavedSettings.getBOOL("LoggedIntoOpenSim"))
2064 {
2065 return DEFAULT_OPENSIM_MAX_PRIM_SCALE;
2066 }
2067 return DEFAULT_LL_MAX_PRIM_SCALE;
2068}
diff --git a/linden/indra/newview/llmanipscale.h b/linden/indra/newview/llmanipscale.h
index 98d8c63..c60cb69 100644
--- a/linden/indra/newview/llmanipscale.h
+++ b/linden/indra/newview/llmanipscale.h
@@ -88,6 +88,8 @@ public:
88 static void setShowAxes( BOOL b ); 88 static void setShowAxes( BOOL b );
89 static BOOL getShowAxes(); 89 static BOOL getShowAxes();
90 90
91 static F32 getMaxPrimSize();
92
91private: 93private:
92 void renderCorners( const LLBBox& local_bbox ); 94 void renderCorners( const LLBBox& local_bbox );
93 void renderFaces( const LLBBox& local_bbox ); 95 void renderFaces( const LLBBox& local_bbox );
@@ -165,6 +167,7 @@ private:
165 F32 mScaleSnapValue; 167 F32 mScaleSnapValue;
166 BOOL mInSnapRegime; 168 BOOL mInSnapRegime;
167 F32* mManipulatorScales; 169 F32* mManipulatorScales;
170 F32 mMaxPrimSize;
168}; 171};
169 172
170#endif // LL_MANIPSCALE_H 173#endif // LL_MANIPSCALE_H
diff --git a/linden/indra/newview/llpanelobject.cpp b/linden/indra/newview/llpanelobject.cpp
index dd71a0e..9dcf410 100644
--- a/linden/indra/newview/llpanelobject.cpp
+++ b/linden/indra/newview/llpanelobject.cpp
@@ -631,6 +631,10 @@ void LLPanelObject::getState( )
631 } 631 }
632 else 632 else
633 { 633 {
634 mCtrlScaleX->setMaxValue(LLManipScale::getMaxPrimSize());
635 mCtrlScaleY->setMaxValue(LLManipScale::getMaxPrimSize());
636 mCtrlScaleZ->setMaxValue(LLManipScale::getMaxPrimSize());
637
634 // Only allowed to change these parameters for objects 638 // Only allowed to change these parameters for objects
635 // that you have permissions on AND are not attachments. 639 // that you have permissions on AND are not attachments.
636 enabled = root_objectp->permModify(); 640 enabled = root_objectp->permModify();
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index e326dac..c9a3cb7 100644
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -3152,6 +3152,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
3152 3152
3153 // If the server version has changed, display an info box and offer 3153 // If the server version has changed, display an info box and offer
3154 // to display the release notes, unless this is the initial log in. 3154 // to display the release notes, unless this is the initial log in.
3155 // Also verify we're on an OpenSimulator here.
3155 if (gLastVersionChannel == version_channel) 3156 if (gLastVersionChannel == version_channel)
3156 { 3157 {
3157 return; 3158 return;
@@ -3163,6 +3164,15 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
3163 "ServerVersionChanged", display_release_notes, NULL); 3164 "ServerVersionChanged", display_release_notes, NULL);
3164 } 3165 }
3165 3166
3167 if (version_channel.find("OpenSim") != std::string::npos)
3168 {
3169 gSavedSettings.setBOOL("LoggedIntoOpenSim", TRUE);
3170 }
3171 else
3172 {
3173 gSavedSettings.setBOOL("LoggedIntoOpenSim", FALSE);
3174 }
3175
3166 gLastVersionChannel = version_channel; 3176 gLastVersionChannel = version_channel;
3167} 3177}
3168 3178
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml
index bc18f44..a57c568 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml
@@ -660,15 +660,15 @@
660 </text> 660 </text>
661 <spinner bottom_delta="-20" decimal_digits="3" follows="left|top" height="16" 661 <spinner bottom_delta="-20" decimal_digits="3" follows="left|top" height="16"
662 increment="0.01" initial_val="0" label="X" label_width="10" left="10" 662 increment="0.01" initial_val="0" label="X" label_width="10" left="10"
663 max_val="10" min_val="0.01" mouse_opaque="true" name="Scale X" 663 min_val="0.01" mouse_opaque="true" name="Scale X"
664 text_enabled_color="1, 1, 1, 1" width="96" /> 664 text_enabled_color="1, 1, 1, 1" width="96" />
665 <spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16" 665 <spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16"
666 increment="0.01" initial_val="0" label="Y" label_width="10" left="10" 666 increment="0.01" initial_val="0" label="Y" label_width="10" left="10"
667 max_val="10" min_val="0.01" mouse_opaque="true" name="Scale Y" 667 min_val="0.01" mouse_opaque="true" name="Scale Y"
668 text_enabled_color="1, 1, 1, 1" width="96" /> 668 text_enabled_color="1, 1, 1, 1" width="96" />
669 <spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16" 669 <spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16"
670 increment="0.01" initial_val="0" label="Z" label_width="10" left="10" 670 increment="0.01" initial_val="0" label="Z" label_width="10" left="10"
671 max_val="10" min_val="0.01" mouse_opaque="true" name="Scale Z" 671 min_val="0.01" mouse_opaque="true" name="Scale Z"
672 text_enabled_color="1, 1, 1, 1" width="96" /> 672 text_enabled_color="1, 1, 1, 1" width="96" />
673 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 673 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
674 bottom_delta="-16" drop_shadow_visible="true" follows="left|top" 674 bottom_delta="-16" drop_shadow_visible="true" follows="left|top"