diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 130 |
1 files changed, 26 insertions, 104 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 1cfa8ed..c300b96 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1046,39 +1046,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
1046 | } | 1046 | } |
1047 | set | 1047 | set |
1048 | { | 1048 | { |
1049 | <<<<<<< HEAD | ||
1050 | if (Util.IsNanOrInfinity(value)) | 1049 | if (Util.IsNanOrInfinity(value)) |
1051 | m_angularVelocity = Vector3.Zero; | 1050 | m_angularVelocity = Vector3.Zero; |
1052 | else | 1051 | else |
1053 | m_angularVelocity = value; | 1052 | m_angularVelocity = value; |
1054 | 1053 | ||
1055 | PhysicsActor actor = PhysActor; | 1054 | PhysicsActor actor = PhysActor; |
1056 | if ((actor != null) && actor.IsPhysical) | ||
1057 | actor.RotationalVelocity = m_angularVelocity; | ||
1058 | ======= | ||
1059 | m_angularVelocity = value; | ||
1060 | PhysicsActor actor = PhysActor; | ||
1061 | if ((actor != null) && actor.IsPhysical && ParentGroup.RootPart == this && VehicleType == (int)Vehicle.TYPE_NONE) | 1055 | if ((actor != null) && actor.IsPhysical && ParentGroup.RootPart == this && VehicleType == (int)Vehicle.TYPE_NONE) |
1062 | { | 1056 | { |
1063 | actor.RotationalVelocity = m_angularVelocity; | 1057 | actor.RotationalVelocity = m_angularVelocity; |
1064 | } | 1058 | } |
1065 | >>>>>>> avn/ubitvar | ||
1066 | } | 1059 | } |
1067 | } | 1060 | } |
1068 | 1061 | ||
1069 | /// <summary></summary> | 1062 | /// <summary></summary> |
1070 | public Vector3 Acceleration | 1063 | public Vector3 Acceleration |
1071 | { | 1064 | { |
1072 | <<<<<<< HEAD | ||
1073 | get { return m_acceleration; } | ||
1074 | set | ||
1075 | { | ||
1076 | if (Util.IsNanOrInfinity(value)) | ||
1077 | m_acceleration = Vector3.Zero; | ||
1078 | else | ||
1079 | m_acceleration = value; | ||
1080 | } | ||
1081 | ======= | ||
1082 | get | 1065 | get |
1083 | { | 1066 | { |
1084 | PhysicsActor actor = PhysActor; | 1067 | PhysicsActor actor = PhysActor; |
@@ -1088,9 +1071,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1088 | } | 1071 | } |
1089 | return m_acceleration; | 1072 | return m_acceleration; |
1090 | } | 1073 | } |
1091 | 1074 | ||
1092 | set { m_acceleration = value; } | 1075 | set |
1093 | >>>>>>> avn/ubitvar | 1076 | { |
1077 | if (Util.IsNanOrInfinity(value)) | ||
1078 | m_acceleration = Vector3.Zero; | ||
1079 | else | ||
1080 | m_acceleration = value; | ||
1081 | } | ||
1094 | } | 1082 | } |
1095 | 1083 | ||
1096 | public string Description { get; set; } | 1084 | public string Description { get; set; } |
@@ -1431,7 +1419,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1431 | /// <value> | 1419 | /// <value> |
1432 | /// null if there are no sitting avatars. This is to save us create a hashset for every prim in a scene. | 1420 | /// null if there are no sitting avatars. This is to save us create a hashset for every prim in a scene. |
1433 | /// </value> | 1421 | /// </value> |
1434 | private HashSet<ScenePresence> m_sittingAvatars; | 1422 | private HashSet<UUID> m_sittingAvatars; |
1435 | 1423 | ||
1436 | public virtual UUID RegionID | 1424 | public virtual UUID RegionID |
1437 | { | 1425 | { |
@@ -1932,7 +1920,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1932 | 1920 | ||
1933 | public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim) | 1921 | public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim) |
1934 | { | 1922 | { |
1935 | <<<<<<< HEAD | ||
1936 | byte[] data; | 1923 | byte[] data; |
1937 | 1924 | ||
1938 | if (pTexAnim.Flags == Primitive.TextureAnimMode.ANIM_OFF) | 1925 | if (pTexAnim.Flags == Primitive.TextureAnimMode.ANIM_OFF) |
@@ -1944,13 +1931,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1944 | data = new byte[16]; | 1931 | data = new byte[16]; |
1945 | int pos = 0; | 1932 | int pos = 0; |
1946 | 1933 | ||
1947 | ======= | ||
1948 | if (((int)pTexAnim.Flags & 1) != 0) // ANIM_ON | ||
1949 | { | ||
1950 | byte[] data = new byte[16]; | ||
1951 | int pos = 0; | ||
1952 | |||
1953 | >>>>>>> avn/ubitvar | ||
1954 | // The flags don't like conversion from uint to byte, so we have to do | 1934 | // The flags don't like conversion from uint to byte, so we have to do |
1955 | // it the crappy way. See the above function :( | 1935 | // it the crappy way. See the above function :( |
1956 | 1936 | ||
@@ -1962,17 +1942,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1962 | Utils.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); | 1942 | Utils.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); |
1963 | Utils.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); | 1943 | Utils.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); |
1964 | Utils.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); | 1944 | Utils.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); |
1965 | <<<<<<< HEAD | 1945 | |
1966 | } | ||
1967 | ======= | ||
1968 | >>>>>>> avn/ubitvar | ||
1969 | |||
1970 | m_TextureAnimation = data; | ||
1971 | } | ||
1972 | else | ||
1973 | { | ||
1974 | m_TextureAnimation = Utils.EmptyBytes; | ||
1975 | } | 1946 | } |
1947 | m_TextureAnimation = data; | ||
1976 | } | 1948 | } |
1977 | 1949 | ||
1978 | public void AdjustSoundGain(double volume) | 1950 | public void AdjustSoundGain(double volume) |
@@ -2240,7 +2212,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2240 | Array.Copy(Shape.ExtraParams, extraP, extraP.Length); | 2212 | Array.Copy(Shape.ExtraParams, extraP, extraP.Length); |
2241 | dupe.Shape.ExtraParams = extraP; | 2213 | dupe.Shape.ExtraParams = extraP; |
2242 | 2214 | ||
2243 | dupe.m_sittingAvatars = new HashSet<ScenePresence>(); | 2215 | dupe.m_sittingAvatars = new HashSet<UUID>(); |
2244 | 2216 | ||
2245 | // safeguard actual copy is done in sog.copy | 2217 | // safeguard actual copy is done in sog.copy |
2246 | dupe.KeyframeMotion = null; | 2218 | dupe.KeyframeMotion = null; |
@@ -2829,7 +2801,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2829 | CollidingMessage = CreateColliderArgs(this, colliders); | 2801 | CollidingMessage = CreateColliderArgs(this, colliders); |
2830 | 2802 | ||
2831 | if (CollidingMessage.Colliders.Count > 0) | 2803 | if (CollidingMessage.Colliders.Count > 0) |
2832 | DoNotify(notify, LocalId, CollidingMessage); | 2804 | notify(LocalId, CollidingMessage); |
2833 | 2805 | ||
2834 | if (PassCollisions) | 2806 | if (PassCollisions) |
2835 | sendToRoot = true; | 2807 | sendToRoot = true; |
@@ -2843,7 +2815,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2843 | { | 2815 | { |
2844 | CollidingMessage = CreateColliderArgs(ParentGroup.RootPart, colliders); | 2816 | CollidingMessage = CreateColliderArgs(ParentGroup.RootPart, colliders); |
2845 | if (CollidingMessage.Colliders.Count > 0) | 2817 | if (CollidingMessage.Colliders.Count > 0) |
2846 | DoNotify(notify, ParentGroup.RootPart.LocalId, CollidingMessage); | 2818 | notify(ParentGroup.RootPart.LocalId, CollidingMessage); |
2847 | } | 2819 | } |
2848 | } | 2820 | } |
2849 | } | 2821 | } |
@@ -2858,35 +2830,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2858 | colliding.Add(CreateDetObjectForGround()); | 2830 | colliding.Add(CreateDetObjectForGround()); |
2859 | LandCollidingMessage.Colliders = colliding; | 2831 | LandCollidingMessage.Colliders = colliding; |
2860 | 2832 | ||
2861 | <<<<<<< HEAD | ||
2862 | DoNotify(notify, LocalId, LandCollidingMessage); | ||
2863 | } | ||
2864 | } | ||
2865 | |||
2866 | private void DoNotify(ScriptCollidingNotification notify, uint id, ColliderArgs collargs) | ||
2867 | { | ||
2868 | if (m_parentGroup != null && ParentGroup.Scene != null && ParentGroup.Scene.ShouldUseFireAndForgetForCollisions) | ||
2869 | { | ||
2870 | // For those learning C#, FireAndForget takes a function, an object to pass | ||
2871 | // to that function and an ID string. The "oo => {}" construct is a lambda expression | ||
2872 | // for a function with one arguement ('oo'). The 'new Object[] {}" construct creates an Object | ||
2873 | // that is an object array and initializes it with three items (the parameters | ||
2874 | // being passed). The parameters passed are the function to call ('notify') and | ||
2875 | // its two arguements. Finally, once in the function (called later by the FireAndForget | ||
2876 | // thread scheduler), the passed object is cast to an object array and then each | ||
2877 | // of its items (aoo[0] to aoo[2]) are individually cast to what they are and | ||
2878 | // then used in a call of the passed ScriptCollidingNotification function. | ||
2879 | Util.FireAndForget(oo => | ||
2880 | { | ||
2881 | Object[] aoo = (Object[])oo; | ||
2882 | ((ScriptCollidingNotification)aoo[0])((uint)aoo[1], (ColliderArgs)aoo[2]); | ||
2883 | |||
2884 | }, new Object[] { notify, id, collargs }, "SOP.Collision"); | ||
2885 | } | ||
2886 | else | ||
2887 | { | ||
2888 | notify(id, collargs); | ||
2889 | ======= | ||
2890 | if (Inventory.ContainsScripts()) | 2833 | if (Inventory.ContainsScripts()) |
2891 | { | 2834 | { |
2892 | if (!PassCollisions) | 2835 | if (!PassCollisions) |
@@ -2898,7 +2841,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2898 | if ((ParentGroup.RootPart.ScriptEvents & ev) != 0 && sendToRoot) | 2841 | if ((ParentGroup.RootPart.ScriptEvents & ev) != 0 && sendToRoot) |
2899 | { | 2842 | { |
2900 | notify(ParentGroup.RootPart.LocalId, LandCollidingMessage); | 2843 | notify(ParentGroup.RootPart.LocalId, LandCollidingMessage); |
2901 | >>>>>>> avn/ubitvar | ||
2902 | } | 2844 | } |
2903 | } | 2845 | } |
2904 | 2846 | ||
@@ -3046,12 +2988,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3046 | 2988 | ||
3047 | if (pa != null) | 2989 | if (pa != null) |
3048 | { | 2990 | { |
3049 | <<<<<<< HEAD | ||
3050 | Vector3 newpos = pa.Position; | 2991 | Vector3 newpos = pa.Position; |
3051 | ======= | ||
3052 | Vector3 newpos = new Vector3(pa.Position.GetBytes(), 0); | ||
3053 | |||
3054 | >>>>>>> avn/ubitvar | ||
3055 | if (!ParentGroup.Scene.PositionIsInCurrentRegion(newpos)) | 2992 | if (!ParentGroup.Scene.PositionIsInCurrentRegion(newpos)) |
3056 | { | 2993 | { |
3057 | // Setting position outside current region will start region crossing | 2994 | // Setting position outside current region will start region crossing |
@@ -3996,14 +3933,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3996 | 3933 | ||
3997 | public void StopMoveToTarget() | 3934 | public void StopMoveToTarget() |
3998 | { | 3935 | { |
3999 | <<<<<<< HEAD | ||
4000 | ParentGroup.StopMoveToTarget(); | 3936 | ParentGroup.StopMoveToTarget(); |
4001 | ======= | ||
4002 | ParentGroup.stopMoveToTarget(); | ||
4003 | |||
4004 | // ParentGroup.ScheduleGroupForTerseUpdate(); | ||
4005 | //ParentGroup.ScheduleGroupForFullUpdate(); | ||
4006 | >>>>>>> avn/ubitvar | ||
4007 | } | 3937 | } |
4008 | 3938 | ||
4009 | public void StoreUndoState(ObjectChangeType change) | 3939 | public void StoreUndoState(ObjectChangeType change) |
@@ -4665,8 +4595,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4665 | 4595 | ||
4666 | public void ClonePermissions(SceneObjectPart source) | 4596 | public void ClonePermissions(SceneObjectPart source) |
4667 | { | 4597 | { |
4668 | bool update = false; | ||
4669 | |||
4670 | uint prevOwnerMask = OwnerMask; | 4598 | uint prevOwnerMask = OwnerMask; |
4671 | uint prevGroupMask = GroupMask; | 4599 | uint prevGroupMask = GroupMask; |
4672 | uint prevEveryoneMask = EveryoneMask; | 4600 | uint prevEveryoneMask = EveryoneMask; |
@@ -4851,12 +4779,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4851 | } | 4779 | } |
4852 | else // it already has a physical representation | 4780 | else // it already has a physical representation |
4853 | { | 4781 | { |
4854 | <<<<<<< HEAD | 4782 | |
4855 | pa.SetMaterial(Material); | ||
4856 | pa.Position = GetWorldPosition(); | ||
4857 | pa.Orientation = GetWorldRotation(); | ||
4858 | DoPhysicsPropertyUpdate(UsePhysics, true); | ||
4859 | ======= | ||
4860 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. | 4783 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. |
4861 | /* moved into DoPhysicsPropertyUpdate | 4784 | /* moved into DoPhysicsPropertyUpdate |
4862 | if(VolumeDetectActive) | 4785 | if(VolumeDetectActive) |
@@ -4864,7 +4787,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4864 | else | 4787 | else |
4865 | pa.SetVolumeDetect(0); | 4788 | pa.SetVolumeDetect(0); |
4866 | */ | 4789 | */ |
4867 | >>>>>>> avn/ubitvar | ||
4868 | 4790 | ||
4869 | if (pa.Building != building) | 4791 | if (pa.Building != building) |
4870 | pa.Building = building; | 4792 | pa.Building = building; |
@@ -5621,19 +5543,19 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5621 | /// true if the avatar was not already recorded, false otherwise. | 5543 | /// true if the avatar was not already recorded, false otherwise. |
5622 | /// </returns> | 5544 | /// </returns> |
5623 | /// <param name='avatarId'></param> | 5545 | /// <param name='avatarId'></param> |
5624 | protected internal bool AddSittingAvatar(ScenePresence sp) | 5546 | protected internal bool AddSittingAvatar(UUID id) |
5625 | { | 5547 | { |
5626 | lock (ParentGroup.m_sittingAvatars) | 5548 | lock (ParentGroup.m_sittingAvatars) |
5627 | { | 5549 | { |
5628 | if (IsSitTargetSet && SitTargetAvatar == UUID.Zero) | 5550 | if (IsSitTargetSet && SitTargetAvatar == UUID.Zero) |
5629 | SitTargetAvatar = sp.UUID; | 5551 | SitTargetAvatar = id; |
5630 | 5552 | ||
5631 | if (m_sittingAvatars == null) | 5553 | if (m_sittingAvatars == null) |
5632 | m_sittingAvatars = new HashSet<ScenePresence>(); | 5554 | m_sittingAvatars = new HashSet<UUID>(); |
5633 | 5555 | ||
5634 | if (m_sittingAvatars.Add(sp)) | 5556 | if (m_sittingAvatars.Add(id)) |
5635 | { | 5557 | { |
5636 | ParentGroup.m_sittingAvatars.Add(sp); | 5558 | ParentGroup.m_sittingAvatars.Add(id); |
5637 | 5559 | ||
5638 | return true; | 5560 | return true; |
5639 | } | 5561 | } |
@@ -5650,22 +5572,22 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5650 | /// true if the avatar was present and removed, false if it was not present. | 5572 | /// true if the avatar was present and removed, false if it was not present. |
5651 | /// </returns> | 5573 | /// </returns> |
5652 | /// <param name='avatarId'></param> | 5574 | /// <param name='avatarId'></param> |
5653 | protected internal bool RemoveSittingAvatar(ScenePresence sp) | 5575 | protected internal bool RemoveSittingAvatar(UUID id) |
5654 | { | 5576 | { |
5655 | lock (ParentGroup.m_sittingAvatars) | 5577 | lock (ParentGroup.m_sittingAvatars) |
5656 | { | 5578 | { |
5657 | if (SitTargetAvatar == sp.UUID) | 5579 | if (SitTargetAvatar == id) |
5658 | SitTargetAvatar = UUID.Zero; | 5580 | SitTargetAvatar = UUID.Zero; |
5659 | 5581 | ||
5660 | if (m_sittingAvatars == null) | 5582 | if (m_sittingAvatars == null) |
5661 | return false; | 5583 | return false; |
5662 | 5584 | ||
5663 | if (m_sittingAvatars.Remove(sp)) | 5585 | if (m_sittingAvatars.Remove(id)) |
5664 | { | 5586 | { |
5665 | if (m_sittingAvatars.Count == 0) | 5587 | if (m_sittingAvatars.Count == 0) |
5666 | m_sittingAvatars = null; | 5588 | m_sittingAvatars = null; |
5667 | 5589 | ||
5668 | ParentGroup.m_sittingAvatars.Remove(sp); | 5590 | ParentGroup.m_sittingAvatars.Remove(id); |
5669 | 5591 | ||
5670 | return true; | 5592 | return true; |
5671 | } | 5593 | } |
@@ -5679,14 +5601,14 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5679 | /// </summary> | 5601 | /// </summary> |
5680 | /// <remarks>This applies to all sitting avatars whether there is a sit target set or not.</remarks> | 5602 | /// <remarks>This applies to all sitting avatars whether there is a sit target set or not.</remarks> |
5681 | /// <returns>A hashset of the sitting avatars. Returns null if there are no sitting avatars.</returns> | 5603 | /// <returns>A hashset of the sitting avatars. Returns null if there are no sitting avatars.</returns> |
5682 | public HashSet<ScenePresence> GetSittingAvatars() | 5604 | public HashSet<UUID> GetSittingAvatars() |
5683 | { | 5605 | { |
5684 | lock (ParentGroup.m_sittingAvatars) | 5606 | lock (ParentGroup.m_sittingAvatars) |
5685 | { | 5607 | { |
5686 | if (m_sittingAvatars == null) | 5608 | if (m_sittingAvatars == null) |
5687 | return null; | 5609 | return null; |
5688 | else | 5610 | else |
5689 | return new HashSet<ScenePresence>(m_sittingAvatars); | 5611 | return new HashSet<UUID>(m_sittingAvatars); |
5690 | } | 5612 | } |
5691 | } | 5613 | } |
5692 | 5614 | ||