FIRE-8882: A better implementation of the switch, updated with Cron's most recent work on this, more to come.
parent
57e22b53f3
commit
1841bc69e6
|
|
@ -19703,5 +19703,18 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<integer>1</integer>
|
||||
</map>
|
||||
<!-- <FS:Zi> -->
|
||||
<!-- <FS:Cron> FIRE-8882 -->
|
||||
<key>FSSnapDomain</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Direction of snap lines (0 = outside of boundary, 1 = inside boundary)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<!-- </FS:Cron> -->
|
||||
</map>
|
||||
</llsd>
|
||||
|
|
|
|||
|
|
@ -112,6 +112,14 @@ public:
|
|||
LL_EDGE_MIN = LL_EDGE_NEGX_NEGY,
|
||||
LL_EDGE_MAX = LL_EDGE_POSZ_POSX
|
||||
} EManipPartRanges;
|
||||
|
||||
// <FS:Cron> FIRE-8882
|
||||
// For use in detecting the snap domain location
|
||||
typedef enum e_snap_domains {
|
||||
LL_SNAP_DOMAIN_OUTSIDE = 0,
|
||||
LL_SNAP_DOMAIN_INSIDE = 1
|
||||
} ESnapDomains;
|
||||
// </FS:Cron>
|
||||
public:
|
||||
static void rebuild(LLViewerObject* vobj);
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ const F32 COS_DELTA = cos( DELTA );
|
|||
const F32 MAX_MANIP_SELECT_DISTANCE = 100.f;
|
||||
const F32 SNAP_ANGLE_INCREMENT = 5.625f;
|
||||
const F32 SNAP_ANGLE_DETENTE = SNAP_ANGLE_INCREMENT;
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//const F32 SNAP_GUIDE_RADIUS_1 = 2.8f;
|
||||
//const F32 SNAP_GUIDE_RADIUS_2 = 2.4f;
|
||||
//const F32 SNAP_GUIDE_RADIUS_3 = 2.2f;
|
||||
|
|
@ -80,13 +80,10 @@ const F32 SNAP_ANGLE_DETENTE = SNAP_ANGLE_INCREMENT;
|
|||
//const F32 SNAP_GUIDE_RADIUS_5 = 2.05f;
|
||||
//const F32 SNAP_GUIDE_INNER_RADIUS = 2.f;
|
||||
const F32 SNAP_GUIDE_RING_RADIUS = 2.f;
|
||||
const F32 SNAP_GUIDE_TEXT_RADIUS = SNAP_GUIDE_RING_RADIUS + 0.2f;
|
||||
const F32 SNAP_GUIDE_RADIUS_1 = SNAP_GUIDE_RING_RADIUS - 0.8f;
|
||||
const F32 SNAP_GUIDE_RADIUS_2 = SNAP_GUIDE_RING_RADIUS - 0.4f;
|
||||
const F32 SNAP_GUIDE_RADIUS_3 = SNAP_GUIDE_RING_RADIUS - 0.2f;
|
||||
const F32 SNAP_GUIDE_RADIUS_4 = SNAP_GUIDE_RING_RADIUS - 0.1f;
|
||||
const F32 SNAP_GUIDE_RADIUS_5 = SNAP_GUIDE_RING_RADIUS - 0.05f;
|
||||
// </FS:CR>
|
||||
const F32 SNAP_GUIDE_RADIUS_STEP = 0.05f;
|
||||
const F32 SNAP_GUIDE_TEXT_RADIUS_INNER_DOMAIN = SNAP_GUIDE_RING_RADIUS + 0.2f;
|
||||
const F32 SNAP_GUIDE_TEXT_RADIUS_OUTER_DOMAIN = SNAP_GUIDE_RING_RADIUS + 0.1f;
|
||||
// </FS:Cron>
|
||||
const F32 AXIS_ONTO_CAM_TOLERANCE = cos( 80.f * DEG_TO_RAD );
|
||||
const F32 SELECTED_MANIPULATOR_SCALE = 1.05f;
|
||||
const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f;
|
||||
|
|
@ -425,10 +422,7 @@ BOOL LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
|
|||
LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_ROTATE);
|
||||
|
||||
// save selection center
|
||||
// <FS:CR> FIRE-8882
|
||||
//mRotationCenter = gAgent.getPosGlobalFromAgent( getPivotPoint() ); //LLSelectMgr::getInstance()->getSelectionCenterGlobal();
|
||||
mRotationCenter = gAgent.getPosGlobalFromAgent( getPivotPoint() );
|
||||
// </FS:CR>
|
||||
|
||||
mManipPart = (EManipPart)hit_part;
|
||||
LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter );
|
||||
|
|
@ -904,6 +898,20 @@ void LLManipRotate::renderSnapGuides()
|
|||
}
|
||||
gGL.popMatrix();
|
||||
|
||||
// <FS:Cron> FIRE-8882
|
||||
U32 snap_domain = gSavedSettings.getU32("FSSnapDomain");
|
||||
F32 tick_scale = 0.f;
|
||||
switch (snap_domain)
|
||||
{
|
||||
case LL_SNAP_DOMAIN_OUTSIDE:
|
||||
tick_scale = 1.f;
|
||||
break;
|
||||
case LL_SNAP_DOMAIN_INSIDE:
|
||||
tick_scale = -1.0f;
|
||||
break;
|
||||
}
|
||||
// </FS:Cron>
|
||||
|
||||
for (S32 i = 0; i < 64; i++)
|
||||
{
|
||||
BOOL render_text = TRUE;
|
||||
|
|
@ -925,38 +933,38 @@ void LLManipRotate::renderSnapGuides()
|
|||
F32 tick_length = 0.f;
|
||||
if (i % 16 == 0)
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_1 - SNAP_GUIDE_INNER_RADIUS);
|
||||
tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_1 - SNAP_GUIDE_RING_RADIUS);
|
||||
// </FS:CR>
|
||||
tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_STEP * tick_scale * 16.f);
|
||||
// </FS:Cron>
|
||||
}
|
||||
else if (i % 8 == 0)
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_2 - SNAP_GUIDE_INNER_RADIUS);
|
||||
tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_2 - SNAP_GUIDE_RING_RADIUS);
|
||||
// </FS:CR>
|
||||
tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_STEP * tick_scale * 8.f);
|
||||
// </FS:Cron>
|
||||
}
|
||||
else if (i % 4 == 0)
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_3 - SNAP_GUIDE_INNER_RADIUS);
|
||||
tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_3 - SNAP_GUIDE_RING_RADIUS);
|
||||
// </FS:CR>
|
||||
tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_STEP * tick_scale * 4.f);
|
||||
// </FS:Cron>
|
||||
}
|
||||
else if (i % 2 == 0)
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_4 - SNAP_GUIDE_INNER_RADIUS);
|
||||
tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_4 - SNAP_GUIDE_RING_RADIUS);
|
||||
// </FS:CR>
|
||||
tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_STEP * tick_scale * 2.f);
|
||||
// </FS:Cron>
|
||||
}
|
||||
else
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_5 - SNAP_GUIDE_INNER_RADIUS);
|
||||
tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_5 - SNAP_GUIDE_RING_RADIUS);
|
||||
// </FS:CR>
|
||||
tick_length = mRadiusMeters * (SNAP_GUIDE_RADIUS_STEP * tick_scale);
|
||||
// </FS:Cron>
|
||||
}
|
||||
|
||||
if (mCamEdgeOn)
|
||||
|
|
@ -997,15 +1005,23 @@ void LLManipRotate::renderSnapGuides()
|
|||
// </FS:CR>
|
||||
}
|
||||
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//text_point = outer_point + (projected_snap_axis * mRadiusMeters * 0.1f) * rot;
|
||||
text_point = ring_point + (projected_snap_axis * mRadiusMeters * (SNAP_GUIDE_TEXT_RADIUS - SNAP_GUIDE_RING_RADIUS)) * rot;
|
||||
switch (snap_domain)
|
||||
{
|
||||
case LL_SNAP_DOMAIN_OUTSIDE:
|
||||
text_point = ring_point + (projected_snap_axis * mRadiusMeters * (SNAP_GUIDE_TEXT_RADIUS_OUTER_DOMAIN - SNAP_GUIDE_RING_RADIUS)) * rot;
|
||||
break;
|
||||
case LL_SNAP_DOMAIN_INSIDE:
|
||||
text_point = ring_point + (projected_snap_axis * mRadiusMeters * (SNAP_GUIDE_TEXT_RADIUS_INNER_DOMAIN - SNAP_GUIDE_RING_RADIUS)) * rot;
|
||||
break;
|
||||
}
|
||||
|
||||
//gGL.vertex3fv(inner_point.mV);
|
||||
//gGL.vertex3fv(outer_point.mV);
|
||||
gGL.vertex3fv(ring_point.mV);
|
||||
gGL.vertex3fv(tip_point.mV);
|
||||
// </FS:CR>
|
||||
// </FS:Cron>
|
||||
}
|
||||
gGL.end();
|
||||
|
||||
|
|
@ -1578,10 +1594,18 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
|
|||
}
|
||||
}
|
||||
|
||||
// <FS:CR> FIRE-8882
|
||||
|
||||
// <FS:Cron> FIRE-8882
|
||||
U32 snap_domain = gSavedSettings.getU32("FSSnapDomain");
|
||||
|
||||
//if (snap_plane > 0)
|
||||
if (snap_plane == SP_BETWEEN_PLANES)
|
||||
// </FS:CR>
|
||||
if
|
||||
(
|
||||
(snap_domain == LL_SNAP_DOMAIN_OUTSIDE && snap_plane != SP_BETWEEN_PLANES)
|
||||
||
|
||||
(snap_domain == LL_SNAP_DOMAIN_INSIDE && snap_plane == SP_BETWEEN_PLANES)
|
||||
)
|
||||
// </FS:Cron>
|
||||
{
|
||||
LLVector3 cam_at_axis;
|
||||
if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
|
||||
|
|
@ -1715,7 +1739,20 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
|
|||
return LLQuaternion::DEFAULT;
|
||||
}
|
||||
|
||||
if (gSavedSettings.getBOOL("SnapEnabled") && projected_mouse.magVec() <= SNAP_GUIDE_RING_RADIUS * mRadiusMeters)
|
||||
// <FS:Cron> FIRE-8882
|
||||
U32 snap_domain = gSavedSettings.getU32("FSSnapDomain");
|
||||
|
||||
//if (gSavedSettings.getBOOL("SnapEnabled") && projected_mouse.magVec() > SNAP_GUIDE_INNER_RADIUS * mRadiusMeters)
|
||||
if
|
||||
(
|
||||
gSavedSettings.getBOOL("SnapEnabled") &&
|
||||
(
|
||||
(snap_domain == LL_SNAP_DOMAIN_OUTSIDE && projected_mouse.magVec() > SNAP_GUIDE_RING_RADIUS * mRadiusMeters)
|
||||
||
|
||||
(snap_domain == LL_SNAP_DOMAIN_INSIDE && projected_mouse.magVec() <= SNAP_GUIDE_RING_RADIUS * mRadiusMeters)
|
||||
)
|
||||
)
|
||||
// </FS:Cron>
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
//if (!mInSnapRegime)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ const F32 MAX_MANIP_SELECT_DISTANCE_SQUARED = 11.f * 11.f;
|
|||
const F32 SNAP_GUIDE_SCREEN_OFFSET = 0.05f;
|
||||
const F32 SNAP_GUIDE_SCREEN_LENGTH = 0.7f;
|
||||
// <FS:CR> FIRE-8882
|
||||
const F32 SNAP_GUIDE_CORNER_DRAG_TEXT_POSITION = 1.3f;
|
||||
const F32 SNAP_GUIDE_CORNER_DRAG_TEXT_POSITION = 1.3f; // Used then the snapping domain is set to inside
|
||||
// </FS:CR>
|
||||
const F32 SELECTED_MANIPULATOR_SCALE = 1.2f;
|
||||
const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f;
|
||||
|
|
@ -823,12 +823,12 @@ void LLManipScale::renderAxisHandle( const LLVector3& start, const LLVector3& en
|
|||
// General scale call
|
||||
void LLManipScale::drag( S32 x, S32 y )
|
||||
{
|
||||
if( (LL_FACE_MIN <= (S32)mManipPart)
|
||||
if( (LL_FACE_MIN <= (S32)mManipPart)
|
||||
&& ((S32)mManipPart <= LL_FACE_MAX) )
|
||||
{
|
||||
dragFace( x, y );
|
||||
}
|
||||
else if( (LL_CORNER_MIN <= (S32)mManipPart)
|
||||
else if( (LL_CORNER_MIN <= (S32)mManipPart)
|
||||
&& ((S32)mManipPart <= LL_CORNER_MAX) )
|
||||
{
|
||||
dragCorner( x, y );
|
||||
|
|
@ -939,14 +939,25 @@ void LLManipScale::dragCorner( S32 x, S32 y )
|
|||
F32 max_scale = partToMaxScale(mManipPart, bbox);
|
||||
F32 min_scale = partToMinScale(mManipPart, bbox);
|
||||
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled");
|
||||
//if (snap_enabled && dist_from_scale_line_1 > mSnapRegimeOffset * snap_dir_dot_mouse_offset1)
|
||||
//{
|
||||
|
||||
U32 snap_domain = gSavedSettings.getU32("FSSnapDomain");
|
||||
|
||||
if (gSavedSettings.getBOOL("SnapEnabled"))
|
||||
{
|
||||
if (dist_from_scale_line_1 <= mSnapRegimeOffset * snap_dir_dot_mouse_offset1 && dist_from_scale_line_1 > 0.f)
|
||||
// </FS:CR>
|
||||
F32 regime_dist1 = mSnapRegimeOffset * snap_dir_dot_mouse_offset1;
|
||||
F32 regime_dist2 = mSnapRegimeOffset * snap_dir_dot_mouse_offset2;
|
||||
|
||||
if
|
||||
(
|
||||
(snap_domain == LL_SNAP_DOMAIN_OUTSIDE && dist_from_scale_line_1 > regime_dist1)
|
||||
||
|
||||
(snap_domain == LL_SNAP_DOMAIN_INSIDE && dist_from_scale_line_1 <= regime_dist1 && dist_from_scale_line_1 > 0.f)
|
||||
)
|
||||
// </FS:Cron>
|
||||
{
|
||||
mInSnapRegime = TRUE;
|
||||
LLVector3 projected_drag_pos = mouse_on_plane1 - (dist_from_scale_line_1 / snap_dir_dot_mouse_offset1) * mSnapGuideDir1;
|
||||
|
|
@ -964,10 +975,15 @@ void LLManipScale::dragCorner( S32 x, S32 y )
|
|||
scale_factor *= 0.5f;
|
||||
}
|
||||
}
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//else if (snap_enabled && dist_from_scale_line_2 > mSnapRegimeOffset * snap_dir_dot_mouse_offset2)
|
||||
else if (dist_from_scale_line_2 <= mSnapRegimeOffset * snap_dir_dot_mouse_offset2 && dist_from_scale_line_2 > 0.f)
|
||||
// </FS:CR>
|
||||
else if
|
||||
(
|
||||
(snap_domain == LL_SNAP_DOMAIN_OUTSIDE && dist_from_scale_line_2 > regime_dist2)
|
||||
||
|
||||
(snap_domain == LL_SNAP_DOMAIN_INSIDE && dist_from_scale_line_2 <= regime_dist2 && dist_from_scale_line_2 > 0.f)
|
||||
)
|
||||
// </FS:Cron>
|
||||
{
|
||||
mInSnapRegime = TRUE;
|
||||
LLVector3 projected_drag_pos = mouse_on_plane2 - (dist_from_scale_line_2 / snap_dir_dot_mouse_offset2) * mSnapGuideDir2;
|
||||
|
|
@ -1165,12 +1181,19 @@ void LLManipScale::dragFace( S32 x, S32 y )
|
|||
F32 dist_from_scale_line = dist_vec(scale_center_to_mouse, (mouse_on_scale_line - mScaleCenter));
|
||||
F32 dist_along_scale_line = scale_center_to_mouse * mScaleDir;
|
||||
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled");
|
||||
U32 snap_domain = gSavedSettings.getU32("FSSnapDomain");
|
||||
|
||||
//if (snap_enabled && dist_from_scale_line > mSnapRegimeOffset)
|
||||
if (gSavedSettings.getBOOL("SnapEnabled") && dist_from_scale_line <= mSnapRegimeOffset)
|
||||
// </FS:CR>
|
||||
if (gSavedSettings.getBOOL("SnapEnabled") &&
|
||||
(
|
||||
(snap_domain == LL_SNAP_DOMAIN_OUTSIDE && dist_from_scale_line > mSnapRegimeOffset)
|
||||
||
|
||||
(snap_domain == LL_SNAP_DOMAIN_INSIDE && dist_from_scale_line <= mSnapRegimeOffset)
|
||||
)
|
||||
)
|
||||
// </FS:Cron>
|
||||
{
|
||||
mInSnapRegime = TRUE;
|
||||
|
||||
|
|
@ -1698,6 +1721,10 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
|
|||
|
||||
S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing);
|
||||
|
||||
// <FS:Cron> FIRE-8882
|
||||
U32 snap_domain = gSavedSettings.getU32("FSSnapDomain");
|
||||
// </FS:Cron>
|
||||
|
||||
for (pass = 0; pass < 3; pass++)
|
||||
{
|
||||
LLColor4 tick_color = setupSnapGuideRenderPass(pass);
|
||||
|
|
@ -1719,10 +1746,19 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
|
|||
continue;
|
||||
}
|
||||
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//F32 tick_scale = 1.f;
|
||||
F32 tick_scale = -0.8f;
|
||||
// </FS:CR>
|
||||
F32 tick_scale = 0.f;
|
||||
switch (snap_domain)
|
||||
{
|
||||
case LL_SNAP_DOMAIN_OUTSIDE:
|
||||
tick_scale = 1.f;
|
||||
break;
|
||||
case LL_SNAP_DOMAIN_INSIDE:
|
||||
tick_scale = -0.8f;
|
||||
break;
|
||||
}
|
||||
// </FS:Cron>
|
||||
for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
|
||||
{
|
||||
if (fmodf((F32)(i + sub_div_offset_1), division_level) == 0.f)
|
||||
|
|
@ -1755,10 +1791,19 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
|
|||
continue;
|
||||
}
|
||||
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//F32 tick_scale = 1.f;
|
||||
F32 tick_scale = -0.8f;
|
||||
// </FS:CR>
|
||||
F32 tick_scale = 0.f;
|
||||
switch (snap_domain)
|
||||
{
|
||||
case LL_SNAP_DOMAIN_OUTSIDE:
|
||||
tick_scale = 1.f;
|
||||
break;
|
||||
case LL_SNAP_DOMAIN_INSIDE:
|
||||
tick_scale = -0.8f;
|
||||
break;
|
||||
}
|
||||
// </FS:Cron>
|
||||
for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
|
||||
{
|
||||
if (fmodf((F32)(i + sub_div_offset_2), division_level) == 0.f)
|
||||
|
|
@ -1777,7 +1822,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
|
|||
gGL.end();
|
||||
}
|
||||
|
||||
// render tick labels
|
||||
// render near-side tick labels
|
||||
start_tick = -(llmin(ticks_from_scale_center_1, num_ticks_per_side1));
|
||||
stop_tick = llmin(max_ticks1, num_ticks_per_side1);
|
||||
|
||||
|
|
@ -1787,37 +1832,47 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
|
|||
|
||||
for (S32 i = start_tick; i <= stop_tick; i++)
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
//F32 tick_scale = 1.f;
|
||||
// </FS:CR>
|
||||
F32 tick_scale = 1.f;
|
||||
F32 alpha = grid_alpha * (1.f - (0.5f * ((F32)llabs(i) / (F32)num_ticks_per_side1)));
|
||||
LLVector3 tick_pos = drag_point + (mScaleDir * (mScaleSnapUnit1 / max_subdivisions * (F32)i - grid_offset1));
|
||||
|
||||
// <FS:CR> FIRE-8882
|
||||
//for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
|
||||
if (fmodf((F32)(i + label_sub_div_offset_1), (max_subdivisions / llmin(sGridMaxSubdivisionLevel, getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, tick_label_spacing)))) == 0.f)
|
||||
// </FS:CR>
|
||||
// <FS:Cron> FIRE-8882
|
||||
switch (snap_domain)
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
//if (fmodf((F32)(i + label_sub_div_offset_1), division_level) == 0.f)
|
||||
//{
|
||||
// break;
|
||||
//}
|
||||
//tick_scale *= 0.7f;
|
||||
case LL_SNAP_DOMAIN_OUTSIDE:
|
||||
// </FS:Cron>
|
||||
for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
|
||||
{
|
||||
if (fmodf((F32)(i + label_sub_div_offset_1), division_level) == 0.f)
|
||||
{
|
||||
break;
|
||||
}
|
||||
tick_scale *= 0.7f;
|
||||
}
|
||||
// <FS:Cron> FIRE-8882
|
||||
tick_scale += 1.f;
|
||||
break;
|
||||
case LL_SNAP_DOMAIN_INSIDE:
|
||||
tick_scale = SNAP_GUIDE_CORNER_DRAG_TEXT_POSITION;
|
||||
break;
|
||||
}
|
||||
// </FS:Cron>
|
||||
|
||||
if (fmodf((F32)(i + label_sub_div_offset_1), (max_subdivisions / llmin(sGridMaxSubdivisionLevel, getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, tick_label_spacing)))) == 0.f)
|
||||
{
|
||||
// <FS:Cron> FIRE-8882
|
||||
//LLVector3 text_origin = tick_pos +
|
||||
// (mSnapGuideDir1 * mSnapRegimeOffset * (1.f + tick_scale));
|
||||
LLVector3 text_origin;
|
||||
if ( (LL_FACE_MIN <= (S32)mManipPart) && ((S32)mManipPart <= LL_FACE_MAX) ) // Face drag
|
||||
if (snap_domain == LL_SNAP_DOMAIN_INSIDE && (LL_FACE_MIN <= (S32)mManipPart) && ((S32)mManipPart <= LL_FACE_MAX) ) // Face drag
|
||||
{
|
||||
text_origin = tick_pos; // Just off center is a good place for face ticks.
|
||||
}
|
||||
else // Corner drag
|
||||
else // Corner drag, or not in the inner snap domain - assuming that means that means the outer domain for now.
|
||||
{
|
||||
text_origin = tick_pos + (mSnapGuideDir1 * (mSnapRegimeOffset * SNAP_GUIDE_CORNER_DRAG_TEXT_POSITION));
|
||||
text_origin = tick_pos + (mSnapGuideDir1 * (mSnapRegimeOffset * tick_scale));
|
||||
}
|
||||
//if (fmodf((F32)(i + label_sub_div_offset_1), (max_subdivisions / llmin(sGridMaxSubdivisionLevel, getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, tick_label_spacing)))) == 0.f)
|
||||
//{
|
||||
// LLVector3 text_origin = tick_pos +
|
||||
// (mSnapGuideDir1 * mSnapRegimeOffset * (1.f + tick_scale));
|
||||
// </FS:CR>
|
||||
// </FS:Cron>
|
||||
|
||||
EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode();
|
||||
F32 tick_val;
|
||||
|
|
@ -1849,37 +1904,46 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
|
|||
}
|
||||
}
|
||||
|
||||
// label ticks on opposite side, only can happen in scaling modes that effect more than one axis.
|
||||
// label ticks on opposite side, only can happen in scaling modes that effect more than one axis and when the object's axis don't have the same scale. A differing scale indicates both conditions.
|
||||
if (mScaleSnapUnit2 != mScaleSnapUnit1)
|
||||
{
|
||||
start_tick = -(llmin(ticks_from_scale_center_2, num_ticks_per_side2));
|
||||
stop_tick = llmin(max_ticks2, num_ticks_per_side2);
|
||||
for (S32 i = start_tick; i <= stop_tick; i++)
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
//F32 tick_scale = 1.f;
|
||||
// </FS:CR>
|
||||
F32 tick_scale = 1.f;
|
||||
F32 alpha = grid_alpha * (1.f - (0.5f * ((F32)llabs(i) / (F32)num_ticks_per_side2)));
|
||||
LLVector3 tick_pos = drag_point + (mScaleDir * (mScaleSnapUnit2 / max_subdivisions * (F32)i - grid_offset2));
|
||||
|
||||
// <FS:CR> FIRE-8882
|
||||
//for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
|
||||
//{
|
||||
// if (fmodf((F32)(i + label_sub_div_offset_2), division_level) == 0.f)
|
||||
// {
|
||||
// break;
|
||||
// }
|
||||
// tick_scale *= 0.7f;
|
||||
//}
|
||||
// </FS:CR>
|
||||
// <FS:Cron> FIRE-8882
|
||||
switch (snap_domain)
|
||||
{
|
||||
case LL_SNAP_DOMAIN_OUTSIDE:
|
||||
// </FS:Cron>
|
||||
for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
|
||||
{
|
||||
if (fmodf((F32)(i + label_sub_div_offset_2), division_level) == 0.f)
|
||||
{
|
||||
break;
|
||||
}
|
||||
tick_scale *= 0.7f;
|
||||
}
|
||||
// <FS:Cron> FIRE-8882
|
||||
tick_scale += 1.f;
|
||||
break;
|
||||
case LL_SNAP_DOMAIN_INSIDE:
|
||||
tick_scale = SNAP_GUIDE_CORNER_DRAG_TEXT_POSITION;
|
||||
break;
|
||||
}
|
||||
// </FS:Cron>
|
||||
|
||||
if (fmodf((F32)(i + label_sub_div_offset_2), (max_subdivisions / llmin(max_subdivisions, getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2, tick_label_spacing)))) == 0.f)
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//LLVector3 text_origin = tick_pos +
|
||||
// (mSnapGuideDir2 * mSnapRegimeOffset * (1.f + tick_scale));
|
||||
LLVector3 text_origin = tick_pos + (mSnapGuideDir2 * (mSnapRegimeOffset * SNAP_GUIDE_CORNER_DRAG_TEXT_POSITION)); // No test needed, as this code area only activates in the Corner Drag case. That is until such a time as edge scaling is resurrected...
|
||||
// </FS:CR>
|
||||
LLVector3 text_origin = tick_pos + (mSnapGuideDir2 * mSnapRegimeOffset * tick_scale); // No test needed, as this code area only activates in the Corner Drag case. That is until such a time as edge scaling is resurrected...
|
||||
// </FS:Cron>
|
||||
|
||||
EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode();
|
||||
F32 tick_val;
|
||||
|
|
|
|||
|
|
@ -556,10 +556,15 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
|
|||
|
||||
if (gSavedSettings.getBOOL("SnapEnabled"))
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
U32 snap_domain = gSavedSettings.getU32("FSSnapDomain");
|
||||
//if (off_axis_magnitude > mSnapOffsetMeters)
|
||||
if (off_axis_magnitude <= mSnapOffsetMeters)
|
||||
// </FS:CR>
|
||||
if (
|
||||
(snap_domain == LL_SNAP_DOMAIN_OUTSIDE && off_axis_magnitude > mSnapOffsetMeters)
|
||||
||
|
||||
(snap_domain == LL_SNAP_DOMAIN_INSIDE && off_axis_magnitude <= mSnapOffsetMeters)
|
||||
)
|
||||
// </FS:Cron>
|
||||
{
|
||||
mInSnapRegime = TRUE;
|
||||
LLVector3 mouse_down_offset(mDragCursorStartGlobal - mDragSelectionStartGlobal);
|
||||
|
|
@ -1280,6 +1285,10 @@ void LLManipTranslate::renderSnapGuides()
|
|||
S32 sub_div_offset = llround(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale);
|
||||
S32 num_ticks_per_side = llmax(1, llfloor(0.5f * guide_size_meters / smallest_grid_unit_scale));
|
||||
|
||||
// <FS:Cron> FIRE-8882
|
||||
U32 snap_domain = gSavedSettings.getU32("FSSnapDomain");
|
||||
// </FS:Cron>
|
||||
|
||||
LLGLDepthTest gls_depth(GL_FALSE);
|
||||
|
||||
for (S32 pass = 0; pass < 3; pass++)
|
||||
|
|
@ -1326,11 +1335,20 @@ void LLManipTranslate::renderSnapGuides()
|
|||
// add in off-axis offset
|
||||
tick_start += (mSnapOffsetAxis * mSnapOffsetMeters);
|
||||
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//BOOL is_sub_tick = FALSE;
|
||||
//F32 tick_scale = 1.f;
|
||||
F32 tick_scale = -0.8f;
|
||||
// </FS:CR>
|
||||
F32 tick_scale = 0.f;
|
||||
switch (snap_domain)
|
||||
{
|
||||
case LL_SNAP_DOMAIN_OUTSIDE:
|
||||
tick_scale = 1.f;
|
||||
break;
|
||||
case LL_SNAP_DOMAIN_INSIDE:
|
||||
tick_scale = -0.8f;
|
||||
break;
|
||||
}
|
||||
// </FS:Cron>
|
||||
for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
|
||||
{
|
||||
if (fmodf((F32)(i + sub_div_offset), division_level) == 0.f)
|
||||
|
|
@ -1423,24 +1441,28 @@ void LLManipTranslate::renderSnapGuides()
|
|||
|
||||
if (fmodf((F32)(i + sub_div_offset), (max_subdivisions / llmin(sGridMaxSubdivisionLevel, getSubdivisionLevel(tick_pos, translate_axis, getMinGridScale(), tick_label_spacing)))) == 0.f)
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
// <FS:Cron> FIRE-8882
|
||||
//F32 snap_offset_meters;
|
||||
F32 snap_offset_meters = 0.f;
|
||||
|
||||
//if (mSnapOffsetAxis * LLViewerCamera::getInstance()->getUpAxis() > 0.f)
|
||||
//{
|
||||
// snap_offset_meters = mSnapOffsetMeters;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// snap_offset_meters = -mSnapOffsetMeters;
|
||||
//}
|
||||
// </FS:CR>
|
||||
if (snap_domain == LL_SNAP_DOMAIN_OUTSIDE) {
|
||||
// </FS:Cron>
|
||||
if (mSnapOffsetAxis * LLViewerCamera::getInstance()->getUpAxis() > 0.f)
|
||||
{
|
||||
snap_offset_meters = mSnapOffsetMeters;
|
||||
}
|
||||
else
|
||||
{
|
||||
snap_offset_meters = -mSnapOffsetMeters;
|
||||
}
|
||||
// <FS:Cron> FIRE-8882
|
||||
}
|
||||
//else case assuming snap_domain == LL_SNAP_DOMAIN_INSIDE for now. This results in snap_offset_meters == 0.f and the third term of the text_origin assignment becoming zero as an expected consequence. ~Cron Stardust
|
||||
// </FS:Cron>
|
||||
|
||||
LLVector3 text_origin = selection_center +
|
||||
// <FS:CR> FIRE-8882
|
||||
//(translate_axis * ((smallest_grid_unit_scale * (F32)i) - offset_nearest_grid_unit)) +
|
||||
// (mSnapOffsetAxis * snap_offset_meters * (1.f + tick_scale));
|
||||
(translate_axis * ((smallest_grid_unit_scale * (F32)i) - offset_nearest_grid_unit));
|
||||
// </FS:CR>
|
||||
(translate_axis * ((smallest_grid_unit_scale * (F32)i) - offset_nearest_grid_unit)) +
|
||||
(mSnapOffsetAxis * snap_offset_meters * (1.f + tick_scale));
|
||||
|
||||
LLVector3 tick_offset = (tick_pos - mGridOrigin) * ~mGridRotation;
|
||||
F32 offset_val = 0.5f * tick_offset.mV[ARROW_TO_AXIS[mManipPart]] / getMinGridScale();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater
|
||||
legacy_header_height="18"
|
||||
height="170"
|
||||
height="200"
|
||||
layout="topleft"
|
||||
name="build options floater"
|
||||
help_topic="build_options_floater"
|
||||
|
|
@ -54,6 +54,50 @@
|
|||
name="GridCrossSection"
|
||||
top_pad="5"
|
||||
width="200" />
|
||||
<!-- <FS:Cron> FIRE-8882 -->
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
text_color="White"
|
||||
follows="left|top"
|
||||
height="0"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
top_pad="10"
|
||||
name="Snap on"
|
||||
width="80">
|
||||
Snap on:
|
||||
</text>
|
||||
<radio_group
|
||||
control_name="FSSnapDomain"
|
||||
left="90"
|
||||
height="20"
|
||||
layout="topleft"
|
||||
name="FSSnapDomain"
|
||||
top_pad="0"
|
||||
width="180">
|
||||
<radio_item
|
||||
label="Inside"
|
||||
tool_tip="Snaps set to inside of snapping boundary"
|
||||
name="radio inside"
|
||||
value="1"
|
||||
layout="topleft"
|
||||
left="0"
|
||||
top_delta="20"
|
||||
width="90"
|
||||
height="16" />
|
||||
<radio_item
|
||||
label="Outside"
|
||||
tool_tip="Snaps set to outside of snapping boundary (classic behavior)"
|
||||
name="radio outside"
|
||||
value="0"
|
||||
layout="topleft"
|
||||
left_pad="-10"
|
||||
top_delta="0"
|
||||
width="75"
|
||||
height="16" />
|
||||
</radio_group>
|
||||
<!-- </FS:Cron> -->
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
|
|
|
|||
Loading…
Reference in New Issue