aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs60
1 files changed, 54 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index df4bd0d..0448c25 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3460,17 +3460,17 @@ namespace OpenSim.Region.Framework.Scenes
3460 /// <param name="scale"></param> 3460 /// <param name="scale"></param>
3461 public void GroupResize(Vector3 scale) 3461 public void GroupResize(Vector3 scale)
3462 { 3462 {
3463 scale.X = Math.Min(scale.X, Scene.m_maxNonphys); 3463 scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X));
3464 scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); 3464 scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y));
3465 scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys); 3465 scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z));
3466 3466
3467 PhysicsActor pa = m_rootPart.PhysActor; 3467 PhysicsActor pa = m_rootPart.PhysActor;
3468 3468
3469 if (pa != null && pa.IsPhysical) 3469 if (pa != null && pa.IsPhysical)
3470 { 3470 {
3471 scale.X = Math.Min(scale.X, Scene.m_maxPhys); 3471 scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X));
3472 scale.Y = Math.Min(scale.Y, Scene.m_maxPhys); 3472 scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y));
3473 scale.Z = Math.Min(scale.Z, Scene.m_maxPhys); 3473 scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z));
3474 } 3474 }
3475 3475
3476 float x = (scale.X / RootPart.Scale.X); 3476 float x = (scale.X / RootPart.Scale.X);
@@ -3501,6 +3501,14 @@ namespace OpenSim.Region.Framework.Scenes
3501 y *= a; 3501 y *= a;
3502 z *= a; 3502 z *= a;
3503 } 3503 }
3504 else if (oldSize.X * x < m_scene.m_minPhys)
3505 {
3506 f = m_scene.m_minPhys / oldSize.X;
3507 a = f / x;
3508 x *= a;
3509 y *= a;
3510 z *= a;
3511 }
3504 3512
3505 if (oldSize.Y * y > m_scene.m_maxPhys) 3513 if (oldSize.Y * y > m_scene.m_maxPhys)
3506 { 3514 {
@@ -3510,6 +3518,14 @@ namespace OpenSim.Region.Framework.Scenes
3510 y *= a; 3518 y *= a;
3511 z *= a; 3519 z *= a;
3512 } 3520 }
3521 else if (oldSize.Y * y < m_scene.m_minPhys)
3522 {
3523 f = m_scene.m_minPhys / oldSize.Y;
3524 a = f / y;
3525 x *= a;
3526 y *= a;
3527 z *= a;
3528 }
3513 3529
3514 if (oldSize.Z * z > m_scene.m_maxPhys) 3530 if (oldSize.Z * z > m_scene.m_maxPhys)
3515 { 3531 {
@@ -3519,6 +3535,14 @@ namespace OpenSim.Region.Framework.Scenes
3519 y *= a; 3535 y *= a;
3520 z *= a; 3536 z *= a;
3521 } 3537 }
3538 else if (oldSize.Z * z < m_scene.m_minPhys)
3539 {
3540 f = m_scene.m_minPhys / oldSize.Z;
3541 a = f / z;
3542 x *= a;
3543 y *= a;
3544 z *= a;
3545 }
3522 } 3546 }
3523 else 3547 else
3524 { 3548 {
@@ -3530,6 +3554,14 @@ namespace OpenSim.Region.Framework.Scenes
3530 y *= a; 3554 y *= a;
3531 z *= a; 3555 z *= a;
3532 } 3556 }
3557 else if (oldSize.X * x < m_scene.m_minNonphys)
3558 {
3559 f = m_scene.m_minNonphys / oldSize.X;
3560 a = f / x;
3561 x *= a;
3562 y *= a;
3563 z *= a;
3564 }
3533 3565
3534 if (oldSize.Y * y > m_scene.m_maxNonphys) 3566 if (oldSize.Y * y > m_scene.m_maxNonphys)
3535 { 3567 {
@@ -3539,6 +3571,14 @@ namespace OpenSim.Region.Framework.Scenes
3539 y *= a; 3571 y *= a;
3540 z *= a; 3572 z *= a;
3541 } 3573 }
3574 else if (oldSize.Y * y < m_scene.m_minNonphys)
3575 {
3576 f = m_scene.m_minNonphys / oldSize.Y;
3577 a = f / y;
3578 x *= a;
3579 y *= a;
3580 z *= a;
3581 }
3542 3582
3543 if (oldSize.Z * z > m_scene.m_maxNonphys) 3583 if (oldSize.Z * z > m_scene.m_maxNonphys)
3544 { 3584 {
@@ -3548,6 +3588,14 @@ namespace OpenSim.Region.Framework.Scenes
3548 y *= a; 3588 y *= a;
3549 z *= a; 3589 z *= a;
3550 } 3590 }
3591 else if (oldSize.Z * z < m_scene.m_minNonphys)
3592 {
3593 f = m_scene.m_minNonphys / oldSize.Z;
3594 a = f / z;
3595 x *= a;
3596 y *= a;
3597 z *= a;
3598 }
3551 } 3599 }
3552 } 3600 }
3553 } 3601 }