Detect mesh enabled regions and allow 64 meter prims - slight hack, because it will go away with mesh merge anyway.
parent
822be3e70b
commit
60ffba543d
|
|
@ -56,6 +56,7 @@
|
|||
#include "llhudrender.h"
|
||||
#include "llworld.h"
|
||||
#include "v2math.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llvoavatar.h"
|
||||
|
||||
|
||||
|
|
@ -823,6 +824,14 @@ void LLManipScale::drag( S32 x, S32 y )
|
|||
gAgentCamera.clearFocusObject();
|
||||
}
|
||||
|
||||
// patch up for mesh, to be removed during real mesh merge -Zi
|
||||
F32 llmanipscale_max_prim_scale()
|
||||
{
|
||||
if(gAgent.getRegion()->getCapability("GetMesh").empty())
|
||||
return DEFAULT_MAX_PRIM_SCALE;
|
||||
return 64.f;
|
||||
}
|
||||
|
||||
// Scale around the
|
||||
void LLManipScale::dragCorner( S32 x, S32 y )
|
||||
{
|
||||
|
|
@ -950,8 +959,8 @@ void LLManipScale::dragCorner( S32 x, S32 y )
|
|||
mInSnapRegime = FALSE;
|
||||
}
|
||||
|
||||
F32 max_scale_factor = DEFAULT_MAX_PRIM_SCALE / MIN_PRIM_SCALE;
|
||||
F32 min_scale_factor = MIN_PRIM_SCALE / DEFAULT_MAX_PRIM_SCALE;
|
||||
F32 max_scale_factor = llmanipscale_max_prim_scale() / MIN_PRIM_SCALE;
|
||||
F32 min_scale_factor = MIN_PRIM_SCALE / llmanipscale_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();
|
||||
|
|
@ -963,7 +972,7 @@ void LLManipScale::dragCorner( S32 x, S32 y )
|
|||
{
|
||||
const LLVector3& scale = selectNode->mSavedScale;
|
||||
|
||||
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] );
|
||||
F32 cur_max_scale_factor = llmin( llmanipscale_max_prim_scale() / scale.mV[VX], llmanipscale_max_prim_scale() / scale.mV[VY], llmanipscale_max_prim_scale() / 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] );
|
||||
|
|
@ -1260,7 +1269,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);
|
||||
F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, llmanipscale_max_prim_scale());
|
||||
// propagate scale constraint back to position offset
|
||||
desired_delta_size = desired_scale - selectNode->mSavedScale.mV[axis_index]; // propagate constraint back to position
|
||||
|
||||
|
|
@ -1960,7 +1969,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 / max_extent;
|
||||
max_scale_factor = bbox_extents.magVec() * llmanipscale_max_prim_scale() / max_extent;
|
||||
|
||||
if (getUniform())
|
||||
{
|
||||
|
|
@ -1975,7 +1984,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;
|
||||
F32 min_extent = llmanipscale_max_prim_scale();
|
||||
for (U32 i = VX; i <= VZ; i++)
|
||||
{
|
||||
if (bbox_extents.mV[i] > 0.f && bbox_extents.mV[i] < min_extent)
|
||||
|
|
|
|||
|
|
@ -1928,13 +1928,23 @@ 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;
|
||||
}
|
||||
|
||||
// BUG: Make work with multiple objects
|
||||
void LLPanelObject::sendScale(BOOL btn_down)
|
||||
{
|
||||
if (mObject.isNull()) return;
|
||||
|
||||
LLVector3 newscale(mCtrlScaleX->get(), mCtrlScaleY->get(), mCtrlScaleZ->get());
|
||||
// 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()));
|
||||
|
||||
LLVector3 delta = newscale - mObject->getScale();
|
||||
if (delta.magVec() >= 0.00005f)
|
||||
|
|
@ -2381,9 +2391,9 @@ void LLPanelObject::onPasteSize(const LLSD& data)
|
|||
{
|
||||
if(mClipboardSize.isNull()) return;
|
||||
|
||||
mClipboardSize.mV[VX] = llclamp(mClipboardSize.mV[VX], MIN_PRIM_SCALE, DEFAULT_MAX_PRIM_SCALE);
|
||||
mClipboardSize.mV[VY] = llclamp(mClipboardSize.mV[VY], MIN_PRIM_SCALE, DEFAULT_MAX_PRIM_SCALE);
|
||||
mClipboardSize.mV[VZ] = llclamp(mClipboardSize.mV[VZ], MIN_PRIM_SCALE, DEFAULT_MAX_PRIM_SCALE);
|
||||
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());
|
||||
|
||||
mCtrlScaleX->set( mClipboardSize.mV[VX] );
|
||||
mCtrlScaleY->set( mClipboardSize.mV[VY] );
|
||||
|
|
|
|||
|
|
@ -1405,6 +1405,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
|
|||
|
||||
capabilityNames.append("GetDisplayNames");
|
||||
capabilityNames.append("GetTexture");
|
||||
capabilityNames.append("GetMesh"); // detect mesh
|
||||
capabilityNames.append("GroupProposalBallot");
|
||||
capabilityNames.append("HomeLocation");
|
||||
capabilityNames.append("LandResources");
|
||||
|
|
|
|||
|
|
@ -1429,13 +1429,21 @@ void LLVOAvatar::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax)
|
|||
}
|
||||
}
|
||||
|
||||
// patch up for mesh, to be removed during real mesh merge -Zi
|
||||
F32 llvoavatar_max_prim_scale()
|
||||
{
|
||||
if(gAgent.getRegion()->getCapability("GetMesh").empty())
|
||||
return DEFAULT_MAX_PRIM_SCALE;
|
||||
return 64.f;
|
||||
}
|
||||
|
||||
void LLVOAvatar::getSpatialExtents(LLVector3& newMin, LLVector3& newMax)
|
||||
{
|
||||
LLVector3 buffer(0.25f, 0.25f, 0.25f);
|
||||
LLVector3 pos = getRenderPosition();
|
||||
newMin = pos - buffer;
|
||||
newMax = pos + buffer;
|
||||
float max_attachment_span = DEFAULT_MAX_PRIM_SCALE * 5.0f;
|
||||
float max_attachment_span = llvoavatar_max_prim_scale() * 5.0f;
|
||||
|
||||
//stretch bounding box by joint positions
|
||||
for (polymesh_map_t::iterator i = mMeshes.begin(); i != mMeshes.end(); ++i)
|
||||
|
|
|
|||
|
|
@ -1517,7 +1517,7 @@ even though the user gets a free copy.
|
|||
label_width="10"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
max_val="10"
|
||||
max_val="64"
|
||||
min_val="0.01"
|
||||
name="Scale X"
|
||||
text_enabled_color="White"
|
||||
|
|
@ -1542,7 +1542,7 @@ even though the user gets a free copy.
|
|||
label_width="10"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
max_val="10"
|
||||
max_val="64"
|
||||
min_val="0.01"
|
||||
name="Scale Y"
|
||||
text_enabled_color="White"
|
||||
|
|
@ -1567,7 +1567,7 @@ even though the user gets a free copy.
|
|||
label_width="10"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
max_val="10"
|
||||
max_val="64"
|
||||
min_val="0.01"
|
||||
name="Scale Z"
|
||||
text_enabled_color="White"
|
||||
|
|
|
|||
Loading…
Reference in New Issue