mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
replace objects scale clamp by a more readable clamp. Simplify GroupResize and let rescale factors < 1 also be checked for size limits, Set new scales directly not checking them again.
This commit is contained in:
@@ -3073,18 +3073,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (ParentGroup.Scene != null)
|
||||
{
|
||||
scale.X = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.X));
|
||||
scale.Y = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Y));
|
||||
scale.Z = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Z));
|
||||
|
||||
float minsize = ParentGroup.Scene.m_minNonphys;
|
||||
float maxsize = ParentGroup.Scene.m_maxNonphys;
|
||||
if (pa != null && pa.IsPhysical)
|
||||
{
|
||||
scale.X = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.X));
|
||||
scale.Y = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Y));
|
||||
scale.Z = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Z));
|
||||
}
|
||||
{
|
||||
minsize = ParentGroup.Scene.m_minPhys;
|
||||
maxsize = ParentGroup.Scene.m_maxPhys;
|
||||
}
|
||||
scale.X = Util.Clamp(scale.X, minsize, maxsize);
|
||||
scale.Y = Util.Clamp(scale.Y, minsize, maxsize);
|
||||
scale.Z = Util.Clamp(scale.Z, minsize, maxsize);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale);
|
||||
|
||||
Scale = scale;
|
||||
|
||||
Reference in New Issue
Block a user