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.cs62
1 files changed, 28 insertions, 34 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ac26be7..45bbbda 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1119,14 +1119,6 @@ namespace OpenSim.Region.Framework.Scenes
1119 parts[i].UUID = UUID.Random(); 1119 parts[i].UUID = UUID.Random();
1120 } 1120 }
1121 1121
1122 // helper provided for parts.
1123 public int GetSceneMaxUndo()
1124 {
1125 if (m_scene != null)
1126 return m_scene.MaxUndoCount;
1127 return 5;
1128 }
1129
1130 // justincc: I don't believe this hack is needed any longer, especially since the physics 1122 // justincc: I don't believe this hack is needed any longer, especially since the physics
1131 // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false 1123 // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false
1132 // this method was preventing proper reload of scene objects. 1124 // this method was preventing proper reload of scene objects.
@@ -2703,29 +2695,32 @@ namespace OpenSim.Region.Framework.Scenes
2703// m_log.DebugFormat( 2695// m_log.DebugFormat(
2704// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale); 2696// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale);
2705 2697
2706 RootPart.StoreUndoState(true);
2707
2708 scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X));
2709 scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y));
2710 scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z));
2711
2712 PhysicsActor pa = m_rootPart.PhysActor; 2698 PhysicsActor pa = m_rootPart.PhysActor;
2713 2699
2714 if (pa != null && pa.IsPhysical) 2700 RootPart.StoreUndoState(true);
2701
2702 if (Scene != null)
2715 { 2703 {
2716 scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X)); 2704 scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X));
2717 scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y)); 2705 scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y));
2718 scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z)); 2706 scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z));
2707
2708 if (pa != null && pa.IsPhysical)
2709 {
2710 scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X));
2711 scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y));
2712 scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z));
2713 }
2719 } 2714 }
2720 2715
2721 float x = (scale.X / RootPart.Scale.X); 2716 float x = (scale.X / RootPart.Scale.X);
2722 float y = (scale.Y / RootPart.Scale.Y); 2717 float y = (scale.Y / RootPart.Scale.Y);
2723 float z = (scale.Z / RootPart.Scale.Z); 2718 float z = (scale.Z / RootPart.Scale.Z);
2724 2719
2725 SceneObjectPart[] parts; 2720 SceneObjectPart[] parts = m_parts.GetArray();
2726 if (x > 1.0f || y > 1.0f || z > 1.0f) 2721
2722 if (Scene != null & (x > 1.0f || y > 1.0f || z > 1.0f))
2727 { 2723 {
2728 parts = m_parts.GetArray();
2729 for (int i = 0; i < parts.Length; i++) 2724 for (int i = 0; i < parts.Length; i++)
2730 { 2725 {
2731 SceneObjectPart obPart = parts[i]; 2726 SceneObjectPart obPart = parts[i];
@@ -2739,7 +2734,7 @@ namespace OpenSim.Region.Framework.Scenes
2739 2734
2740 if (pa != null && pa.IsPhysical) 2735 if (pa != null && pa.IsPhysical)
2741 { 2736 {
2742 if (oldSize.X * x > m_scene.m_maxPhys) 2737 if (oldSize.X * x > Scene.m_maxPhys)
2743 { 2738 {
2744 f = m_scene.m_maxPhys / oldSize.X; 2739 f = m_scene.m_maxPhys / oldSize.X;
2745 a = f / x; 2740 a = f / x;
@@ -2747,7 +2742,7 @@ namespace OpenSim.Region.Framework.Scenes
2747 y *= a; 2742 y *= a;
2748 z *= a; 2743 z *= a;
2749 } 2744 }
2750 else if (oldSize.X * x < m_scene.m_minPhys) 2745 else if (oldSize.X * x < Scene.m_minPhys)
2751 { 2746 {
2752 f = m_scene.m_minPhys / oldSize.X; 2747 f = m_scene.m_minPhys / oldSize.X;
2753 a = f / x; 2748 a = f / x;
@@ -2756,7 +2751,7 @@ namespace OpenSim.Region.Framework.Scenes
2756 z *= a; 2751 z *= a;
2757 } 2752 }
2758 2753
2759 if (oldSize.Y * y > m_scene.m_maxPhys) 2754 if (oldSize.Y * y > Scene.m_maxPhys)
2760 { 2755 {
2761 f = m_scene.m_maxPhys / oldSize.Y; 2756 f = m_scene.m_maxPhys / oldSize.Y;
2762 a = f / y; 2757 a = f / y;
@@ -2764,7 +2759,7 @@ namespace OpenSim.Region.Framework.Scenes
2764 y *= a; 2759 y *= a;
2765 z *= a; 2760 z *= a;
2766 } 2761 }
2767 else if (oldSize.Y * y < m_scene.m_minPhys) 2762 else if (oldSize.Y * y < Scene.m_minPhys)
2768 { 2763 {
2769 f = m_scene.m_minPhys / oldSize.Y; 2764 f = m_scene.m_minPhys / oldSize.Y;
2770 a = f / y; 2765 a = f / y;
@@ -2773,7 +2768,7 @@ namespace OpenSim.Region.Framework.Scenes
2773 z *= a; 2768 z *= a;
2774 } 2769 }
2775 2770
2776 if (oldSize.Z * z > m_scene.m_maxPhys) 2771 if (oldSize.Z * z > Scene.m_maxPhys)
2777 { 2772 {
2778 f = m_scene.m_maxPhys / oldSize.Z; 2773 f = m_scene.m_maxPhys / oldSize.Z;
2779 a = f / z; 2774 a = f / z;
@@ -2781,7 +2776,7 @@ namespace OpenSim.Region.Framework.Scenes
2781 y *= a; 2776 y *= a;
2782 z *= a; 2777 z *= a;
2783 } 2778 }
2784 else if (oldSize.Z * z < m_scene.m_minPhys) 2779 else if (oldSize.Z * z < Scene.m_minPhys)
2785 { 2780 {
2786 f = m_scene.m_minPhys / oldSize.Z; 2781 f = m_scene.m_minPhys / oldSize.Z;
2787 a = f / z; 2782 a = f / z;
@@ -2792,7 +2787,7 @@ namespace OpenSim.Region.Framework.Scenes
2792 } 2787 }
2793 else 2788 else
2794 { 2789 {
2795 if (oldSize.X * x > m_scene.m_maxNonphys) 2790 if (oldSize.X * x > Scene.m_maxNonphys)
2796 { 2791 {
2797 f = m_scene.m_maxNonphys / oldSize.X; 2792 f = m_scene.m_maxNonphys / oldSize.X;
2798 a = f / x; 2793 a = f / x;
@@ -2800,7 +2795,7 @@ namespace OpenSim.Region.Framework.Scenes
2800 y *= a; 2795 y *= a;
2801 z *= a; 2796 z *= a;
2802 } 2797 }
2803 else if (oldSize.X * x < m_scene.m_minNonphys) 2798 else if (oldSize.X * x < Scene.m_minNonphys)
2804 { 2799 {
2805 f = m_scene.m_minNonphys / oldSize.X; 2800 f = m_scene.m_minNonphys / oldSize.X;
2806 a = f / x; 2801 a = f / x;
@@ -2809,7 +2804,7 @@ namespace OpenSim.Region.Framework.Scenes
2809 z *= a; 2804 z *= a;
2810 } 2805 }
2811 2806
2812 if (oldSize.Y * y > m_scene.m_maxNonphys) 2807 if (oldSize.Y * y > Scene.m_maxNonphys)
2813 { 2808 {
2814 f = m_scene.m_maxNonphys / oldSize.Y; 2809 f = m_scene.m_maxNonphys / oldSize.Y;
2815 a = f / y; 2810 a = f / y;
@@ -2817,7 +2812,7 @@ namespace OpenSim.Region.Framework.Scenes
2817 y *= a; 2812 y *= a;
2818 z *= a; 2813 z *= a;
2819 } 2814 }
2820 else if (oldSize.Y * y < m_scene.m_minNonphys) 2815 else if (oldSize.Y * y < Scene.m_minNonphys)
2821 { 2816 {
2822 f = m_scene.m_minNonphys / oldSize.Y; 2817 f = m_scene.m_minNonphys / oldSize.Y;
2823 a = f / y; 2818 a = f / y;
@@ -2826,7 +2821,7 @@ namespace OpenSim.Region.Framework.Scenes
2826 z *= a; 2821 z *= a;
2827 } 2822 }
2828 2823
2829 if (oldSize.Z * z > m_scene.m_maxNonphys) 2824 if (oldSize.Z * z > Scene.m_maxNonphys)
2830 { 2825 {
2831 f = m_scene.m_maxNonphys / oldSize.Z; 2826 f = m_scene.m_maxNonphys / oldSize.Z;
2832 a = f / z; 2827 a = f / z;
@@ -2834,7 +2829,7 @@ namespace OpenSim.Region.Framework.Scenes
2834 y *= a; 2829 y *= a;
2835 z *= a; 2830 z *= a;
2836 } 2831 }
2837 else if (oldSize.Z * z < m_scene.m_minNonphys) 2832 else if (oldSize.Z * z < Scene.m_minNonphys)
2838 { 2833 {
2839 f = m_scene.m_minNonphys / oldSize.Z; 2834 f = m_scene.m_minNonphys / oldSize.Z;
2840 a = f / z; 2835 a = f / z;
@@ -2858,7 +2853,6 @@ namespace OpenSim.Region.Framework.Scenes
2858 RootPart.Resize(prevScale); 2853 RootPart.Resize(prevScale);
2859// RootPart.IgnoreUndoUpdate = false; 2854// RootPart.IgnoreUndoUpdate = false;
2860 2855
2861 parts = m_parts.GetArray();
2862 for (int i = 0; i < parts.Length; i++) 2856 for (int i = 0; i < parts.Length; i++)
2863 { 2857 {
2864 SceneObjectPart obPart = parts[i]; 2858 SceneObjectPart obPart = parts[i];