aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-05-20 16:51:56 -0700
committerJacek Antonelli2010-06-19 02:40:55 -0500
commit3731520cdfbfdc48db6ff4752a5cbcfc2b5d9ccf (patch)
tree46d223a49e375cfc7cc305497d687f90ba5613fd /linden
parentadd: getvoice.sh which fetches all voice libs as needed on any supported Linux. (diff)
downloadmeta-impy-3731520cdfbfdc48db6ff4752a5cbcfc2b5d9ccf.zip
meta-impy-3731520cdfbfdc48db6ff4752a5cbcfc2b5d9ccf.tar.gz
meta-impy-3731520cdfbfdc48db6ff4752a5cbcfc2b5d9ccf.tar.bz2
meta-impy-3731520cdfbfdc48db6ff4752a5cbcfc2b5d9ccf.tar.xz
Support 'tiny prims' (resizing down to 0.001m) on OpenSim, made sure the tools floater uses the correct limits in the spinners
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/llmath/xform.h2
-rw-r--r--linden/indra/newview/hippoLimits.cpp2
-rw-r--r--linden/indra/newview/hippoLimits.h2
-rw-r--r--linden/indra/newview/llfloatertools.cpp8
-rw-r--r--linden/indra/newview/llmanipscale.cpp12
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_tools.xml6
6 files changed, 22 insertions, 10 deletions
diff --git a/linden/indra/llmath/xform.h b/linden/indra/llmath/xform.h
index 9b4d2fc..1e1df46 100644
--- a/linden/indra/llmath/xform.h
+++ b/linden/indra/llmath/xform.h
@@ -39,7 +39,7 @@
39const F32 MAX_OBJECT_Z = 4096.f; // should match REGION_HEIGHT_METERS, Pre-havok4: 768.f 39const F32 MAX_OBJECT_Z = 4096.f; // should match REGION_HEIGHT_METERS, Pre-havok4: 768.f
40const F32 MIN_OBJECT_Z = -256.f; 40const F32 MIN_OBJECT_Z = -256.f;
41//const F32 DEFAULT_MAX_PRIM_SCALE = 10.f; set via the Hippo Grid manager now 41//const F32 DEFAULT_MAX_PRIM_SCALE = 10.f; set via the Hippo Grid manager now
42const F32 MIN_PRIM_SCALE = 0.01f; 42//const F32 MIN_PRIM_SCALE = 0.01f; set via the Hippo Grid manager now
43const F32 MAX_PRIM_SCALE = 65536.f; // something very high but not near FLT_MAX 43const F32 MAX_PRIM_SCALE = 65536.f; // something very high but not near FLT_MAX
44 44
45 45
diff --git a/linden/indra/newview/hippoLimits.cpp b/linden/indra/newview/hippoLimits.cpp
index 96b3bee..35afcf9 100644
--- a/linden/indra/newview/hippoLimits.cpp
+++ b/linden/indra/newview/hippoLimits.cpp
@@ -32,6 +32,7 @@ void HippoLimits::setOpenSimLimits()
32{ 32{
33 mMaxAgentGroups = 100; 33 mMaxAgentGroups = 100;
34 mMaxPrimScale = 256.0f; 34 mMaxPrimScale = 256.0f;
35 mMinPrimScale = 0.001f;
35 mMaxHeight = 10000.0f; 36 mMaxHeight = 10000.0f;
36 mMaxLinkedPrims = -1; 37 mMaxLinkedPrims = -1;
37 38
@@ -51,6 +52,7 @@ void HippoLimits::setSecondLifeLimits()
51 llinfos << "Using Second Life limits." << llendl; 52 llinfos << "Using Second Life limits." << llendl;
52 mMaxAgentGroups = 25; 53 mMaxAgentGroups = 25;
53 mMaxPrimScale = 10.0f; 54 mMaxPrimScale = 10.0f;
55 mMinPrimScale = 0.01f;
54 mMaxHeight = 4096.0f; 56 mMaxHeight = 4096.0f;
55 mMinHoleSize = 0.05f; 57 mMinHoleSize = 0.05f;
56 mMaxHollow = 0.95f; 58 mMaxHollow = 0.95f;
diff --git a/linden/indra/newview/hippoLimits.h b/linden/indra/newview/hippoLimits.h
index 7152bcc..450a112 100644
--- a/linden/indra/newview/hippoLimits.h
+++ b/linden/indra/newview/hippoLimits.h
@@ -12,6 +12,7 @@ public:
12 float getMinHoleSize() const { return mMinHoleSize; } 12 float getMinHoleSize() const { return mMinHoleSize; }
13 float getMaxHollow() const { return mMaxHollow; } 13 float getMaxHollow() const { return mMaxHollow; }
14 float getMaxPrimScale() const { return mMaxPrimScale; } 14 float getMaxPrimScale() const { return mMaxPrimScale; }
15 float getMinPrimScale() const { return mMinPrimScale; }
15 S32 getMaxLinkedPrims() const { return mMaxLinkedPrims; } 16 S32 getMaxLinkedPrims() const { return mMaxLinkedPrims; }
16 17
17 void setLimits(); 18 void setLimits();
@@ -23,6 +24,7 @@ private:
23 float mMinHoleSize; 24 float mMinHoleSize;
24 float mMaxHollow; 25 float mMaxHollow;
25 float mMaxPrimScale; 26 float mMaxPrimScale;
27 float mMinPrimScale;
26 S32 mMaxLinkedPrims; 28 S32 mMaxLinkedPrims;
27 29
28 void setOpenSimLimits(); 30 void setOpenSimLimits();
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp
index c145791..efd81a6 100644
--- a/linden/indra/newview/llfloatertools.cpp
+++ b/linden/indra/newview/llfloatertools.cpp
@@ -268,6 +268,14 @@ BOOL LLFloaterTools::postBuild()
268 mBtnUnlink = getChild<LLButton>("unlink_btn"); 268 mBtnUnlink = getChild<LLButton>("unlink_btn");
269 childSetAction("unlink_btn",onClickUnlink, this); 269 childSetAction("unlink_btn",onClickUnlink, this);
270 270
271 getChild<LLSpinCtrl>("Scale X")->setMaxValue(gHippoLimits->getMaxPrimScale());
272 getChild<LLSpinCtrl>("Scale Y")->setMaxValue(gHippoLimits->getMaxPrimScale());
273 getChild<LLSpinCtrl>("Scale Z")->setMaxValue(gHippoLimits->getMaxPrimScale());
274
275 getChild<LLSpinCtrl>("Scale X")->setMinValue(gHippoLimits->getMinPrimScale());
276 getChild<LLSpinCtrl>("Scale Y")->setMinValue(gHippoLimits->getMinPrimScale());
277 getChild<LLSpinCtrl>("Scale Z")->setMinValue(gHippoLimits->getMinPrimScale());
278
271 toolsPrecision(); 279 toolsPrecision();
272 280
273 // 281 //
diff --git a/linden/indra/newview/llmanipscale.cpp b/linden/indra/newview/llmanipscale.cpp
index 969ee43..fa7e85f 100644
--- a/linden/indra/newview/llmanipscale.cpp
+++ b/linden/indra/newview/llmanipscale.cpp
@@ -956,8 +956,9 @@ void LLManipScale::dragCorner( S32 x, S32 y )
956 } 956 }
957 957
958 F32 maxScale = gHippoLimits->getMaxPrimScale(); 958 F32 maxScale = gHippoLimits->getMaxPrimScale();
959 F32 max_scale_factor = maxScale / MIN_PRIM_SCALE; 959 F32 minScale = gHippoLimits->getMinPrimScale();
960 F32 min_scale_factor = MIN_PRIM_SCALE / maxScale; 960 F32 max_scale_factor = maxScale / minScale;
961 F32 min_scale_factor = minScale / maxScale;
961 962
962 // find max and min scale factors that will make biggest object hit max absolute scale and smallest object hit min absolute scale 963 // find max and min scale factors that will make biggest object hit max absolute scale and smallest object hit min absolute scale
963 for (LLObjectSelection::iterator iter = mObjectSelection->begin(); 964 for (LLObjectSelection::iterator iter = mObjectSelection->begin();
@@ -972,7 +973,7 @@ void LLManipScale::dragCorner( S32 x, S32 y )
972 F32 cur_max_scale_factor = llmin( maxScale / scale.mV[VX], maxScale / scale.mV[VY], maxScale / scale.mV[VZ] ); 973 F32 cur_max_scale_factor = llmin( maxScale / scale.mV[VX], maxScale / scale.mV[VY], maxScale / scale.mV[VZ] );
973 max_scale_factor = llmin( max_scale_factor, cur_max_scale_factor ); 974 max_scale_factor = llmin( max_scale_factor, cur_max_scale_factor );
974 975
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] ); 976 F32 cur_min_scale_factor = llmax( minScale / scale.mV[VX], minScale / scale.mV[VY], minScale / scale.mV[VZ] );
976 min_scale_factor = llmax( min_scale_factor, cur_min_scale_factor ); 977 min_scale_factor = llmax( min_scale_factor, cur_min_scale_factor );
977 } 978 }
978 } 979 }
@@ -1266,8 +1267,7 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto
1266 1267
1267 F32 denom = axis * dir_local; 1268 F32 denom = axis * dir_local;
1268 F32 desired_delta_size = is_approx_zero(denom) ? 0.f : (delta_local_mag / denom); // in meters 1269 F32 desired_delta_size = is_approx_zero(denom) ? 0.f : (delta_local_mag / denom); // in meters
1269 F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, 1270 F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, gHippoLimits->getMinPrimScale(), gHippoLimits->getMaxPrimScale());
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
@@ -1990,7 +1990,7 @@ F32 LLManipScale::partToMinScale( S32 part, const LLBBox &bbox ) const
1990 min_extent = bbox_extents.mV[i]; 1990 min_extent = bbox_extents.mV[i];
1991 } 1991 }
1992 } 1992 }
1993 F32 min_scale_factor = bbox_extents.magVec() * MIN_PRIM_SCALE / min_extent; 1993 F32 min_scale_factor = bbox_extents.magVec() * gHippoLimits->getMinPrimScale() / min_extent;
1994 1994
1995 if (getUniform()) 1995 if (getUniform())
1996 { 1996 {
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 28ec16c..ed54c58 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
@@ -655,15 +655,15 @@
655 </text> 655 </text>
656 <spinner bottom_delta="-20" decimal_digits="3" follows="left|top" height="16" 656 <spinner bottom_delta="-20" decimal_digits="3" follows="left|top" height="16"
657 increment="0.01" initial_val="0" label="X" label_width="10" left="10" 657 increment="0.01" initial_val="0" label="X" label_width="10" left="10"
658 min_val="0.01" mouse_opaque="true" name="Scale X" 658 mouse_opaque="true" name="Scale X"
659 text_enabled_color="1, 1, 1, 1" width="96" /> 659 text_enabled_color="1, 1, 1, 1" width="96" />
660 <spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16" 660 <spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16"
661 increment="0.01" initial_val="0" label="Y" label_width="10" left="10" 661 increment="0.01" initial_val="0" label="Y" label_width="10" left="10"
662 min_val="0.01" mouse_opaque="true" name="Scale Y" 662 mouse_opaque="true" name="Scale Y"
663 text_enabled_color="1, 1, 1, 1" width="96" /> 663 text_enabled_color="1, 1, 1, 1" width="96" />
664 <spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16" 664 <spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16"
665 increment="0.01" initial_val="0" label="Z" label_width="10" left="10" 665 increment="0.01" initial_val="0" label="Z" label_width="10" left="10"
666 min_val="0.01" mouse_opaque="true" name="Scale Z" 666 mouse_opaque="true" name="Scale Z"
667 text_enabled_color="1, 1, 1, 1" width="96" /> 667 text_enabled_color="1, 1, 1, 1" width="96" />
668 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 668 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
669 bottom_delta="-16" drop_shadow_visible="true" follows="left|top" 669 bottom_delta="-16" drop_shadow_visible="true" follows="left|top"