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 eee53d7..fcb1571 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3450,17 +3450,17 @@ namespace OpenSim.Region.Framework.Scenes
3450 /// <param name="scale"></param> 3450 /// <param name="scale"></param>
3451 public void GroupResize(Vector3 scale) 3451 public void GroupResize(Vector3 scale)
3452 { 3452 {
3453 scale.X = Math.Min(scale.X, Scene.m_maxNonphys); 3453 scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X));
3454 scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); 3454 scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y));
3455 scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys); 3455 scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z));
3456 3456
3457 PhysicsActor pa = m_rootPart.PhysActor; 3457 PhysicsActor pa = m_rootPart.PhysActor;
3458 3458
3459 if (pa != null && pa.IsPhysical) 3459 if (pa != null && pa.IsPhysical)
3460 { 3460 {
3461 scale.X = Math.Min(scale.X, Scene.m_maxPhys); 3461 scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X));
3462 scale.Y = Math.Min(scale.Y, Scene.m_maxPhys); 3462 scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y));
3463 scale.Z = Math.Min(scale.Z, Scene.m_maxPhys); 3463 scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z));
3464 } 3464 }
3465 3465
3466 float x = (scale.X / RootPart.Scale.X); 3466 float x = (scale.X / RootPart.Scale.X);
@@ -3491,6 +3491,14 @@ namespace OpenSim.Region.Framework.Scenes
3491 y *= a; 3491 y *= a;
3492 z *= a; 3492 z *= a;
3493 } 3493 }
3494 else if (oldSize.X * x < m_scene.m_minPhys)
3495 {
3496 f = m_scene.m_minPhys / oldSize.X;
3497 a = f / x;
3498 x *= a;
3499 y *= a;
3500 z *= a;
3501 }
3494 3502
3495 if (oldSize.Y * y > m_scene.m_maxPhys) 3503 if (oldSize.Y * y > m_scene.m_maxPhys)
3496 { 3504 {
@@ -3500,6 +3508,14 @@ namespace OpenSim.Region.Framework.Scenes
3500 y *= a; 3508 y *= a;
3501 z *= a; 3509 z *= a;
3502 } 3510 }
3511 else if (oldSize.Y * y < m_scene.m_minPhys)
3512 {
3513 f = m_scene.m_minPhys / oldSize.Y;
3514 a = f / y;
3515 x *= a;
3516 y *= a;
3517 z *= a;
3518 }
3503 3519
3504 if (oldSize.Z * z > m_scene.m_maxPhys) 3520 if (oldSize.Z * z > m_scene.m_maxPhys)
3505 { 3521 {
@@ -3509,6 +3525,14 @@ namespace OpenSim.Region.Framework.Scenes
3509 y *= a; 3525 y *= a;
3510 z *= a; 3526 z *= a;
3511 } 3527 }
3528 else if (oldSize.Z * z < m_scene.m_minPhys)
3529 {
3530 f = m_scene.m_minPhys / oldSize.Z;
3531 a = f / z;
3532 x *= a;
3533 y *= a;
3534 z *= a;
3535 }
3512 } 3536 }
3513 else 3537 else
3514 { 3538 {
@@ -3520,6 +3544,14 @@ namespace OpenSim.Region.Framework.Scenes
3520 y *= a; 3544 y *= a;
3521 z *= a; 3545 z *= a;
3522 } 3546 }
3547 else if (oldSize.X * x < m_scene.m_minNonphys)
3548 {
3549 f = m_scene.m_minNonphys / oldSize.X;
3550 a = f / x;
3551 x *= a;
3552 y *= a;
3553 z *= a;
3554 }
3523 3555
3524 if (oldSize.Y * y > m_scene.m_maxNonphys) 3556 if (oldSize.Y * y > m_scene.m_maxNonphys)
3525 { 3557 {
@@ -3529,6 +3561,14 @@ namespace OpenSim.Region.Framework.Scenes
3529 y *= a; 3561 y *= a;
3530 z *= a; 3562 z *= a;
3531 } 3563 }
3564 else if (oldSize.Y * y < m_scene.m_minNonphys)
3565 {
3566 f = m_scene.m_minNonphys / oldSize.Y;
3567 a = f / y;
3568 x *= a;
3569 y *= a;
3570 z *= a;
3571 }
3532 3572
3533 if (oldSize.Z * z > m_scene.m_maxNonphys) 3573 if (oldSize.Z * z > m_scene.m_maxNonphys)
3534 { 3574 {
@@ -3538,6 +3578,14 @@ namespace OpenSim.Region.Framework.Scenes
3538 y *= a; 3578 y *= a;
3539 z *= a; 3579 z *= a;
3540 } 3580 }
3581 else if (oldSize.Z * z < m_scene.m_minNonphys)
3582 {
3583 f = m_scene.m_minNonphys / oldSize.Z;
3584 a = f / z;
3585 x *= a;
3586 y *= a;
3587 z *= a;
3588 }
3541 } 3589 }
3542 } 3590 }
3543 } 3591 }