diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 60 |
1 files changed, 54 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6104c66..3726a15 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -3436,17 +3436,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
3436 | /// <param name="scale"></param> | 3436 | /// <param name="scale"></param> |
3437 | public void GroupResize(Vector3 scale) | 3437 | public void GroupResize(Vector3 scale) |
3438 | { | 3438 | { |
3439 | scale.X = Math.Min(scale.X, Scene.m_maxNonphys); | 3439 | scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X)); |
3440 | scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); | 3440 | scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y)); |
3441 | scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys); | 3441 | scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z)); |
3442 | 3442 | ||
3443 | PhysicsActor pa = m_rootPart.PhysActor; | 3443 | PhysicsActor pa = m_rootPart.PhysActor; |
3444 | 3444 | ||
3445 | if (pa != null && pa.IsPhysical) | 3445 | if (pa != null && pa.IsPhysical) |
3446 | { | 3446 | { |
3447 | scale.X = Math.Min(scale.X, Scene.m_maxPhys); | 3447 | scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X)); |
3448 | scale.Y = Math.Min(scale.Y, Scene.m_maxPhys); | 3448 | scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y)); |
3449 | scale.Z = Math.Min(scale.Z, Scene.m_maxPhys); | 3449 | scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z)); |
3450 | } | 3450 | } |
3451 | 3451 | ||
3452 | float x = (scale.X / RootPart.Scale.X); | 3452 | float x = (scale.X / RootPart.Scale.X); |
@@ -3477,6 +3477,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3477 | y *= a; | 3477 | y *= a; |
3478 | z *= a; | 3478 | z *= a; |
3479 | } | 3479 | } |
3480 | else if (oldSize.X * x < m_scene.m_minPhys) | ||
3481 | { | ||
3482 | f = m_scene.m_minPhys / oldSize.X; | ||
3483 | a = f / x; | ||
3484 | x *= a; | ||
3485 | y *= a; | ||
3486 | z *= a; | ||
3487 | } | ||
3480 | 3488 | ||
3481 | if (oldSize.Y * y > m_scene.m_maxPhys) | 3489 | if (oldSize.Y * y > m_scene.m_maxPhys) |
3482 | { | 3490 | { |
@@ -3486,6 +3494,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3486 | y *= a; | 3494 | y *= a; |
3487 | z *= a; | 3495 | z *= a; |
3488 | } | 3496 | } |
3497 | else if (oldSize.Y * y < m_scene.m_minPhys) | ||
3498 | { | ||
3499 | f = m_scene.m_minPhys / oldSize.Y; | ||
3500 | a = f / y; | ||
3501 | x *= a; | ||
3502 | y *= a; | ||
3503 | z *= a; | ||
3504 | } | ||
3489 | 3505 | ||
3490 | if (oldSize.Z * z > m_scene.m_maxPhys) | 3506 | if (oldSize.Z * z > m_scene.m_maxPhys) |
3491 | { | 3507 | { |
@@ -3495,6 +3511,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3495 | y *= a; | 3511 | y *= a; |
3496 | z *= a; | 3512 | z *= a; |
3497 | } | 3513 | } |
3514 | else if (oldSize.Z * z < m_scene.m_minPhys) | ||
3515 | { | ||
3516 | f = m_scene.m_minPhys / oldSize.Z; | ||
3517 | a = f / z; | ||
3518 | x *= a; | ||
3519 | y *= a; | ||
3520 | z *= a; | ||
3521 | } | ||
3498 | } | 3522 | } |
3499 | else | 3523 | else |
3500 | { | 3524 | { |
@@ -3506,6 +3530,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3506 | y *= a; | 3530 | y *= a; |
3507 | z *= a; | 3531 | z *= a; |
3508 | } | 3532 | } |
3533 | else if (oldSize.X * x < m_scene.m_minNonphys) | ||
3534 | { | ||
3535 | f = m_scene.m_minNonphys / oldSize.X; | ||
3536 | a = f / x; | ||
3537 | x *= a; | ||
3538 | y *= a; | ||
3539 | z *= a; | ||
3540 | } | ||
3509 | 3541 | ||
3510 | if (oldSize.Y * y > m_scene.m_maxNonphys) | 3542 | if (oldSize.Y * y > m_scene.m_maxNonphys) |
3511 | { | 3543 | { |
@@ -3515,6 +3547,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3515 | y *= a; | 3547 | y *= a; |
3516 | z *= a; | 3548 | z *= a; |
3517 | } | 3549 | } |
3550 | else if (oldSize.Y * y < m_scene.m_minNonphys) | ||
3551 | { | ||
3552 | f = m_scene.m_minNonphys / oldSize.Y; | ||
3553 | a = f / y; | ||
3554 | x *= a; | ||
3555 | y *= a; | ||
3556 | z *= a; | ||
3557 | } | ||
3518 | 3558 | ||
3519 | if (oldSize.Z * z > m_scene.m_maxNonphys) | 3559 | if (oldSize.Z * z > m_scene.m_maxNonphys) |
3520 | { | 3560 | { |
@@ -3524,6 +3564,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3524 | y *= a; | 3564 | y *= a; |
3525 | z *= a; | 3565 | z *= a; |
3526 | } | 3566 | } |
3567 | else if (oldSize.Z * z < m_scene.m_minNonphys) | ||
3568 | { | ||
3569 | f = m_scene.m_minNonphys / oldSize.Z; | ||
3570 | a = f / z; | ||
3571 | x *= a; | ||
3572 | y *= a; | ||
3573 | z *= a; | ||
3574 | } | ||
3527 | } | 3575 | } |
3528 | } | 3576 | } |
3529 | } | 3577 | } |