refactor: replace scale limiting code with more elegant Math.Min calls
parent
2b68ac4ba3
commit
122745fe1c
|
@ -2846,12 +2846,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="scale"></param>
|
/// <param name="scale"></param>
|
||||||
public void Resize(Vector3 scale)
|
public void Resize(Vector3 scale)
|
||||||
{
|
{
|
||||||
if (scale.X > ParentGroup.Scene.m_maxNonphys)
|
scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxNonphys);
|
||||||
scale.X = ParentGroup.Scene.m_maxNonphys;
|
scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxNonphys);
|
||||||
if (scale.Y > ParentGroup.Scene.m_maxNonphys)
|
scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxNonphys);
|
||||||
scale.Y = ParentGroup.Scene.m_maxNonphys;
|
|
||||||
if (scale.Z > ParentGroup.Scene.m_maxNonphys)
|
|
||||||
scale.Z = ParentGroup.Scene.m_maxNonphys;
|
|
||||||
|
|
||||||
// m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale);
|
// m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale);
|
||||||
|
|
||||||
|
@ -2865,12 +2862,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (PhysActor.IsPhysical)
|
if (PhysActor.IsPhysical)
|
||||||
{
|
{
|
||||||
if (scale.X > ParentGroup.Scene.m_maxPhys)
|
scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxPhys);
|
||||||
scale.X = ParentGroup.Scene.m_maxPhys;
|
scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxPhys);
|
||||||
if (scale.Y > ParentGroup.Scene.m_maxPhys)
|
scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxPhys);
|
||||||
scale.Y = ParentGroup.Scene.m_maxPhys;
|
|
||||||
if (scale.Z > ParentGroup.Scene.m_maxPhys)
|
|
||||||
scale.Z = ParentGroup.Scene.m_maxPhys;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PhysActor.Size = scale;
|
PhysActor.Size = scale;
|
||||||
|
|
Loading…
Reference in New Issue