diff options
author | UbitUmarov | 2017-07-12 10:28:11 +0100 |
---|---|---|
committer | UbitUmarov | 2017-07-12 10:28:11 +0100 |
commit | 457551d0699558520c9ce47e05fcace828a706e5 (patch) | |
tree | 87fa034cc4eb078287012dc2688e4ef450432c8d /OpenSim | |
parent | osSetParcelDetails: add more land update code (diff) | |
download | opensim-SC_OLD-457551d0699558520c9ce47e05fcace828a706e5.zip opensim-SC_OLD-457551d0699558520c9ce47e05fcace828a706e5.tar.gz opensim-SC_OLD-457551d0699558520c9ce47e05fcace828a706e5.tar.bz2 opensim-SC_OLD-457551d0699558520c9ce47e05fcace828a706e5.tar.xz |
rename SOG.UpdatePrimFlags as just UpdateFlags since this is relative to the group never individual prims/parts and so confusing
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 2 | ||||
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 131 |
3 files changed, 59 insertions, 76 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 827f91e..f76f882 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -855,7 +855,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
855 | /// <see cref="Scene.DeleteSceneObject"/>, | 855 | /// <see cref="Scene.DeleteSceneObject"/>, |
856 | /// <see cref="Scene.SelectPrim"/>, | 856 | /// <see cref="Scene.SelectPrim"/>, |
857 | /// <see cref="Scene.DeselectPrim"/>, | 857 | /// <see cref="Scene.DeselectPrim"/>, |
858 | /// <see cref="SceneObjectGroup.UpdatePrimFlags"/>, | 858 | /// <see cref="SceneObjectGroup.UpdateFlags"/>, |
859 | /// <see cref="SceneObjectGroup.AbsolutePosition"/> | 859 | /// <see cref="SceneObjectGroup.AbsolutePosition"/> |
860 | /// </remarks> | 860 | /// </remarks> |
861 | public event ParcelPrimCountTainted OnParcelPrimCountTainted; | 861 | public event ParcelPrimCountTainted OnParcelPrimCountTainted; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index ae827f4..61a243d 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1649,7 +1649,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1649 | else // else turn it off | 1649 | else // else turn it off |
1650 | vdtc = false; | 1650 | vdtc = false; |
1651 | 1651 | ||
1652 | group.UpdatePrimFlags(localID, UsePhysics, SetTemporary, SetPhantom, vdtc); | 1652 | group.UpdateFlags(UsePhysics, SetTemporary, SetPhantom, vdtc); |
1653 | } | 1653 | } |
1654 | else | 1654 | else |
1655 | { | 1655 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index c4b768b..6f46a92 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2718,35 +2718,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
2718 | RootPart.KeyframeMotion.Stop(); | 2718 | RootPart.KeyframeMotion.Stop(); |
2719 | RootPart.KeyframeMotion = null; | 2719 | RootPart.KeyframeMotion = null; |
2720 | } | 2720 | } |
2721 | UpdatePrimFlags(RootPart.LocalId, usePhysics, IsTemporary, IsPhantom, IsVolumeDetect); | 2721 | UpdateFlags(usePhysics, IsTemporary, IsPhantom, IsVolumeDetect); |
2722 | } | 2722 | } |
2723 | 2723 | ||
2724 | public void ScriptSetTemporaryStatus(bool makeTemporary) | 2724 | public void ScriptSetTemporaryStatus(bool makeTemporary) |
2725 | { | 2725 | { |
2726 | UpdatePrimFlags(RootPart.LocalId, UsesPhysics, makeTemporary, IsPhantom, IsVolumeDetect); | 2726 | UpdateFlags(UsesPhysics, makeTemporary, IsPhantom, IsVolumeDetect); |
2727 | } | 2727 | } |
2728 | 2728 | ||
2729 | public void ScriptSetPhantomStatus(bool makePhantom) | 2729 | public void ScriptSetPhantomStatus(bool makePhantom) |
2730 | { | 2730 | { |
2731 | UpdatePrimFlags(RootPart.LocalId, UsesPhysics, IsTemporary, makePhantom, IsVolumeDetect); | 2731 | UpdateFlags(UsesPhysics, IsTemporary, makePhantom, IsVolumeDetect); |
2732 | } | 2732 | } |
2733 | 2733 | ||
2734 | public void ScriptSetVolumeDetect(bool makeVolumeDetect) | 2734 | public void ScriptSetVolumeDetect(bool makeVolumeDetect) |
2735 | { | 2735 | { |
2736 | UpdatePrimFlags(RootPart.LocalId, UsesPhysics, IsTemporary, IsPhantom, makeVolumeDetect); | 2736 | UpdateFlags(UsesPhysics, IsTemporary, IsPhantom, makeVolumeDetect); |
2737 | |||
2738 | /* | ||
2739 | ScriptSetPhantomStatus(false); // What ever it was before, now it's not phantom anymore | ||
2740 | |||
2741 | if (PhysActor != null) // Should always be the case now | ||
2742 | { | ||
2743 | PhysActor.SetVolumeDetect(param); | ||
2744 | } | ||
2745 | if (param != 0) | ||
2746 | AddFlag(PrimFlags.Phantom); | ||
2747 | |||
2748 | ScheduleFullUpdate(); | ||
2749 | */ | ||
2750 | } | 2737 | } |
2751 | 2738 | ||
2752 | public void applyImpulse(Vector3 impulse) | 2739 | public void applyImpulse(Vector3 impulse) |
@@ -4031,84 +4018,80 @@ namespace OpenSim.Region.Framework.Scenes | |||
4031 | /// <param name="SetTemporary"></param> | 4018 | /// <param name="SetTemporary"></param> |
4032 | /// <param name="SetPhantom"></param> | 4019 | /// <param name="SetPhantom"></param> |
4033 | /// <param name="SetVolumeDetect"></param> | 4020 | /// <param name="SetVolumeDetect"></param> |
4034 | public void UpdatePrimFlags(uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, bool SetVolumeDetect) | 4021 | public void UpdateFlags(bool UsePhysics, bool SetTemporary, bool SetPhantom, bool SetVolumeDetect) |
4035 | { | 4022 | { |
4036 | HasGroupChanged = true; | 4023 | if (m_scene == null || IsDeleted) |
4024 | return; | ||
4037 | 4025 | ||
4038 | SceneObjectPart selectionPart = GetPart(localID); | 4026 | HasGroupChanged = true; |
4039 | 4027 | ||
4040 | if (Scene != null) | 4028 | if (SetTemporary) |
4041 | { | 4029 | { |
4042 | if (SetTemporary) | 4030 | DetachFromBackup(); |
4043 | { | 4031 | // Remove from database and parcel prim count |
4044 | DetachFromBackup(); | 4032 | // |
4045 | // Remove from database and parcel prim count | 4033 | m_scene.DeleteFromStorage(UUID); |
4046 | // | ||
4047 | m_scene.DeleteFromStorage(UUID); | ||
4048 | } | ||
4049 | else if (!Backup) | ||
4050 | { | ||
4051 | // Previously been temporary now switching back so make it | ||
4052 | // available for persisting again | ||
4053 | AttachToBackup(); | ||
4054 | } | ||
4055 | |||
4056 | m_scene.EventManager.TriggerParcelPrimCountTainted(); | ||
4057 | } | 4034 | } |
4058 | 4035 | else if (!Backup) | |
4059 | if (selectionPart != null) | ||
4060 | { | 4036 | { |
4061 | SceneObjectPart[] parts = m_parts.GetArray(); | 4037 | // Previously been temporary now switching back so make it |
4038 | // available for persisting again | ||
4039 | AttachToBackup(); | ||
4040 | } | ||
4062 | 4041 | ||
4063 | if (Scene != null && UsePhysics) | ||
4064 | { | ||
4065 | int maxprims = m_scene.m_linksetPhysCapacity; | ||
4066 | bool checkShape = (maxprims > 0 && | ||
4067 | parts.Length > maxprims); | ||
4068 | 4042 | ||
4069 | for (int i = 0; i < parts.Length; i++) | 4043 | SceneObjectPart[] parts = m_parts.GetArray(); |
4070 | { | ||
4071 | SceneObjectPart part = parts[i]; | ||
4072 | 4044 | ||
4073 | if(part.PhysicsShapeType == (byte)PhysicsShapeType.None) | 4045 | if (UsePhysics) |
4074 | continue; // assuming root type was checked elsewhere | 4046 | { |
4047 | int maxprims = m_scene.m_linksetPhysCapacity; | ||
4048 | bool checkShape = (maxprims > 0 && | ||
4049 | parts.Length > maxprims); | ||
4075 | 4050 | ||
4076 | if (checkShape) | 4051 | for (int i = 0; i < parts.Length; i++) |
4077 | { | 4052 | { |
4078 | if (--maxprims < 0) | 4053 | SceneObjectPart part = parts[i]; |
4079 | { | ||
4080 | UsePhysics = false; | ||
4081 | break; | ||
4082 | } | ||
4083 | } | ||
4084 | 4054 | ||
4085 | if (part.Scale.X > m_scene.m_maxPhys || | 4055 | if(part.PhysicsShapeType == (byte)PhysicsShapeType.None) |
4086 | part.Scale.Y > m_scene.m_maxPhys || | 4056 | continue; // assuming root type was checked elsewhere |
4087 | part.Scale.Z > m_scene.m_maxPhys ) | 4057 | |
4058 | if (checkShape) | ||
4059 | { | ||
4060 | if (--maxprims < 0) | ||
4088 | { | 4061 | { |
4089 | UsePhysics = false; // Reset physics | 4062 | UsePhysics = false; |
4090 | break; | 4063 | break; |
4091 | } | 4064 | } |
4092 | } | 4065 | } |
4093 | } | ||
4094 | 4066 | ||
4095 | if (parts.Length > 1) | 4067 | if (part.Scale.X > m_scene.m_maxPhys || |
4096 | { | 4068 | part.Scale.Y > m_scene.m_maxPhys || |
4097 | m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true); | 4069 | part.Scale.Z > m_scene.m_maxPhys ) |
4098 | |||
4099 | for (int i = 0; i < parts.Length; i++) | ||
4100 | { | 4070 | { |
4101 | 4071 | UsePhysics = false; // Reset physics | |
4102 | if (parts[i].UUID != m_rootPart.UUID) | 4072 | break; |
4103 | parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true); | ||
4104 | } | 4073 | } |
4074 | } | ||
4075 | } | ||
4105 | 4076 | ||
4106 | if (m_rootPart.PhysActor != null) | 4077 | if (parts.Length > 1) |
4107 | m_rootPart.PhysActor.Building = false; | 4078 | { |
4079 | m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true); | ||
4080 | |||
4081 | for (int i = 0; i < parts.Length; i++) | ||
4082 | { | ||
4083 | |||
4084 | if (parts[i].UUID != m_rootPart.UUID) | ||
4085 | parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true); | ||
4108 | } | 4086 | } |
4109 | else | 4087 | |
4110 | m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, false); | 4088 | if (m_rootPart.PhysActor != null) |
4089 | m_rootPart.PhysActor.Building = false; | ||
4111 | } | 4090 | } |
4091 | else | ||
4092 | m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, false); | ||
4093 | |||
4094 | m_scene.EventManager.TriggerParcelPrimCountTainted(); | ||
4112 | } | 4095 | } |
4113 | 4096 | ||
4114 | public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data) | 4097 | public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data) |