SH-512 [REGRESSION] Linden trees scale up to 200m on Mesh regions

SH-943 10 meters maximum Prim/Mesh size in latest Mesh Viewers
meow-7.2.2
leyla_linden 2011-02-16 15:24:11 -08:00
parent 79e8ef7f51
commit f41f7cb607
3 changed files with 14 additions and 11 deletions

View File

@ -85,9 +85,11 @@ const LLManip::EManipPart MANIPULATOR_IDS[NUM_MANIPULATORS] =
};
F32 get_default_max_prim_scale()
F32 get_default_max_prim_scale(bool is_flora)
{
if (gSavedSettings.getBOOL("MeshEnabled"))
// a bit of a hack, but if it's foilage, we don't want to use the
// new larger scale which would result in giant trees and grass
if (gSavedSettings.getBOOL("MeshEnabled") && !is_flora)
{
return DEFAULT_MAX_PRIM_SCALE;
}
@ -960,9 +962,9 @@ void LLManipScale::dragCorner( S32 x, S32 y )
{
mInSnapRegime = FALSE;
}
F32 max_scale_factor = DEFAULT_MAX_PRIM_SCALE_NO_MESH / MIN_PRIM_SCALE;
F32 min_scale_factor = MIN_PRIM_SCALE / DEFAULT_MAX_PRIM_SCALE_NO_MESH;
F32 max_scale_factor = get_default_max_prim_scale() / MIN_PRIM_SCALE;
F32 min_scale_factor = MIN_PRIM_SCALE / get_default_max_prim_scale();
// find max and min scale factors that will make biggest object hit max absolute scale and smallest object hit min absolute scale
for (LLObjectSelection::iterator iter = mObjectSelection->begin();
@ -974,7 +976,7 @@ void LLManipScale::dragCorner( S32 x, S32 y )
{
const LLVector3& scale = selectNode->mSavedScale;
F32 cur_max_scale_factor = llmin( DEFAULT_MAX_PRIM_SCALE_NO_MESH / scale.mV[VX], DEFAULT_MAX_PRIM_SCALE_NO_MESH / scale.mV[VY], DEFAULT_MAX_PRIM_SCALE_NO_MESH / scale.mV[VZ] );
F32 cur_max_scale_factor = llmin( get_default_max_prim_scale(LLPickInfo::isFlora(cur)) / scale.mV[VX], get_default_max_prim_scale(LLPickInfo::isFlora(cur)) / scale.mV[VY], get_default_max_prim_scale(LLPickInfo::isFlora(cur)) / scale.mV[VZ] );
max_scale_factor = llmin( max_scale_factor, cur_max_scale_factor );
F32 cur_min_scale_factor = llmax( MIN_PRIM_SCALE / scale.mV[VX], MIN_PRIM_SCALE / scale.mV[VY], MIN_PRIM_SCALE / scale.mV[VZ] );
@ -1271,7 +1273,7 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto
F32 denom = axis * dir_local;
F32 desired_delta_size = is_approx_zero(denom) ? 0.f : (delta_local_mag / denom); // in meters
F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, DEFAULT_MAX_PRIM_SCALE_NO_MESH);
F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, get_default_max_prim_scale(LLPickInfo::isFlora(cur)));
// propagate scale constraint back to position offset
desired_delta_size = desired_scale - selectNode->mSavedScale.mV[axis_index]; // propagate constraint back to position
@ -1971,7 +1973,7 @@ F32 LLManipScale::partToMaxScale( S32 part, const LLBBox &bbox ) const
max_extent = bbox_extents.mV[i];
}
}
max_scale_factor = bbox_extents.magVec() * DEFAULT_MAX_PRIM_SCALE_NO_MESH / max_extent;
max_scale_factor = bbox_extents.magVec() * get_default_max_prim_scale() / max_extent;
if (getUniform())
{
@ -1986,7 +1988,7 @@ F32 LLManipScale::partToMinScale( S32 part, const LLBBox &bbox ) const
{
LLVector3 bbox_extents = unitVectorToLocalBBoxExtent( partToUnitVector( part ), bbox );
bbox_extents.abs();
F32 min_extent = DEFAULT_MAX_PRIM_SCALE_NO_MESH;
F32 min_extent = get_default_max_prim_scale();
for (U32 i = VX; i <= VZ; i++)
{
if (bbox_extents.mV[i] > 0.f && bbox_extents.mV[i] < min_extent)

View File

@ -40,7 +40,7 @@
#include "llbbox.h"
F32 get_default_max_prim_scale();
F32 get_default_max_prim_scale(bool is_flora = false);
class LLToolComposite;
class LLColor4;

View File

@ -1934,7 +1934,8 @@ void LLPanelObject::refresh()
getChildView("Physics Density")->setVisible(enable_mesh);
getChildView("Physics Restitution")->setVisible(enable_mesh);
F32 max_scale = DEFAULT_MAX_PRIM_SCALE_NO_MESH;
F32 max_scale = get_default_max_prim_scale(LLPickInfo::isFlora(mObject));
getChild<LLSpinCtrl>("Scale X")->setMaxValue(max_scale);
getChild<LLSpinCtrl>("Scale Y")->setMaxValue(max_scale);
getChild<LLSpinCtrl>("Scale Z")->setMaxValue(max_scale);