aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorUbitUmarov2016-08-05 22:50:15 +0100
committerUbitUmarov2016-08-05 22:50:15 +0100
commit9102f6e5da1731aab9d1f9a449dce781ffd0ba36 (patch)
tree4f70e80611b1ea0aa5eaee19bdca735f615d1cde /OpenSim/Region/Framework
parent remove country from avatars DetectParams, since it is only used on a cm func... (diff)
downloadopensim-SC_OLD-9102f6e5da1731aab9d1f9a449dce781ffd0ba36.zip
opensim-SC_OLD-9102f6e5da1731aab9d1f9a449dce781ffd0ba36.tar.gz
opensim-SC_OLD-9102f6e5da1731aab9d1f9a449dce781ffd0ba36.tar.bz2
opensim-SC_OLD-9102f6e5da1731aab9d1f9a449dce781ffd0ba36.tar.xz
fill data for llDetected funtions of collisions closer to the event. (xengine wasn't update with this on merge bc was not used there). fix some parameters
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs52
2 files changed, 42 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 0b8076a..0847b0b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2712,8 +2712,7 @@ namespace OpenSim.Region.Framework.Scenes
2712 detobj.velVector = obj.Velocity; 2712 detobj.velVector = obj.Velocity;
2713 detobj.colliderType = 0; 2713 detobj.colliderType = 0;
2714 detobj.groupUUID = obj.GroupID; 2714 detobj.groupUUID = obj.GroupID;
2715 detobj.linkNumber = LinkNum; // pass my link number 2715 detobj.linkNumber = LinkNum;
2716
2717 return detobj; 2716 return detobj;
2718 } 2717 }
2719 2718
@@ -2726,9 +2725,13 @@ namespace OpenSim.Region.Framework.Scenes
2726 detobj.posVector = av.AbsolutePosition; 2725 detobj.posVector = av.AbsolutePosition;
2727 detobj.rotQuat = av.Rotation; 2726 detobj.rotQuat = av.Rotation;
2728 detobj.velVector = av.Velocity; 2727 detobj.velVector = av.Velocity;
2729 detobj.colliderType = 0; 2728 detobj.colliderType = av.isNPC ? 0x20 : 0x1; // OpenSim\Region\ScriptEngine\Shared\Helpers.cs
2729 if(av.IsSatOnObject)
2730 detobj.colliderType |= 0x4; //passive
2731 else if(detobj.velVector != Vector3.Zero)
2732 detobj.colliderType |= 0x2; //active
2730 detobj.groupUUID = av.ControllingClient.ActiveGroupId; 2733 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
2731 detobj.linkNumber = LinkNum; // pass my link number 2734 detobj.linkNumber = LinkNum;
2732 2735
2733 return detobj; 2736 return detobj;
2734 } 2737 }
@@ -2842,7 +2845,8 @@ namespace OpenSim.Region.Framework.Scenes
2842 if (ParentGroup.Scene == null || ParentGroup.IsDeleted) 2845 if (ParentGroup.Scene == null || ParentGroup.IsDeleted)
2843 return; 2846 return;
2844 2847
2845 // single threaded here 2848 // this a thread from physics ( heartbeat )
2849
2846 CollisionEventUpdate a = (CollisionEventUpdate)e; 2850 CollisionEventUpdate a = (CollisionEventUpdate)e;
2847 Dictionary<uint, ContactPoint> collissionswith = a.m_objCollisionList; 2851 Dictionary<uint, ContactPoint> collissionswith = a.m_objCollisionList;
2848 List<uint> thisHitColliders = new List<uint>(); 2852 List<uint> thisHitColliders = new List<uint>();
@@ -2860,7 +2864,6 @@ namespace OpenSim.Region.Framework.Scenes
2860 } 2864 }
2861 m_lastColliders.Clear(); 2865 m_lastColliders.Clear();
2862 } 2866 }
2863
2864 else 2867 else
2865 { 2868 {
2866 List<CollisionForSoundInfo> soundinfolist = new List<CollisionForSoundInfo>(); 2869 List<CollisionForSoundInfo> soundinfolist = new List<CollisionForSoundInfo>();
@@ -5256,7 +5259,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
5256 { 5259 {
5257 // subscribe to physics updates. 5260 // subscribe to physics updates.
5258 pa.OnCollisionUpdate += PhysicsCollision; 5261 pa.OnCollisionUpdate += PhysicsCollision;
5259 pa.SubscribeEvents(50); // 20 reports per second 5262 pa.SubscribeEvents(100); // 10 reports per second
5260 } 5263 }
5261 else 5264 else
5262 { 5265 {
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 3d8aad7..732d5ef 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -6037,7 +6037,11 @@ namespace OpenSim.Region.Framework.Scenes
6037 detobj.posVector = av.AbsolutePosition; 6037 detobj.posVector = av.AbsolutePosition;
6038 detobj.rotQuat = av.Rotation; 6038 detobj.rotQuat = av.Rotation;
6039 detobj.velVector = av.Velocity; 6039 detobj.velVector = av.Velocity;
6040 detobj.colliderType = 0; 6040 detobj.colliderType = av.isNPC ? 0x20 : 0x1; // OpenSim\Region\ScriptEngine\Shared\Helpers.cs
6041 if(av.IsSatOnObject)
6042 detobj.colliderType |= 0x4; //passive
6043 else if(detobj.velVector != Vector3.Zero)
6044 detobj.colliderType |= 0x2; //active
6041 detobj.groupUUID = av.ControllingClient.ActiveGroupId; 6045 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
6042 detobj.linkNumber = 0; 6046 detobj.linkNumber = 0;
6043 6047
@@ -6129,9 +6133,6 @@ namespace OpenSim.Region.Framework.Scenes
6129 List<uint> thisHitColliders = new List<uint>(); 6133 List<uint> thisHitColliders = new List<uint>();
6130 List<uint> endedColliders = new List<uint>(); 6134 List<uint> endedColliders = new List<uint>();
6131 List<uint> startedColliders = new List<uint>(); 6135 List<uint> startedColliders = new List<uint>();
6132 List<CollisionForSoundInfo> soundinfolist = new List<CollisionForSoundInfo>();
6133 CollisionForSoundInfo soundinfo;
6134 ContactPoint curcontact;
6135 6136
6136 if (coldata.Count == 0) 6137 if (coldata.Count == 0)
6137 { 6138 {
@@ -6144,30 +6145,41 @@ namespace OpenSim.Region.Framework.Scenes
6144 } 6145 }
6145 m_lastColliders.Clear(); 6146 m_lastColliders.Clear();
6146 } 6147 }
6147
6148 else 6148 else
6149 { 6149 {
6150 bool candoparcelSound = ParcelAllowThisAvatarSounds; 6150 List<CollisionForSoundInfo> soundinfolist = new List<CollisionForSoundInfo>();
6151 6151 if(ParcelAllowThisAvatarSounds)
6152 foreach (uint id in coldata.Keys)
6153 { 6152 {
6154 thisHitColliders.Add(id); 6153 CollisionForSoundInfo soundinfo;
6155 if (!m_lastColliders.Contains(id)) 6154 ContactPoint curcontact;
6155
6156 foreach (uint id in coldata.Keys)
6156 { 6157 {
6157 startedColliders.Add(id); 6158 thisHitColliders.Add(id);
6158 curcontact = coldata[id]; 6159 if (!m_lastColliders.Contains(id))
6159 if (candoparcelSound && Math.Abs(curcontact.RelativeSpeed) > 0.2)
6160 { 6160 {
6161 soundinfo = new CollisionForSoundInfo(); 6161 startedColliders.Add(id);
6162 soundinfo.colliderID = id; 6162 curcontact = coldata[id];
6163 soundinfo.position = curcontact.Position; 6163 if (Math.Abs(curcontact.RelativeSpeed) > 0.2)
6164 soundinfo.relativeVel = curcontact.RelativeSpeed; 6164 {
6165 soundinfolist.Add(soundinfo); 6165 soundinfo = new CollisionForSoundInfo();
6166 soundinfo.colliderID = id;
6167 soundinfo.position = curcontact.Position;
6168 soundinfo.relativeVel = curcontact.RelativeSpeed;
6169 soundinfolist.Add(soundinfo);
6170 }
6166 } 6171 }
6167 } 6172 }
6168 //m_log.Debug("[SCENE PRESENCE]: Collided with:" + localid.ToString() + " at depth of: " + collissionswith[localid].ToString());
6169 } 6173 }
6170 6174 else
6175 {
6176 foreach (uint id in coldata.Keys)
6177 {
6178 thisHitColliders.Add(id);
6179 if (!m_lastColliders.Contains(id))
6180 startedColliders.Add(id);
6181 }
6182 }
6171 // calculate things that ended colliding 6183 // calculate things that ended colliding
6172 foreach (uint localID in m_lastColliders) 6184 foreach (uint localID in m_lastColliders)
6173 { 6185 {