Opensim - detect and use various configuration limits which might be different from SL, by ArminW
parent
39bc019612
commit
87dd359b1c
|
|
@ -63,7 +63,10 @@ const F32 CUT_MAX = 1.f;
|
|||
const F32 MIN_CUT_DELTA = 0.02f;
|
||||
|
||||
const F32 HOLLOW_MIN = 0.f;
|
||||
const F32 HOLLOW_MAX = 0.95f;
|
||||
// <AW: opensim-limits>
|
||||
//const F32 HOLLOW_MAX = 0.95f;
|
||||
const F32 HOLLOW_MAX = 0.99f;
|
||||
// <AW: opensim-limits>
|
||||
const F32 HOLLOW_MAX_SQUARE = 0.7f;
|
||||
|
||||
const F32 TWIST_MIN = -1.f;
|
||||
|
|
@ -71,11 +74,16 @@ const F32 TWIST_MAX = 1.f;
|
|||
|
||||
const F32 RATIO_MIN = 0.f;
|
||||
const F32 RATIO_MAX = 2.f; // Tom Y: Inverted sense here: 0 = top taper, 2 = bottom taper
|
||||
|
||||
const F32 HOLE_X_MIN= 0.05f;
|
||||
// <AW: opensim-limits>
|
||||
//const F32 HOLE_X_MIN= 0.05f;
|
||||
const F32 HOLE_X_MIN= 0.01f;
|
||||
// <AW: opensim-limits>
|
||||
const F32 HOLE_X_MAX= 1.0f;
|
||||
|
||||
const F32 HOLE_Y_MIN= 0.05f;
|
||||
// <AW: opensim-limits>
|
||||
//const F32 HOLE_Y_MIN= 0.05f;
|
||||
const F32 HOLE_Y_MIN= 0.01f;
|
||||
// <AW: opensim-limits>
|
||||
const F32 HOLE_Y_MAX= 0.5f;
|
||||
|
||||
const F32 SHEAR_MIN = -0.5f;
|
||||
|
|
|
|||
|
|
@ -29,14 +29,25 @@
|
|||
#include "v3math.h"
|
||||
#include "m4math.h"
|
||||
#include "llquaternion.h"
|
||||
|
||||
const F32 MAX_OBJECT_Z = 4096.f; // should match REGION_HEIGHT_METERS, Pre-havok4: 768.f
|
||||
// <AW: opensim-limits>
|
||||
//const F32 MAX_OBJECT_Z = 4096.f; // should match REGION_HEIGHT_METERS, Pre-havok4: 768.f
|
||||
//const F32 DEFAULT_MAX_PRIM_SCALE = 64.f;
|
||||
//const F32 DEFAULT_MAX_PRIM_SCALE_NO_MESH = 10.f;
|
||||
//const F32 MIN_PRIM_SCALE = 0.01f;
|
||||
//const F32 MAX_PRIM_SCALE = 65536.f; // something very high but not near FLT_MAX
|
||||
const F32 SL_MAX_OBJECT_Z = 4096.f;
|
||||
const F32 MIN_OBJECT_Z = -256.f;
|
||||
const F32 DEFAULT_MAX_PRIM_SCALE = 64.f;
|
||||
const F32 DEFAULT_MAX_PRIM_SCALE_NO_MESH = 10.f;
|
||||
const F32 MIN_PRIM_SCALE = 0.01f;
|
||||
const F32 MAX_PRIM_SCALE = 65536.f; // something very high but not near FLT_MAX
|
||||
const F32 SL_DEFAULT_MAX_PRIM_SCALE = 64.f;
|
||||
const F32 SL_DEFAULT_MAX_PRIM_SCALE_NO_MESH = 10.f;
|
||||
const F32 SL_MIN_PRIM_SCALE = 0.01f;
|
||||
const F32 SL_MAX_PRIM_SCALE = 65536.f; // something very high but not near FLT_MAX
|
||||
|
||||
const F32 OS_MAX_OBJECT_Z = 10000.f;
|
||||
const F32 OS_MIN_OBJECT_Z = -256.f;
|
||||
const F32 OS_DEFAULT_MAX_PRIM_SCALE = 256.f;
|
||||
const F32 OS_MIN_PRIM_SCALE = 0.001f;
|
||||
const F32 OS_MAX_PRIM_SCALE = 65536.f; // something very high but not near FLT_MAX
|
||||
// <AW: opensim-limits>
|
||||
class LLXform
|
||||
{
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -60,7 +60,15 @@ const F32 OBJECT_TWIST_LINEAR_MIN = -180.f;
|
|||
const F32 OBJECT_TWIST_LINEAR_MAX = 180.f;
|
||||
const F32 OBJECT_TWIST_LINEAR_INC = 9.f;
|
||||
|
||||
const F32 OBJECT_MIN_HOLE_SIZE = 0.05f;
|
||||
// <AW: opensim-limits>
|
||||
//const F32 OBJECT_MIN_HOLE_SIZE = 0.05f;
|
||||
const F32 SL_OBJECT_MAX_HOLLOW_SIZE = 95.f;
|
||||
const F32 OS_OBJECT_MAX_HOLLOW_SIZE = 99.f;
|
||||
|
||||
const F32 SL_OBJECT_MIN_HOLE_SIZE = 0.05f;
|
||||
const F32 OS_OBJECT_MIN_HOLE_SIZE = 0.01f;
|
||||
// </AW: opensim-limits>
|
||||
|
||||
const F32 OBJECT_MAX_HOLE_SIZE_X = 1.0f;
|
||||
const F32 OBJECT_MAX_HOLE_SIZE_Y = 0.5f;
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,15 @@ extern const F32 OBJECT_TWIST_LINEAR_MIN;
|
|||
extern const F32 OBJECT_TWIST_LINEAR_MAX;
|
||||
extern const F32 OBJECT_TWIST_LINEAR_INC;
|
||||
|
||||
extern const F32 OBJECT_MIN_HOLE_SIZE;
|
||||
// <AW: opensim-limits>
|
||||
//extern const F32 OBJECT_MIN_HOLE_SIZE;
|
||||
extern const F32 SL_OBJECT_MAX_HOLLOW_SIZE;
|
||||
extern const F32 OS_OBJECT_MAX_HOLLOW_SIZE;
|
||||
|
||||
extern const F32 SL_OBJECT_MIN_HOLE_SIZE;
|
||||
extern const F32 OS_OBJECT_MIN_HOLE_SIZE;
|
||||
// </AW: opensim-limits>
|
||||
|
||||
extern const F32 OBJECT_MAX_HOLE_SIZE_X;
|
||||
extern const F32 OBJECT_MAX_HOLE_SIZE_Y;
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,9 @@
|
|||
#include "llviewernetwork.h"
|
||||
#include "glod/glod.h"
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
// <AW: opensim-limits>
|
||||
#include "llworld.h"
|
||||
// </AW: opensim-limits>
|
||||
|
||||
const S32 SLM_SUPPORTED_VERSION = 2;
|
||||
|
||||
|
|
@ -3210,7 +3212,12 @@ void LLModelPreview::rebuildUploadData()
|
|||
}
|
||||
}
|
||||
|
||||
F32 max_import_scale = DEFAULT_MAX_PRIM_SCALE/max_scale;
|
||||
|
||||
// <AW: opensim-limits>
|
||||
//F32 max_import_scale = DEFAULT_MAX_PRIM_SCALE/max_scale;
|
||||
F32 region_max_prim_scale = LLWorld::getInstance()->getRegionMaxPrimScale();
|
||||
F32 max_import_scale = region_max_prim_scale/max_scale;
|
||||
// </AW: opensim-limits>
|
||||
|
||||
scale_spinner->setMaxValue(max_import_scale);
|
||||
|
||||
|
|
|
|||
|
|
@ -95,11 +95,17 @@ F32 get_default_max_prim_scale(bool is_flora)
|
|||
if (gMeshRepo.meshRezEnabled() &&
|
||||
!is_flora)
|
||||
{
|
||||
return DEFAULT_MAX_PRIM_SCALE;
|
||||
// <AW: opensim-limits>
|
||||
// return DEFAULT_MAX_PRIM_SCALE;
|
||||
return LLWorld::getInstance()->getRegionMaxPrimScale();
|
||||
// </AW: opensim-limits>
|
||||
}
|
||||
else
|
||||
{
|
||||
return DEFAULT_MAX_PRIM_SCALE_NO_MESH;
|
||||
{
|
||||
// <AW: opensim-limits>
|
||||
// return DEFAULT_MAX_PRIM_SCALE_NO_MESH;
|
||||
return LLWorld::getInstance()->getRegionMaxPrimScaleNoMesh();
|
||||
// </AW: opensim-limits>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -975,8 +981,12 @@ void LLManipScale::dragCorner( S32 x, S32 y )
|
|||
mInSnapRegime = FALSE;
|
||||
}
|
||||
|
||||
F32 max_scale_factor = get_default_max_prim_scale() / MIN_PRIM_SCALE;
|
||||
F32 min_scale_factor = MIN_PRIM_SCALE / get_default_max_prim_scale();
|
||||
// <AW: opensim-limits>
|
||||
// F32 max_scale_factor = get_default_max_prim_scale() / MIN_PRIM_SCALE;
|
||||
// F32 min_scale_factor = MIN_PRIM_SCALE / get_default_max_prim_scale();
|
||||
F32 max_scale_factor = LLWorld::getInstance()->getRegionMaxPrimScale() / LLWorld::getInstance()->getRegionMinPrimScale();
|
||||
F32 min_scale_factor = LLWorld::getInstance()->getRegionMinPrimScale() / LLWorld::getInstance()->getRegionMaxPrimScale();
|
||||
// </AW: opensim-limits>
|
||||
|
||||
// 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();
|
||||
|
|
@ -990,8 +1000,10 @@ void LLManipScale::dragCorner( S32 x, S32 y )
|
|||
|
||||
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] );
|
||||
// <AW: opensim-limits>
|
||||
// F32 cur_min_scale_factor = llmax( MIN_PRIM_SCALE / scale.mV[VX], MIN_PRIM_SCALE / scale.mV[VY], MIN_PRIM_SCALE / scale.mV[VZ] );
|
||||
F32 cur_min_scale_factor = llmax( LLWorld::getInstance()->getRegionMinPrimScale() / scale.mV[VX], LLWorld::getInstance()->getRegionMinPrimScale() / scale.mV[VY], LLWorld::getInstance()->getRegionMinPrimScale() / scale.mV[VZ] );
|
||||
// </AW: opensim-limits>
|
||||
min_scale_factor = llmax( min_scale_factor, cur_min_scale_factor );
|
||||
}
|
||||
}
|
||||
|
|
@ -1285,7 +1297,10 @@ 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, get_default_max_prim_scale(LLPickInfo::isFlora(cur)));
|
||||
// <AW: opensim-limits>
|
||||
// F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, get_default_max_prim_scale(LLPickInfo::isFlora(cur)));
|
||||
F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, LLWorld::getInstance()->getRegionMinPrimScale(), get_default_max_prim_scale(LLPickInfo::isFlora(cur)));
|
||||
// </AW: opensim-limits>
|
||||
// propagate scale constraint back to position offset
|
||||
desired_delta_size = desired_scale - selectNode->mSavedScale.mV[axis_index]; // propagate constraint back to position
|
||||
|
||||
|
|
@ -2008,8 +2023,10 @@ F32 LLManipScale::partToMinScale( S32 part, const LLBBox &bbox ) const
|
|||
min_extent = bbox_extents.mV[i];
|
||||
}
|
||||
}
|
||||
F32 min_scale_factor = bbox_extents.magVec() * MIN_PRIM_SCALE / min_extent;
|
||||
|
||||
// <AW: opensim-limits>
|
||||
// F32 min_scale_factor = bbox_extents.magVec() * MIN_PRIM_SCALE / min_extent;
|
||||
F32 min_scale_factor = bbox_extents.magVec() * LLWorld::getInstance()->getRegionMinPrimScale() / min_extent;
|
||||
// </AW: opensim-limits>
|
||||
if (getUniform())
|
||||
{
|
||||
min_scale_factor *= 0.5f;
|
||||
|
|
|
|||
|
|
@ -736,11 +736,16 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
|
|||
}
|
||||
|
||||
// For safety, cap heights where objects can be dragged
|
||||
if (new_position_global.mdV[VZ] > MAX_OBJECT_Z)
|
||||
// <AW: opensim-limits>
|
||||
// if (new_position_global.mdV[VZ] > MAX_OBJECT_Z)
|
||||
// {
|
||||
// new_position_global.mdV[VZ] = MAX_OBJECT_Z;
|
||||
// }
|
||||
if (new_position_global.mdV[VZ] > LLWorld::getInstance()->getRegionMaxHeight())
|
||||
{
|
||||
new_position_global.mdV[VZ] = MAX_OBJECT_Z;
|
||||
new_position_global.mdV[VZ] = LLWorld::getInstance()->getRegionMaxHeight();
|
||||
}
|
||||
|
||||
// </AW: opensim-limits>
|
||||
// Grass is always drawn on the ground, so clamp its position to the ground
|
||||
if (object->getPCode() == LL_PCODE_LEGACY_GRASS)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -343,7 +343,8 @@ LLPanelObject::LLPanelObject()
|
|||
mHasParamClipboard(FALSE),
|
||||
mHasFlexiParam(FALSE),
|
||||
mHasSculptParam(FALSE),
|
||||
mHasLightParam(FALSE)
|
||||
mHasLightParam(FALSE),
|
||||
mLimitsNeedUpdate(true) // <AW: opensim-limits>
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -353,6 +354,33 @@ LLPanelObject::~LLPanelObject()
|
|||
// Children all cleaned up by default view destructor.
|
||||
}
|
||||
|
||||
// <AW: opensim-limits>
|
||||
void LLPanelObject::updateLimits()
|
||||
{
|
||||
mLimitsNeedUpdate = false;
|
||||
|
||||
mRegionMaxHeight = LLWorld::getInstance()->getRegionMaxHeight();
|
||||
mCtrlPosZ->setMaxValue(mRegionMaxHeight);
|
||||
|
||||
|
||||
mMinScale = LLWorld::getInstance()->getRegionMinPrimScale();
|
||||
mMaxScale = LLWorld::getInstance()->getRegionMaxPrimScale();
|
||||
mCtrlScaleX->setMinValue(mMinScale);
|
||||
mCtrlScaleX->setMaxValue(mMaxScale);
|
||||
mCtrlScaleY->setMinValue(mMinScale);
|
||||
mCtrlScaleY->setMaxValue(mMaxScale);
|
||||
mCtrlScaleZ->setMinValue(mMinScale);
|
||||
mCtrlScaleZ->setMaxValue(mMaxScale);
|
||||
|
||||
mMaxHollowSize = LLWorld::getInstance()->getRegionMaxHollowSize();
|
||||
mSpinHollow->setMaxValue(mMaxHollowSize);
|
||||
|
||||
mMinHoleSize = LLWorld::getInstance()->getRegionMinHoleSize();
|
||||
mSpinScaleX->setMinValue(mMinHoleSize);
|
||||
mSpinScaleY->setMinValue(mMinHoleSize);
|
||||
}
|
||||
// </AW: opensim-limits>
|
||||
|
||||
void LLPanelObject::getState( )
|
||||
{
|
||||
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
|
||||
|
|
@ -1048,11 +1076,14 @@ void LLPanelObject::getState( )
|
|||
case MI_RING:
|
||||
mSpinScaleX->set( scale_x );
|
||||
mSpinScaleY->set( scale_y );
|
||||
mSpinScaleX->setMinValue(mMinHoleSize);// <AW: opensim-limits>
|
||||
calcp->setVar(LLCalc::X_HOLE, scale_x);
|
||||
calcp->setVar(LLCalc::Y_HOLE, scale_y);
|
||||
mSpinScaleX->setMinValue(OBJECT_MIN_HOLE_SIZE);
|
||||
// mSpinScaleX->setMinValue(OBJECT_MIN_HOLE_SIZE);
|
||||
mSpinScaleX->setMinValue(mMinHoleSize);// <AW: opensim-limits>
|
||||
mSpinScaleX->setMaxValue(OBJECT_MAX_HOLE_SIZE_X);
|
||||
mSpinScaleY->setMinValue(OBJECT_MIN_HOLE_SIZE);
|
||||
// mSpinScaleY->setMinValue(OBJECT_MIN_HOLE_SIZE);
|
||||
mSpinScaleY->setMinValue(mMinHoleSize);// <AW: opensim-limits>
|
||||
mSpinScaleY->setMaxValue(OBJECT_MAX_HOLE_SIZE_Y);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -1098,7 +1129,8 @@ void LLPanelObject::getState( )
|
|||
#endif
|
||||
{
|
||||
mSpinHollow->setMinValue(0.f);
|
||||
mSpinHollow->setMaxValue(100.f);
|
||||
// mSpinHollow->setMaxValue(100.f);
|
||||
mSpinHollow->setMaxValue(mMaxHollowSize);// <AW: opensim-limits>
|
||||
}
|
||||
|
||||
// Update field enablement
|
||||
|
|
@ -1713,11 +1745,13 @@ void LLPanelObject::getVolumeParams(LLVolumeParams& volume_params)
|
|||
{
|
||||
scale_x = llclamp(
|
||||
scale_x,
|
||||
OBJECT_MIN_HOLE_SIZE,
|
||||
// OBJECT_MIN_HOLE_SIZE,
|
||||
mMinHoleSize,// <AW: opensim-limits>
|
||||
OBJECT_MAX_HOLE_SIZE_X);
|
||||
scale_y = llclamp(
|
||||
scale_y,
|
||||
OBJECT_MIN_HOLE_SIZE,
|
||||
// OBJECT_MIN_HOLE_SIZE,
|
||||
mMinHoleSize,// <AW: opensim-limits>
|
||||
OBJECT_MAX_HOLE_SIZE_Y);
|
||||
|
||||
// Limit radius offset, based on taper and hole size y.
|
||||
|
|
@ -1851,9 +1885,12 @@ void LLPanelObject::sendRotation(BOOL btn_down)
|
|||
// patch up for mesh, to be removed during real mesh merge -Zi
|
||||
F32 llpanelobject_max_prim_scale()
|
||||
{
|
||||
if(gAgent.getRegion()->getCapability("GetMesh").empty())
|
||||
return DEFAULT_MAX_PRIM_SCALE;
|
||||
return 64.f;
|
||||
// <AW: opensim-limits>
|
||||
// if(gAgent.getRegion()->getCapability("GetMesh").empty())
|
||||
// return DEFAULT_MAX_PRIM_SCALE;
|
||||
// return 64.f;
|
||||
return LLWorld::getInstance()->getRegionMaxPrimScale();
|
||||
// </AW: opensim-limits>
|
||||
}
|
||||
|
||||
// BUG: Make work with multiple objects
|
||||
|
|
@ -1862,9 +1899,14 @@ void LLPanelObject::sendScale(BOOL btn_down)
|
|||
if (mObject.isNull()) return;
|
||||
|
||||
// make sure not to send larger/smaller values than permitted -Zi
|
||||
LLVector3 newscale(llclamp(mCtrlScaleX->get(), MIN_PRIM_SCALE, llpanelobject_max_prim_scale()),
|
||||
llclamp(mCtrlScaleY->get(), MIN_PRIM_SCALE, llpanelobject_max_prim_scale()),
|
||||
llclamp(mCtrlScaleZ->get(), MIN_PRIM_SCALE, llpanelobject_max_prim_scale()));
|
||||
// <AW: opensim-limits>
|
||||
// LLVector3 newscale(llclamp(mCtrlScaleX->get(), MIN_PRIM_SCALE, llpanelobject_max_prim_scale()),
|
||||
// llclamp(mCtrlScaleY->get(), MIN_PRIM_SCALE, llpanelobject_max_prim_scale()),
|
||||
// llclamp(mCtrlScaleZ->get(), MIN_PRIM_SCALE, llpanelobject_max_prim_scale()));
|
||||
LLVector3 newscale(llclamp(mCtrlScaleX->get(), mMinScale, llpanelobject_max_prim_scale()),
|
||||
llclamp(mCtrlScaleY->get(), mMinScale, llpanelobject_max_prim_scale()),
|
||||
llclamp(mCtrlScaleZ->get(), mMinScale, llpanelobject_max_prim_scale()));
|
||||
// </AW: opensim-limits>
|
||||
|
||||
LLVector3 delta = newscale - mObject->getScale();
|
||||
if (delta.magVec() >= 0.00005f)
|
||||
|
|
@ -2016,6 +2058,13 @@ void LLPanelObject::sendSculpt()
|
|||
|
||||
void LLPanelObject::refresh()
|
||||
{
|
||||
// <AW: opensim-limits>
|
||||
if(mLimitsNeedUpdate)
|
||||
{
|
||||
updateLimits();
|
||||
}
|
||||
// </AW: opensim-limits>
|
||||
|
||||
getState();
|
||||
if (mObject.notNull() && mObject->isDead())
|
||||
{
|
||||
|
|
@ -2327,10 +2376,14 @@ void LLPanelObject::onPastePos(const LLSD& data)
|
|||
void LLPanelObject::onPasteSize(const LLSD& data)
|
||||
{
|
||||
if(mClipboardSize.isNull()) return;
|
||||
|
||||
mClipboardSize.mV[VX] = llclamp(mClipboardSize.mV[VX], MIN_PRIM_SCALE, llpanelobject_max_prim_scale());
|
||||
mClipboardSize.mV[VY] = llclamp(mClipboardSize.mV[VY], MIN_PRIM_SCALE, llpanelobject_max_prim_scale());
|
||||
mClipboardSize.mV[VZ] = llclamp(mClipboardSize.mV[VZ], MIN_PRIM_SCALE, llpanelobject_max_prim_scale());
|
||||
// <AW: opensim-limits>
|
||||
// mClipboardSize.mV[VX] = llclamp(mClipboardSize.mV[VX], MIN_PRIM_SCALE, llpanelobject_max_prim_scale());
|
||||
// mClipboardSize.mV[VY] = llclamp(mClipboardSize.mV[VY], MIN_PRIM_SCALE, llpanelobject_max_prim_scale());
|
||||
// mClipboardSize.mV[VZ] = llclamp(mClipboardSize.mV[VZ], MIN_PRIM_SCALE, llpanelobject_max_prim_scale());
|
||||
mClipboardSize.mV[VX] = llclamp(mClipboardSize.mV[VX], mMinScale, llpanelobject_max_prim_scale());
|
||||
mClipboardSize.mV[VY] = llclamp(mClipboardSize.mV[VY], mMinScale, llpanelobject_max_prim_scale());
|
||||
mClipboardSize.mV[VZ] = llclamp(mClipboardSize.mV[VZ], mMinScale, llpanelobject_max_prim_scale());
|
||||
// </AW: opensim-limits>
|
||||
|
||||
mCtrlScaleX->set( mClipboardSize.mV[VX] );
|
||||
mCtrlScaleY->set( mClipboardSize.mV[VY] );
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public:
|
|||
virtual void draw();
|
||||
virtual void clearCtrls();
|
||||
|
||||
void updateLimits();// <AW: opensim-limits>
|
||||
void refresh();
|
||||
|
||||
static bool precommitValidate(const LLSD& data);
|
||||
|
|
@ -126,10 +127,19 @@ protected:
|
|||
LLTextBox* mLabelCut;
|
||||
LLSpinCtrl* mSpinCutBegin;
|
||||
LLSpinCtrl* mSpinCutEnd;
|
||||
// <AW: opensim-limits>
|
||||
bool mLimitsNeedUpdate;
|
||||
F32 mRegionMaxHeight;
|
||||
|
||||
F32 mMinScale;
|
||||
F32 mMaxScale;
|
||||
|
||||
F32 mMaxHollowSize;
|
||||
// </AW: opensim-limits>
|
||||
LLTextBox* mLabelHollow;
|
||||
LLSpinCtrl* mSpinHollow;
|
||||
|
||||
F32 mMinHoleSize;// <AW: opensim-limits>
|
||||
LLTextBox* mLabelHoleType;
|
||||
LLComboBox* mComboHoleType;
|
||||
|
||||
|
|
|
|||
|
|
@ -627,11 +627,16 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
|
|||
}
|
||||
|
||||
// For safety, cap heights where objects can be dragged
|
||||
if (grab_point_global.mdV[VZ] > MAX_OBJECT_Z)
|
||||
// <AW: opensim-limits>
|
||||
// if (grab_point_global.mdV[VZ] > MAX_OBJECT_Z)
|
||||
// {
|
||||
// grab_point_global.mdV[VZ] = MAX_OBJECT_Z;
|
||||
// }
|
||||
if (grab_point_global.mdV[VZ] > LLWorld::getInstance()->getRegionMaxHeight())
|
||||
{
|
||||
grab_point_global.mdV[VZ] = MAX_OBJECT_Z;
|
||||
grab_point_global.mdV[VZ] = LLWorld::getInstance()->getRegionMaxHeight();
|
||||
}
|
||||
|
||||
// </AW: opensim-limits>
|
||||
grab_point_global = LLWorld::getInstance()->clipToVisibleRegions(mDragStartPointGlobal, grab_point_global);
|
||||
// propagate constrained grab point back to grab offset
|
||||
mGrabHiddenOffsetFromCamera = grab_point_global - gAgentCamera.getCameraPositionGlobal();
|
||||
|
|
|
|||
|
|
@ -91,7 +91,8 @@ LLWorld::LLWorld() :
|
|||
mLastPacketsIn(0),
|
||||
mLastPacketsOut(0),
|
||||
mLastPacketsLost(0),
|
||||
mSpaceTimeUSec(0)
|
||||
mSpaceTimeUSec(0),
|
||||
mLimitsNeedRefresh(true)// <AW: opensim-limits>
|
||||
{
|
||||
for (S32 i = 0; i < 8; i++)
|
||||
{
|
||||
|
|
@ -127,7 +128,44 @@ void LLWorld::destroyClass()
|
|||
}
|
||||
LLViewerPartSim::getInstance()->destroyClass();
|
||||
}
|
||||
// <AW: opensim-limits>
|
||||
void LLWorld::refreshLimits()
|
||||
{
|
||||
if(!LLGridManager::getInstance())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mLimitsNeedRefresh = false;
|
||||
|
||||
if(LLGridManager::getInstance()->isInOpenSim())
|
||||
{
|
||||
//llmath/xform.h
|
||||
mRegionMaxHeight = OS_MAX_OBJECT_Z; //llmath/xform.h
|
||||
mRegionMinPrimScale = OS_MIN_PRIM_SCALE;
|
||||
mRegionMaxPrimScale = OS_DEFAULT_MAX_PRIM_SCALE;
|
||||
mRegionMaxPrimScaleNoMesh = OS_DEFAULT_MAX_PRIM_SCALE;// no restrictions here
|
||||
mRegionMaxHollowSize = OS_OBJECT_MAX_HOLLOW_SIZE;
|
||||
mRegionMinHoleSize = OS_OBJECT_MIN_HOLE_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
//llmath/xform.h
|
||||
mRegionMaxHeight = SL_MAX_OBJECT_Z;
|
||||
mRegionMinPrimScale = SL_MIN_PRIM_SCALE;
|
||||
mRegionMaxPrimScale = SL_DEFAULT_MAX_PRIM_SCALE;
|
||||
mRegionMaxPrimScaleNoMesh = SL_DEFAULT_MAX_PRIM_SCALE_NO_MESH;
|
||||
//llprimitive/llprimitive.*
|
||||
mRegionMaxHollowSize = SL_OBJECT_MAX_HOLLOW_SIZE;
|
||||
mRegionMinHoleSize = SL_OBJECT_MIN_HOLE_SIZE;
|
||||
}
|
||||
LL_DEBUGS("OS_SETTINGS") << "RegionMaxHeight " << mRegionMaxHeight << llendl;
|
||||
LL_DEBUGS("OS_SETTINGS") << "RegionMinPrimScale " << mRegionMinPrimScale << llendl;
|
||||
LL_DEBUGS("OS_SETTINGS") << "RegionMaxPrimScale " << mRegionMaxPrimScale << llendl;
|
||||
LL_DEBUGS("OS_SETTINGS") << "RegionMaxHollowSize " << mRegionMaxHollowSize << llendl;
|
||||
LL_DEBUGS("OS_SETTINGS") << "RegionMinHoleSize " << mRegionMinHoleSize << llendl;
|
||||
}
|
||||
// </AW: opensim-limits>
|
||||
|
||||
LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host)
|
||||
{
|
||||
|
|
@ -219,6 +257,13 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host)
|
|||
|
||||
updateWaterObjects();
|
||||
|
||||
// <AW: opensim-limits>
|
||||
if(mLimitsNeedRefresh)
|
||||
{
|
||||
refreshLimits();
|
||||
}
|
||||
// </AW: opensim-limits>
|
||||
|
||||
return regionp;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ public:
|
|||
LLWorld();
|
||||
void destroyClass();
|
||||
|
||||
void refreshLimits();// <AW: opensim-limits>
|
||||
LLViewerRegion* addRegion(const U64 ®ion_handle, const LLHost &host);
|
||||
// safe to call if already present, does the "right thing" if
|
||||
// hosts are same, or if hosts are different, etc...
|
||||
|
|
@ -113,8 +114,15 @@ public:
|
|||
// region X and Y size in meters
|
||||
F32 getRegionWidthInMeters() const { return mWidthInMeters; }
|
||||
F32 getRegionMinHeight() const { return -mWidthInMeters; }
|
||||
F32 getRegionMaxHeight() const { return MAX_OBJECT_Z; }
|
||||
|
||||
// <AW: opensim-limits>
|
||||
// F32 getRegionMaxHeight() const { return MAX_OBJECT_Z; }
|
||||
F32 getRegionMaxHeight() const { return mRegionMaxHeight; }
|
||||
F32 getRegionMinPrimScale() const { return mRegionMinPrimScale; }
|
||||
F32 getRegionMaxPrimScale() const { return mRegionMaxPrimScale; }
|
||||
F32 getRegionMaxPrimScaleNoMesh() const { return mRegionMaxPrimScaleNoMesh; }
|
||||
F32 getRegionMaxHollowSize() const { return mRegionMaxHollowSize; }
|
||||
F32 getRegionMinHoleSize() const { return mRegionMinHoleSize; }
|
||||
// </AW: opensim-limits>
|
||||
void updateRegions(F32 max_update_time);
|
||||
void updateVisibilities();
|
||||
void updateParticles();
|
||||
|
|
@ -169,7 +177,15 @@ private:
|
|||
static const F32 mScale;
|
||||
|
||||
static const F32 mWidthInMeters;
|
||||
|
||||
// <AW: opensim-limits>
|
||||
F32 mRegionMaxHeight;
|
||||
F32 mRegionMinPrimScale;
|
||||
F32 mRegionMaxPrimScale;
|
||||
F32 mRegionMaxPrimScaleNoMesh;
|
||||
F32 mRegionMaxHollowSize;
|
||||
F32 mRegionMinHoleSize;
|
||||
bool mLimitsNeedRefresh;
|
||||
// </AW: opensim-limits>
|
||||
F32 mLandFarClip; // Far clip distance for land.
|
||||
LLPatchVertexArray mLandPatch;
|
||||
S32 mLastPacketsIn;
|
||||
|
|
|
|||
Loading…
Reference in New Issue