diff options
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to '')
-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 5f90035..f6c725b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2674,17 +2674,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
2674 | 2674 | ||
2675 | RootPart.StoreUndoState(true); | 2675 | RootPart.StoreUndoState(true); |
2676 | 2676 | ||
2677 | scale.X = Math.Min(scale.X, Scene.m_maxNonphys); | 2677 | scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X)); |
2678 | scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); | 2678 | scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y)); |
2679 | scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys); | 2679 | scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z)); |
2680 | 2680 | ||
2681 | PhysicsActor pa = m_rootPart.PhysActor; | 2681 | PhysicsActor pa = m_rootPart.PhysActor; |
2682 | 2682 | ||
2683 | if (pa != null && pa.IsPhysical) | 2683 | if (pa != null && pa.IsPhysical) |
2684 | { | 2684 | { |
2685 | scale.X = Math.Min(scale.X, Scene.m_maxPhys); | 2685 | scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X)); |
2686 | scale.Y = Math.Min(scale.Y, Scene.m_maxPhys); | 2686 | scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y)); |
2687 | scale.Z = Math.Min(scale.Z, Scene.m_maxPhys); | 2687 | scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z)); |
2688 | } | 2688 | } |
2689 | 2689 | ||
2690 | float x = (scale.X / RootPart.Scale.X); | 2690 | float x = (scale.X / RootPart.Scale.X); |
@@ -2716,6 +2716,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2716 | y *= a; | 2716 | y *= a; |
2717 | z *= a; | 2717 | z *= a; |
2718 | } | 2718 | } |
2719 | else if (oldSize.X * x < m_scene.m_minPhys) | ||
2720 | { | ||
2721 | f = m_scene.m_minPhys / oldSize.X; | ||
2722 | a = f / x; | ||
2723 | x *= a; | ||
2724 | y *= a; | ||
2725 | z *= a; | ||
2726 | } | ||
2719 | 2727 | ||
2720 | if (oldSize.Y * y > m_scene.m_maxPhys) | 2728 | if (oldSize.Y * y > m_scene.m_maxPhys) |
2721 | { | 2729 | { |
@@ -2725,6 +2733,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2725 | y *= a; | 2733 | y *= a; |
2726 | z *= a; | 2734 | z *= a; |
2727 | } | 2735 | } |
2736 | else if (oldSize.Y * y < m_scene.m_minPhys) | ||
2737 | { | ||
2738 | f = m_scene.m_minPhys / oldSize.Y; | ||
2739 | a = f / y; | ||
2740 | x *= a; | ||
2741 | y *= a; | ||
2742 | z *= a; | ||
2743 | } | ||
2728 | 2744 | ||
2729 | if (oldSize.Z * z > m_scene.m_maxPhys) | 2745 | if (oldSize.Z * z > m_scene.m_maxPhys) |
2730 | { | 2746 | { |
@@ -2734,6 +2750,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2734 | y *= a; | 2750 | y *= a; |
2735 | z *= a; | 2751 | z *= a; |
2736 | } | 2752 | } |
2753 | else if (oldSize.Z * z < m_scene.m_minPhys) | ||
2754 | { | ||
2755 | f = m_scene.m_minPhys / oldSize.Z; | ||
2756 | a = f / z; | ||
2757 | x *= a; | ||
2758 | y *= a; | ||
2759 | z *= a; | ||
2760 | } | ||
2737 | } | 2761 | } |
2738 | else | 2762 | else |
2739 | { | 2763 | { |
@@ -2745,6 +2769,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2745 | y *= a; | 2769 | y *= a; |
2746 | z *= a; | 2770 | z *= a; |
2747 | } | 2771 | } |
2772 | else if (oldSize.X * x < m_scene.m_minNonphys) | ||
2773 | { | ||
2774 | f = m_scene.m_minNonphys / oldSize.X; | ||
2775 | a = f / x; | ||
2776 | x *= a; | ||
2777 | y *= a; | ||
2778 | z *= a; | ||
2779 | } | ||
2748 | 2780 | ||
2749 | if (oldSize.Y * y > m_scene.m_maxNonphys) | 2781 | if (oldSize.Y * y > m_scene.m_maxNonphys) |
2750 | { | 2782 | { |
@@ -2754,6 +2786,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2754 | y *= a; | 2786 | y *= a; |
2755 | z *= a; | 2787 | z *= a; |
2756 | } | 2788 | } |
2789 | else if (oldSize.Y * y < m_scene.m_minNonphys) | ||
2790 | { | ||
2791 | f = m_scene.m_minNonphys / oldSize.Y; | ||
2792 | a = f / y; | ||
2793 | x *= a; | ||
2794 | y *= a; | ||
2795 | z *= a; | ||
2796 | } | ||
2757 | 2797 | ||
2758 | if (oldSize.Z * z > m_scene.m_maxNonphys) | 2798 | if (oldSize.Z * z > m_scene.m_maxNonphys) |
2759 | { | 2799 | { |
@@ -2763,6 +2803,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2763 | y *= a; | 2803 | y *= a; |
2764 | z *= a; | 2804 | z *= a; |
2765 | } | 2805 | } |
2806 | else if (oldSize.Z * z < m_scene.m_minNonphys) | ||
2807 | { | ||
2808 | f = m_scene.m_minNonphys / oldSize.Z; | ||
2809 | a = f / z; | ||
2810 | x *= a; | ||
2811 | y *= a; | ||
2812 | z *= a; | ||
2813 | } | ||
2766 | } | 2814 | } |
2767 | 2815 | ||
2768 | // obPart.IgnoreUndoUpdate = false; | 2816 | // obPart.IgnoreUndoUpdate = false; |