diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 66 |
1 files changed, 58 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ce652b4..593e1d3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -790,7 +790,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
790 | } | 790 | } |
791 | catch (Exception e) | 791 | catch (Exception e) |
792 | { | 792 | { |
793 | m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message); | 793 | m_log.ErrorFormat("[SCENEOBJECTPART]: GROUP POSITION. {0}", e); |
794 | } | 794 | } |
795 | } | 795 | } |
796 | } | 796 | } |
@@ -2969,17 +2969,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2969 | /// <param name="scale"></param> | 2969 | /// <param name="scale"></param> |
2970 | public void Resize(Vector3 scale) | 2970 | public void Resize(Vector3 scale) |
2971 | { | 2971 | { |
2972 | scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxNonphys); | 2972 | scale.X = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.X)); |
2973 | scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxNonphys); | 2973 | scale.Y = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Y)); |
2974 | scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxNonphys); | 2974 | scale.Z = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Z)); |
2975 | 2975 | ||
2976 | PhysicsActor pa = PhysActor; | 2976 | PhysicsActor pa = PhysActor; |
2977 | |||
2978 | if (pa != null && pa.IsPhysical) | 2977 | if (pa != null && pa.IsPhysical) |
2979 | { | 2978 | { |
2980 | scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxPhys); | 2979 | scale.X = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.X)); |
2981 | scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxPhys); | 2980 | scale.Y = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Y)); |
2982 | scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxPhys); | 2981 | scale.Z = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Z)); |
2983 | } | 2982 | } |
2984 | 2983 | ||
2985 | // m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale); | 2984 | // m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale); |
@@ -4864,6 +4863,57 @@ namespace OpenSim.Region.Framework.Scenes | |||
4864 | ScheduleFullUpdate(); | 4863 | ScheduleFullUpdate(); |
4865 | } | 4864 | } |
4866 | 4865 | ||
4866 | public void UpdateSlice(float begin, float end) | ||
4867 | { | ||
4868 | if (end < begin) | ||
4869 | { | ||
4870 | float temp = begin; | ||
4871 | begin = end; | ||
4872 | end = temp; | ||
4873 | } | ||
4874 | end = Math.Min(1f, Math.Max(0f, end)); | ||
4875 | begin = Math.Min(Math.Min(1f, Math.Max(0f, begin)), end - 0.02f); | ||
4876 | if (begin < 0.02f && end < 0.02f) | ||
4877 | { | ||
4878 | begin = 0f; | ||
4879 | end = 0.02f; | ||
4880 | } | ||
4881 | |||
4882 | ushort uBegin = (ushort)(50000.0 * begin); | ||
4883 | ushort uEnd = (ushort)(50000.0 * (1f - end)); | ||
4884 | bool updatePossiblyNeeded = false; | ||
4885 | PrimType primType = GetPrimType(); | ||
4886 | if (primType == PrimType.SPHERE || primType == PrimType.TORUS || primType == PrimType.TUBE || primType == PrimType.RING) | ||
4887 | { | ||
4888 | if (m_shape.ProfileBegin != uBegin || m_shape.ProfileEnd != uEnd) | ||
4889 | { | ||
4890 | m_shape.ProfileBegin = uBegin; | ||
4891 | m_shape.ProfileEnd = uEnd; | ||
4892 | updatePossiblyNeeded = true; | ||
4893 | } | ||
4894 | } | ||
4895 | else if (m_shape.PathBegin != uBegin || m_shape.PathEnd != uEnd) | ||
4896 | { | ||
4897 | m_shape.PathBegin = uBegin; | ||
4898 | m_shape.PathEnd = uEnd; | ||
4899 | updatePossiblyNeeded = true; | ||
4900 | } | ||
4901 | |||
4902 | if (updatePossiblyNeeded && ParentGroup != null) | ||
4903 | { | ||
4904 | ParentGroup.HasGroupChanged = true; | ||
4905 | } | ||
4906 | if (updatePossiblyNeeded && PhysActor != null) | ||
4907 | { | ||
4908 | PhysActor.Shape = m_shape; | ||
4909 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | ||
4910 | } | ||
4911 | if (updatePossiblyNeeded) | ||
4912 | { | ||
4913 | ScheduleFullUpdate(); | ||
4914 | } | ||
4915 | } | ||
4916 | |||
4867 | /// <summary> | 4917 | /// <summary> |
4868 | /// If the part is a sculpt/mesh, retrieve the mesh data and reinsert it into the shape so that the physics | 4918 | /// If the part is a sculpt/mesh, retrieve the mesh data and reinsert it into the shape so that the physics |
4869 | /// engine can use it. | 4919 | /// engine can use it. |