diff options
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 31 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 60 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 66 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 15 |
5 files changed, 155 insertions, 26 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0e5ddfd..d2d6aba 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -103,8 +103,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
103 | /// </summary> | 103 | /// </summary> |
104 | public bool CollidablePrims { get; private set; } | 104 | public bool CollidablePrims { get; private set; } |
105 | 105 | ||
106 | /// <summary> | ||
107 | /// Minimum value of the size of a non-physical prim in each axis | ||
108 | /// </summary> | ||
109 | public float m_minNonphys = 0.01f; | ||
110 | |||
111 | /// <summary> | ||
112 | /// Maximum value of the size of a non-physical prim in each axis | ||
113 | /// </summary> | ||
106 | public float m_maxNonphys = 256; | 114 | public float m_maxNonphys = 256; |
115 | |||
116 | /// <summary> | ||
117 | /// Minimum value of the size of a physical prim in each axis | ||
118 | /// </summary> | ||
119 | public float m_minPhys = 0.01f; | ||
120 | |||
121 | /// <summary> | ||
122 | /// Maximum value of the size of a physical prim in each axis | ||
123 | /// </summary> | ||
107 | public float m_maxPhys = 10; | 124 | public float m_maxPhys = 10; |
125 | |||
108 | public bool m_clampPrimSize; | 126 | public bool m_clampPrimSize; |
109 | public bool m_trustBinaries; | 127 | public bool m_trustBinaries; |
110 | public bool m_allowScriptCrossings; | 128 | public bool m_allowScriptCrossings; |
@@ -721,14 +739,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
721 | PhysicalPrims = startupConfig.GetBoolean("physical_prim", PhysicalPrims); | 739 | PhysicalPrims = startupConfig.GetBoolean("physical_prim", PhysicalPrims); |
722 | CollidablePrims = startupConfig.GetBoolean("collidable_prim", CollidablePrims); | 740 | CollidablePrims = startupConfig.GetBoolean("collidable_prim", CollidablePrims); |
723 | 741 | ||
742 | m_minNonphys = startupConfig.GetFloat("NonphysicalPrimMin", m_minNonphys); | ||
743 | if (RegionInfo.NonphysPrimMin > 0) | ||
744 | { | ||
745 | m_minNonphys = RegionInfo.NonphysPrimMin; | ||
746 | } | ||
747 | |||
724 | m_maxNonphys = startupConfig.GetFloat("NonphysicalPrimMax", m_maxNonphys); | 748 | m_maxNonphys = startupConfig.GetFloat("NonphysicalPrimMax", m_maxNonphys); |
725 | if (RegionInfo.NonphysPrimMax > 0) | 749 | if (RegionInfo.NonphysPrimMax > 0) |
726 | { | 750 | { |
727 | m_maxNonphys = RegionInfo.NonphysPrimMax; | 751 | m_maxNonphys = RegionInfo.NonphysPrimMax; |
728 | } | 752 | } |
729 | 753 | ||
730 | m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", m_maxPhys); | 754 | m_minPhys = startupConfig.GetFloat("PhysicalPrimMin", m_minPhys); |
755 | if (RegionInfo.PhysPrimMin > 0) | ||
756 | { | ||
757 | m_minPhys = RegionInfo.PhysPrimMin; | ||
758 | } | ||
731 | 759 | ||
760 | m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", m_maxPhys); | ||
732 | if (RegionInfo.PhysPrimMax > 0) | 761 | if (RegionInfo.PhysPrimMax > 0) |
733 | { | 762 | { |
734 | m_maxPhys = RegionInfo.PhysPrimMax; | 763 | m_maxPhys = RegionInfo.PhysPrimMax; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 13842ad..b6339fb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -375,12 +375,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
375 | { | 375 | { |
376 | Vector3 scale = part.Shape.Scale; | 376 | Vector3 scale = part.Shape.Scale; |
377 | 377 | ||
378 | if (scale.X > m_parentScene.m_maxNonphys) | 378 | scale.X = Math.Max(m_parentScene.m_minNonphys, Math.Min(m_parentScene.m_maxNonphys, scale.X)); |
379 | scale.X = m_parentScene.m_maxNonphys; | 379 | scale.Y = Math.Max(m_parentScene.m_minNonphys, Math.Min(m_parentScene.m_maxNonphys, scale.Y)); |
380 | if (scale.Y > m_parentScene.m_maxNonphys) | 380 | scale.Z = Math.Max(m_parentScene.m_minNonphys, Math.Min(m_parentScene.m_maxNonphys, scale.Z)); |
381 | scale.Y = m_parentScene.m_maxNonphys; | ||
382 | if (scale.Z > m_parentScene.m_maxNonphys) | ||
383 | scale.Z = m_parentScene.m_maxNonphys; | ||
384 | 381 | ||
385 | part.Shape.Scale = scale; | 382 | part.Shape.Scale = scale; |
386 | } | 383 | } |
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; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 4c87639..53b4f7e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -733,7 +733,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
733 | } | 733 | } |
734 | catch (Exception e) | 734 | catch (Exception e) |
735 | { | 735 | { |
736 | m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message); | 736 | m_log.ErrorFormat("[SCENEOBJECTPART]: GROUP POSITION. {0}", e); |
737 | } | 737 | } |
738 | } | 738 | } |
739 | 739 | ||
@@ -2368,17 +2368,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2368 | /// <param name="scale"></param> | 2368 | /// <param name="scale"></param> |
2369 | public void Resize(Vector3 scale) | 2369 | public void Resize(Vector3 scale) |
2370 | { | 2370 | { |
2371 | scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxNonphys); | 2371 | scale.X = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.X)); |
2372 | scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxNonphys); | 2372 | scale.Y = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Y)); |
2373 | scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxNonphys); | 2373 | scale.Z = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Z)); |
2374 | 2374 | ||
2375 | PhysicsActor pa = PhysActor; | 2375 | PhysicsActor pa = PhysActor; |
2376 | |||
2377 | if (pa != null && pa.IsPhysical) | 2376 | if (pa != null && pa.IsPhysical) |
2378 | { | 2377 | { |
2379 | scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxPhys); | 2378 | scale.X = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.X)); |
2380 | scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxPhys); | 2379 | scale.Y = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Y)); |
2381 | scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxPhys); | 2380 | scale.Z = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Z)); |
2382 | } | 2381 | } |
2383 | 2382 | ||
2384 | // m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale); | 2383 | // m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale); |
@@ -4237,6 +4236,57 @@ namespace OpenSim.Region.Framework.Scenes | |||
4237 | ScheduleFullUpdate(); | 4236 | ScheduleFullUpdate(); |
4238 | } | 4237 | } |
4239 | 4238 | ||
4239 | public void UpdateSlice(float begin, float end) | ||
4240 | { | ||
4241 | if (end < begin) | ||
4242 | { | ||
4243 | float temp = begin; | ||
4244 | begin = end; | ||
4245 | end = temp; | ||
4246 | } | ||
4247 | end = Math.Min(1f, Math.Max(0f, end)); | ||
4248 | begin = Math.Min(Math.Min(1f, Math.Max(0f, begin)), end - 0.02f); | ||
4249 | if (begin < 0.02f && end < 0.02f) | ||
4250 | { | ||
4251 | begin = 0f; | ||
4252 | end = 0.02f; | ||
4253 | } | ||
4254 | |||
4255 | ushort uBegin = (ushort)(50000.0 * begin); | ||
4256 | ushort uEnd = (ushort)(50000.0 * (1f - end)); | ||
4257 | bool updatePossiblyNeeded = false; | ||
4258 | PrimType primType = GetPrimType(); | ||
4259 | if (primType == PrimType.SPHERE || primType == PrimType.TORUS || primType == PrimType.TUBE || primType == PrimType.RING) | ||
4260 | { | ||
4261 | if (m_shape.ProfileBegin != uBegin || m_shape.ProfileEnd != uEnd) | ||
4262 | { | ||
4263 | m_shape.ProfileBegin = uBegin; | ||
4264 | m_shape.ProfileEnd = uEnd; | ||
4265 | updatePossiblyNeeded = true; | ||
4266 | } | ||
4267 | } | ||
4268 | else if (m_shape.PathBegin != uBegin || m_shape.PathEnd != uEnd) | ||
4269 | { | ||
4270 | m_shape.PathBegin = uBegin; | ||
4271 | m_shape.PathEnd = uEnd; | ||
4272 | updatePossiblyNeeded = true; | ||
4273 | } | ||
4274 | |||
4275 | if (updatePossiblyNeeded && ParentGroup != null) | ||
4276 | { | ||
4277 | ParentGroup.HasGroupChanged = true; | ||
4278 | } | ||
4279 | if (updatePossiblyNeeded && PhysActor != null) | ||
4280 | { | ||
4281 | PhysActor.Shape = m_shape; | ||
4282 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | ||
4283 | } | ||
4284 | if (updatePossiblyNeeded) | ||
4285 | { | ||
4286 | ScheduleFullUpdate(); | ||
4287 | } | ||
4288 | } | ||
4289 | |||
4240 | /// <summary> | 4290 | /// <summary> |
4241 | /// If the part is a sculpt/mesh, retrieve the mesh data and reinsert it into the shape so that the physics | 4291 | /// If the part is a sculpt/mesh, retrieve the mesh data and reinsert it into the shape so that the physics |
4242 | /// engine can use it. | 4292 | /// engine can use it. |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 548dfd3..65d526f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1385,17 +1385,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
1385 | bool DCFlagKeyPressed = false; | 1385 | bool DCFlagKeyPressed = false; |
1386 | Vector3 agent_control_v3 = Vector3.Zero; | 1386 | Vector3 agent_control_v3 = Vector3.Zero; |
1387 | 1387 | ||
1388 | bool oldflying = Flying; | 1388 | bool newFlying = actor.Flying; |
1389 | 1389 | ||
1390 | if (ForceFly) | 1390 | if (ForceFly) |
1391 | actor.Flying = true; | 1391 | newFlying = true; |
1392 | else if (FlyDisabled) | 1392 | else if (FlyDisabled) |
1393 | actor.Flying = false; | 1393 | newFlying = false; |
1394 | else | 1394 | else |
1395 | actor.Flying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | 1395 | newFlying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); |
1396 | 1396 | ||
1397 | if (actor.Flying != oldflying) | 1397 | if (actor.Flying != newFlying) |
1398 | { | ||
1399 | // Note: ScenePresence.Flying is actually fetched from the physical actor | ||
1400 | // so setting PhysActor.Flying here also sets the ScenePresence's value. | ||
1401 | actor.Flying = newFlying; | ||
1398 | update_movementflag = true; | 1402 | update_movementflag = true; |
1403 | } | ||
1399 | 1404 | ||
1400 | if (ParentID == 0) | 1405 | if (ParentID == 0) |
1401 | { | 1406 | { |