diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 66 | ||||
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 119 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 111 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 49 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 6 |
5 files changed, 227 insertions, 124 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index 5669c43..97009a0 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -274,50 +274,46 @@ namespace OpenSim.Region.Framework.Scenes | |||
274 | 274 | ||
275 | private uint GetPriorityByAngularDistance(IClientAPI client, ISceneEntity entity) | 275 | private uint GetPriorityByAngularDistance(IClientAPI client, ISceneEntity entity) |
276 | { | 276 | { |
277 | uint pqueue = 2; // keep compiler happy | ||
278 | |||
279 | ScenePresence presence = m_scene.GetScenePresence(client.AgentId); | 277 | ScenePresence presence = m_scene.GetScenePresence(client.AgentId); |
280 | if (presence == null) | 278 | if (presence == null) |
281 | return PriorityQueue.NumberOfQueues - 1; | 279 | return PriorityQueue.NumberOfQueues - 1; |
282 | 280 | ||
283 | // All avatars other than our own go into pqueue 1 | 281 | uint pqueue = ComputeAngleDistancePriority(presence, entity); |
284 | if (entity is ScenePresence) | ||
285 | return 1; | ||
286 | |||
287 | if (entity is SceneObjectPart) | ||
288 | { | ||
289 | // Attachments are high priority, | ||
290 | if (((SceneObjectPart)entity).ParentGroup.IsAttachment) | ||
291 | return 2; | ||
292 | |||
293 | pqueue = ComputeAngleDistancePriority(presence, entity); | ||
294 | |||
295 | // Non physical prims are lower priority than physical prims | ||
296 | PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor; | ||
297 | if (physActor == null || !physActor.IsPhysical) | ||
298 | pqueue++; | ||
299 | } | ||
300 | |||
301 | return pqueue; | 282 | return pqueue; |
302 | } | 283 | } |
303 | 284 | ||
304 | private uint ComputeAngleDistancePriority(ScenePresence presence, ISceneEntity entity) | 285 | private uint ComputeAngleDistancePriority(ScenePresence presence, ISceneEntity entity) |
305 | { | 286 | { |
306 | double distance; | ||
307 | |||
308 | Vector3 presencePos = presence.AbsolutePosition; | ||
309 | |||
310 | SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup; | ||
311 | float bradius = group.GetBoundsRadius(); | ||
312 | Vector3 grppos = group.AbsolutePosition + group.getBoundsCenter(); | ||
313 | distance = Vector3.Distance(presencePos, grppos); | ||
314 | distance -= bradius; | ||
315 | distance *= group.getAreaFactor(); | ||
316 | |||
317 | // And convert the distance to a priority queue, this computation gives queues | 287 | // And convert the distance to a priority queue, this computation gives queues |
318 | // at 10, 20, 40, 80, 160, 320, 640, and 1280m | 288 | // at 10, 20, 40, 80, 160, 320, 640, and 1280m |
319 | uint pqueue = PriorityQueue.NumberOfImmediateQueues + 1; // reserve attachments queue | 289 | // uint minpqueue = PriorityQueue.NumberOfImmediateQueues; |
320 | uint queues = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues; | 290 | uint maxqueue = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues -1; |
291 | // uint pqueue = minpqueue; | ||
292 | uint pqueue = PriorityQueue.NumberOfImmediateQueues; | ||
293 | float distance; | ||
294 | |||
295 | Vector3 presencePos = presence.AbsolutePosition; | ||
296 | if(entity is ScenePresence) | ||
297 | { | ||
298 | ScenePresence sp = entity as ScenePresence; | ||
299 | distance = Vector3.Distance(presencePos, sp.AbsolutePosition); | ||
300 | distance *= 0.5f; | ||
301 | } | ||
302 | else | ||
303 | { | ||
304 | SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup; | ||
305 | float bradius = group.GetBoundsRadius(); | ||
306 | Vector3 grppos = group.AbsolutePosition + group.getBoundsCenter(); | ||
307 | distance = Vector3.Distance(presencePos, grppos); | ||
308 | distance -= bradius; | ||
309 | distance *= group.getAreaFactor(); | ||
310 | if(group.IsAttachment) | ||
311 | distance *= 0.5f; | ||
312 | else if(group.UsesPhysics) | ||
313 | distance *= 0.6f; | ||
314 | else if(group.GetSittingAvatarsCount() > 0) | ||
315 | distance *= 0.5f; | ||
316 | } | ||
321 | 317 | ||
322 | if (distance > 10f) | 318 | if (distance > 10f) |
323 | { | 319 | { |
@@ -328,8 +324,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
328 | // 2st constant makes it be log2(distance/10) | 324 | // 2st constant makes it be log2(distance/10) |
329 | 325 | ||
330 | pqueue += (uint)tmp; | 326 | pqueue += (uint)tmp; |
331 | if (pqueue > queues - 1) | 327 | if (pqueue > maxqueue) |
332 | pqueue = queues - 1; | 328 | pqueue = maxqueue; |
333 | } | 329 | } |
334 | 330 | ||
335 | return pqueue; | 331 | return pqueue; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 77c66b6..238ec8e 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1865,7 +1865,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1865 | 1865 | ||
1866 | // this is here so physics gets updated! | 1866 | // this is here so physics gets updated! |
1867 | // Don't remove! Bad juju! Stay away! or fix physics! | 1867 | // Don't remove! Bad juju! Stay away! or fix physics! |
1868 | child.AbsolutePosition = child.AbsolutePosition; | 1868 | // already done in LinkToGroup |
1869 | // child.AbsolutePosition = child.AbsolutePosition; | ||
1869 | } | 1870 | } |
1870 | } | 1871 | } |
1871 | 1872 | ||
@@ -1912,31 +1913,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
1912 | // | 1913 | // |
1913 | foreach (SceneObjectPart part in prims) | 1914 | foreach (SceneObjectPart part in prims) |
1914 | { | 1915 | { |
1915 | if (part != null) | 1916 | if(part == null) |
1917 | continue; | ||
1918 | SceneObjectGroup parentSOG = part.ParentGroup; | ||
1919 | if(parentSOG == null || | ||
1920 | parentSOG.IsDeleted || | ||
1921 | parentSOG.inTransit || | ||
1922 | parentSOG.PrimCount == 1) | ||
1923 | continue; | ||
1924 | |||
1925 | if (!affectedGroups.Contains(parentSOG)) | ||
1916 | { | 1926 | { |
1917 | if (part.KeyframeMotion != null) | 1927 | affectedGroups.Add(parentSOG); |
1918 | { | 1928 | if(parentSOG.RootPart.PhysActor != null) |
1919 | part.KeyframeMotion.Stop(); | 1929 | parentSOG.RootPart.PhysActor.Building = true; |
1920 | part.KeyframeMotion = null; | 1930 | } |
1921 | } | ||
1922 | if (part.ParentGroup.PrimCount != 1) // Skip single | ||
1923 | { | ||
1924 | if (part.LinkNum < 2) // Root | ||
1925 | { | ||
1926 | rootParts.Add(part); | ||
1927 | } | ||
1928 | else | ||
1929 | { | ||
1930 | part.LastOwnerID = part.ParentGroup.RootPart.LastOwnerID; | ||
1931 | childParts.Add(part); | ||
1932 | } | ||
1933 | 1931 | ||
1934 | SceneObjectGroup group = part.ParentGroup; | 1932 | if (part.KeyframeMotion != null) |
1935 | if (!affectedGroups.Contains(group)) | 1933 | { |
1936 | { | 1934 | part.KeyframeMotion.Stop(); |
1937 | affectedGroups.Add(group); | 1935 | part.KeyframeMotion = null; |
1938 | } | 1936 | } |
1939 | } | 1937 | |
1938 | if (part.LinkNum < 2) // Root | ||
1939 | { | ||
1940 | rootParts.Add(part); | ||
1941 | } | ||
1942 | else | ||
1943 | { | ||
1944 | part.LastOwnerID = part.ParentGroup.RootPart.LastOwnerID; | ||
1945 | childParts.Add(part); | ||
1940 | } | 1946 | } |
1941 | } | 1947 | } |
1942 | 1948 | ||
@@ -1945,8 +1951,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1945 | foreach (SceneObjectPart child in childParts) | 1951 | foreach (SceneObjectPart child in childParts) |
1946 | { | 1952 | { |
1947 | // Unlink all child parts from their groups | 1953 | // Unlink all child parts from their groups |
1948 | // | ||
1949 | child.ParentGroup.DelinkFromGroup(child, true); | 1954 | child.ParentGroup.DelinkFromGroup(child, true); |
1955 | //child.ParentGroup is now other | ||
1950 | child.ParentGroup.HasGroupChanged = true; | 1956 | child.ParentGroup.HasGroupChanged = true; |
1951 | child.ParentGroup.ScheduleGroupForFullUpdate(); | 1957 | child.ParentGroup.ScheduleGroupForFullUpdate(); |
1952 | } | 1958 | } |
@@ -1959,74 +1965,51 @@ namespace OpenSim.Region.Framework.Scenes | |||
1959 | // However, editing linked parts and unlinking may be different | 1965 | // However, editing linked parts and unlinking may be different |
1960 | // | 1966 | // |
1961 | SceneObjectGroup group = root.ParentGroup; | 1967 | SceneObjectGroup group = root.ParentGroup; |
1962 | 1968 | ||
1963 | List<SceneObjectPart> newSet = new List<SceneObjectPart>(group.Parts); | 1969 | List<SceneObjectPart> newSet = new List<SceneObjectPart>(group.Parts); |
1964 | int numChildren = newSet.Count; | ||
1965 | 1970 | ||
1966 | if (numChildren == 1) | 1971 | newSet.Remove(root); |
1972 | int numChildren = newSet.Count; | ||
1973 | if(numChildren == 0) | ||
1967 | break; | 1974 | break; |
1968 | 1975 | ||
1969 | // If there are prims left in a link set, but the root is | ||
1970 | // slated for unlink, we need to do this | ||
1971 | // Unlink the remaining set | ||
1972 | // | ||
1973 | bool sendEventsToRemainder = false; | ||
1974 | if (numChildren == 2) // only one child prim no re-link needed | ||
1975 | sendEventsToRemainder = true; | ||
1976 | |||
1977 | foreach (SceneObjectPart p in newSet) | 1976 | foreach (SceneObjectPart p in newSet) |
1978 | { | 1977 | group.DelinkFromGroup(p, false); |
1979 | if (p != group.RootPart) | ||
1980 | { | ||
1981 | group.DelinkFromGroup(p, sendEventsToRemainder); | ||
1982 | if (sendEventsToRemainder) // finish single child prim now | ||
1983 | { | ||
1984 | p.ParentGroup.HasGroupChanged = true; | ||
1985 | p.ParentGroup.ScheduleGroupForFullUpdate(); | ||
1986 | } | ||
1987 | } | ||
1988 | } | ||
1989 | 1978 | ||
1979 | SceneObjectPart newRoot = newSet[0]; | ||
1980 | |||
1990 | // If there is more than one prim remaining, we | 1981 | // If there is more than one prim remaining, we |
1991 | // need to re-link | 1982 | // need to re-link |
1992 | // | 1983 | // |
1993 | if (numChildren > 2) | 1984 | if (numChildren > 1) |
1994 | { | 1985 | { |
1995 | // Remove old root | ||
1996 | // | ||
1997 | if (newSet.Contains(root)) | ||
1998 | newSet.Remove(root); | ||
1999 | |||
2000 | // Preserve link ordering | ||
2001 | // | ||
2002 | newSet.Sort(delegate (SceneObjectPart a, SceneObjectPart b) | ||
2003 | { | ||
2004 | return a.LinkNum.CompareTo(b.LinkNum); | ||
2005 | }); | ||
2006 | |||
2007 | // Determine new root | 1986 | // Determine new root |
2008 | // | 1987 | // |
2009 | SceneObjectPart newRoot = newSet[0]; | ||
2010 | newSet.RemoveAt(0); | 1988 | newSet.RemoveAt(0); |
2011 | 1989 | foreach (SceneObjectPart newChild in newSet) | |
2012 | foreach (SceneObjectPart newChild in newSet) | 1990 | newChild.ClearUpdateSchedule(); |
2013 | newChild.ClearUpdateSchedule(); | ||
2014 | 1991 | ||
2015 | LinkObjects(newRoot, newSet); | 1992 | LinkObjects(newRoot, newSet); |
2016 | // if (!affectedGroups.Contains(newRoot.ParentGroup)) | 1993 | } |
2017 | // affectedGroups.Add(newRoot.ParentGroup); | 1994 | else |
1995 | { | ||
1996 | newRoot.TriggerScriptChangedEvent(Changed.LINK); | ||
1997 | newRoot.ParentGroup.HasGroupChanged = true; | ||
1998 | newRoot.ParentGroup.ScheduleGroupForFullUpdate(); | ||
2018 | } | 1999 | } |
2019 | } | 2000 | } |
2020 | 2001 | ||
2021 | // Finally, trigger events in the roots | 2002 | // trigger events in the roots |
2022 | // | 2003 | // |
2023 | foreach (SceneObjectGroup g in affectedGroups) | 2004 | foreach (SceneObjectGroup g in affectedGroups) |
2024 | { | 2005 | { |
2006 | if(g.RootPart.PhysActor != null) | ||
2007 | g.RootPart.PhysActor.Building = false; | ||
2008 | g.AdjustChildPrimPermissions(false); | ||
2025 | // Child prims that have been unlinked and deleted will | 2009 | // Child prims that have been unlinked and deleted will |
2026 | // return unless the root is deleted. This will remove them | 2010 | // return unless the root is deleted. This will remove them |
2027 | // from the database. They will be rewritten immediately, | 2011 | // from the database. They will be rewritten immediately, |
2028 | // minus the rows for the unlinked child prims. | 2012 | // minus the rows for the unlinked child prims. |
2029 | g.AdjustChildPrimPermissions(false); | ||
2030 | m_parentScene.SimulationDataService.RemoveObject(g.UUID, m_parentScene.RegionInfo.RegionID); | 2013 | m_parentScene.SimulationDataService.RemoveObject(g.UUID, m_parentScene.RegionInfo.RegionID); |
2031 | g.TriggerScriptChangedEvent(Changed.LINK); | 2014 | g.TriggerScriptChangedEvent(Changed.LINK); |
2032 | g.HasGroupChanged = true; // Persist | 2015 | g.HasGroupChanged = true; // Persist |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 17dfb85..53a9441 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -3168,10 +3168,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3168 | if (insert) | 3168 | if (insert) |
3169 | { | 3169 | { |
3170 | linkNum = 2; | 3170 | linkNum = 2; |
3171 | int insertSize = objectGroup.PrimCount; | ||
3171 | foreach (SceneObjectPart part in Parts) | 3172 | foreach (SceneObjectPart part in Parts) |
3172 | { | 3173 | { |
3173 | if (part.LinkNum > 1) | 3174 | if (part.LinkNum > 1) |
3174 | part.LinkNum++; | 3175 | part.LinkNum += insertSize; |
3175 | } | 3176 | } |
3176 | } | 3177 | } |
3177 | else | 3178 | else |
@@ -3200,14 +3201,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3200 | linkPart.LinkNum = linkNum++; | 3201 | linkPart.LinkNum = linkNum++; |
3201 | linkPart.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect, false); | 3202 | linkPart.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect, false); |
3202 | 3203 | ||
3203 | // Get a list of the SOP's in the old group in order of their linknum's. | 3204 | // Get a list of the SOP's in the source group in order of their linknum's. |
3204 | SceneObjectPart[] ogParts = objectGroup.Parts; | 3205 | SceneObjectPart[] ogParts = objectGroup.Parts; |
3205 | Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b) | 3206 | Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b) |
3206 | { | 3207 | { |
3207 | return a.LinkNum - b.LinkNum; | 3208 | return a.LinkNum - b.LinkNum; |
3208 | }); | 3209 | }); |
3209 | 3210 | ||
3210 | // Add each of the SOP's from the old linkset to our linkset | 3211 | // Add each of the SOP's from the source linkset to our linkset |
3211 | for (int i = 0; i < ogParts.Length; i++) | 3212 | for (int i = 0; i < ogParts.Length; i++) |
3212 | { | 3213 | { |
3213 | SceneObjectPart part = ogParts[i]; | 3214 | SceneObjectPart part = ogParts[i]; |
@@ -3415,6 +3416,110 @@ namespace OpenSim.Region.Framework.Scenes | |||
3415 | return objectGroup; | 3416 | return objectGroup; |
3416 | } | 3417 | } |
3417 | 3418 | ||
3419 | /* working on it | ||
3420 | public void DelinkFromGroup(List<SceneObjectPart> linkParts, bool sendEvents) | ||
3421 | { | ||
3422 | // m_log.DebugFormat( | ||
3423 | // "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}", | ||
3424 | // linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID); | ||
3425 | |||
3426 | if(PrimCount == 1) | ||
3427 | return; | ||
3428 | |||
3429 | if (m_rootPart.PhysActor != null) | ||
3430 | m_rootPart.PhysActor.Building = true; | ||
3431 | |||
3432 | bool unlinkroot = false; | ||
3433 | foreach(SceneObjectPart linkPart in linkParts) | ||
3434 | { | ||
3435 | // first we only remove child parts | ||
3436 | if(linkPart.LocalId == m_rootPart.LocalId) | ||
3437 | { | ||
3438 | unlinkroot = true; | ||
3439 | continue; | ||
3440 | } | ||
3441 | |||
3442 | lock (m_parts.SyncRoot) | ||
3443 | if(!m_parts.Remove(linkPart.UUID)) | ||
3444 | continue; | ||
3445 | |||
3446 | linkPart.ClearUndoState(); | ||
3447 | |||
3448 | Vector3 worldPos = linkPart.GetWorldPosition(); | ||
3449 | Quaternion worldRot = linkPart.GetWorldRotation(); | ||
3450 | |||
3451 | linkPart.ParentID = 0; | ||
3452 | linkPart.LinkNum = 0; | ||
3453 | |||
3454 | PhysicsActor linkPartPa = linkPart.PhysActor; | ||
3455 | |||
3456 | // Remove the SOP from the physical scene. | ||
3457 | // If the new SOG is physical, it is re-created later. | ||
3458 | // (There is a problem here in that we have not yet told the physics | ||
3459 | // engine about the delink. Someday, linksets should be made first | ||
3460 | // class objects in the physics engine interface). | ||
3461 | if (linkPartPa != null) | ||
3462 | { | ||
3463 | m_scene.PhysicsScene.RemovePrim(linkPartPa); | ||
3464 | linkPart.PhysActor = null; | ||
3465 | } | ||
3466 | |||
3467 | linkPart.setGroupPosition(worldPos); | ||
3468 | linkPart.setOffsetPosition(Vector3.Zero); | ||
3469 | linkPart.setRotationOffset(worldRot); | ||
3470 | |||
3471 | // Create a new SOG to go around this unlinked and unattached SOP | ||
3472 | SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart); | ||
3473 | |||
3474 | m_scene.AddNewSceneObject(objectGroup, true); | ||
3475 | |||
3476 | linkPart.Rezzed = RootPart.Rezzed; | ||
3477 | |||
3478 | // this is as it seems to be in sl now | ||
3479 | if(linkPart.PhysicsShapeType == (byte)PhysShapeType.none) | ||
3480 | linkPart.PhysicsShapeType = linkPart.DefaultPhysicsShapeType(); // root prims can't have type none for now | ||
3481 | |||
3482 | objectGroup.HasGroupChangedDueToDelink = true; | ||
3483 | if (sendEvents) | ||
3484 | linkPart.TriggerScriptChangedEvent(Changed.LINK); | ||
3485 | } | ||
3486 | |||
3487 | if(unlinkroot) | ||
3488 | { | ||
3489 | //TODO | ||
3490 | } | ||
3491 | |||
3492 | lock (m_parts.SyncRoot) | ||
3493 | { | ||
3494 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
3495 | if (parts.Length == 1) | ||
3496 | { | ||
3497 | // Single prim left | ||
3498 | m_rootPart.LinkNum = 0; | ||
3499 | } | ||
3500 | else | ||
3501 | { | ||
3502 | m_rootPart.LinkNum = 1; | ||
3503 | int linknum = 2; | ||
3504 | for (int i = 1; i < parts.Length; i++) | ||
3505 | parts[i].LinkNum = linknum++; | ||
3506 | } | ||
3507 | } | ||
3508 | |||
3509 | InvalidBoundsRadius(); | ||
3510 | |||
3511 | if (m_rootPart.PhysActor != null) | ||
3512 | m_rootPart.PhysActor.Building = false; | ||
3513 | |||
3514 | // When we delete a group, we currently have to force persist to the database if the object id has changed | ||
3515 | // (since delete works by deleting all rows which have a given object id) | ||
3516 | |||
3517 | Scene.SimulationDataService.RemoveObject(UUID, Scene.RegionInfo.RegionID); | ||
3518 | HasGroupChangedDueToDelink = true; | ||
3519 | TriggerScriptChangedEvent(Changed.LINK); | ||
3520 | return; | ||
3521 | } | ||
3522 | */ | ||
3418 | /// <summary> | 3523 | /// <summary> |
3419 | /// Stop this object from being persisted over server restarts. | 3524 | /// Stop this object from being persisted over server restarts. |
3420 | /// </summary> | 3525 | /// </summary> |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index bb6e89b..6f4d6c3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -281,7 +281,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
281 | 281 | ||
282 | private bool m_followCamAuto = false; | 282 | private bool m_followCamAuto = false; |
283 | 283 | ||
284 | private Vector3? m_forceToApply; | 284 | // private object m_forceToApplyLock = new object(); |
285 | // private bool m_forceToApplyValid; | ||
286 | // private Vector3 m_forceToApply; | ||
285 | private int m_userFlags; | 287 | private int m_userFlags; |
286 | public int UserFlags | 288 | public int UserFlags |
287 | { | 289 | { |
@@ -582,11 +584,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
582 | { | 584 | { |
583 | get | 585 | get |
584 | { | 586 | { |
585 | return m_drawDistance; | 587 | return m_drawDistance; |
586 | } | 588 | } |
587 | set | 589 | set |
588 | { | 590 | { |
589 | m_drawDistance = Util.Clamp(value, 32f, m_scene.MaxDrawDistance); | 591 | m_drawDistance = Util.Clamp(value, 32f, m_scene.MaxDrawDistance); |
590 | } | 592 | } |
591 | } | 593 | } |
592 | 594 | ||
@@ -594,7 +596,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
594 | { | 596 | { |
595 | get | 597 | get |
596 | { | 598 | { |
597 | return Util.Clamp(m_drawDistance, 32f, m_scene.MaxRegionViewDistance); | 599 | return Util.Clamp(m_drawDistance, 32f, m_scene.MaxRegionViewDistance); |
598 | } | 600 | } |
599 | } | 601 | } |
600 | 602 | ||
@@ -2120,6 +2122,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2120 | if (haveAnims) | 2122 | if (haveAnims) |
2121 | SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); | 2123 | SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); |
2122 | 2124 | ||
2125 | |||
2123 | // we should be able to receive updates, etc | 2126 | // we should be able to receive updates, etc |
2124 | // so release them | 2127 | // so release them |
2125 | m_inTransit = false; | 2128 | m_inTransit = false; |
@@ -2238,6 +2241,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2238 | } | 2241 | } |
2239 | finally | 2242 | finally |
2240 | { | 2243 | { |
2244 | haveGroupInformation = false; | ||
2245 | gotCrossUpdate = false; | ||
2246 | crossingFlags = 0; | ||
2241 | m_inTransit = false; | 2247 | m_inTransit = false; |
2242 | } | 2248 | } |
2243 | // if hide force a check | 2249 | // if hide force a check |
@@ -2247,9 +2253,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2247 | // m_currentParcelHide = newhide; | 2253 | // m_currentParcelHide = newhide; |
2248 | // } | 2254 | // } |
2249 | 2255 | ||
2250 | haveGroupInformation = false; | ||
2251 | gotCrossUpdate = false; | ||
2252 | crossingFlags = 0; | ||
2253 | 2256 | ||
2254 | m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd; | 2257 | m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd; |
2255 | 2258 | ||
@@ -3006,7 +3009,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3006 | 3009 | ||
3007 | MovingToTarget = false; | 3010 | MovingToTarget = false; |
3008 | // MoveToPositionTarget = Vector3.Zero; | 3011 | // MoveToPositionTarget = Vector3.Zero; |
3009 | m_forceToApply = null; // cancel possible last action | 3012 | // lock(m_forceToApplyLock) |
3013 | // m_forceToApplyValid = false; // cancel possible last action | ||
3010 | 3014 | ||
3011 | // We need to reset the control flag as the ScenePresenceAnimator uses this to determine the correct | 3015 | // We need to reset the control flag as the ScenePresenceAnimator uses this to determine the correct |
3012 | // resting animation (e.g. hover or stand). NPCs don't have a client that will quickly reset this flag. | 3016 | // resting animation (e.g. hover or stand). NPCs don't have a client that will quickly reset this flag. |
@@ -3638,8 +3642,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3638 | } | 3642 | } |
3639 | 3643 | ||
3640 | // m_log.DebugFormat("[SCENE PRESENCE]: Setting force to apply to {0} for {1}", direc, Name); | 3644 | // m_log.DebugFormat("[SCENE PRESENCE]: Setting force to apply to {0} for {1}", direc, Name); |
3641 | 3645 | /* | |
3642 | m_forceToApply = direc; | 3646 | lock(m_forceToApplyLock) |
3647 | { | ||
3648 | m_forceToApply = direc; | ||
3649 | m_forceToApplyValid = true; | ||
3650 | } | ||
3651 | */ | ||
3652 | Velocity = direc; | ||
3643 | Animator.UpdateMovementAnimations(); | 3653 | Animator.UpdateMovementAnimations(); |
3644 | } | 3654 | } |
3645 | 3655 | ||
@@ -4734,17 +4744,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
4734 | /// </summary> | 4744 | /// </summary> |
4735 | public void UpdateMovement() | 4745 | public void UpdateMovement() |
4736 | { | 4746 | { |
4747 | /* | ||
4737 | if (IsInTransit) | 4748 | if (IsInTransit) |
4738 | return; | 4749 | return; |
4739 | if (m_forceToApply.HasValue) | ||
4740 | { | ||
4741 | Vector3 force = m_forceToApply.Value; | ||
4742 | 4750 | ||
4743 | Velocity = force; | 4751 | lock(m_forceToApplyLock) |
4752 | { | ||
4753 | if (m_forceToApplyValid) | ||
4754 | { | ||
4755 | Velocity = m_forceToApply; | ||
4744 | 4756 | ||
4745 | m_forceToApply = null; | 4757 | m_forceToApplyValid = false; |
4746 | TriggerScenePresenceUpdated(); | 4758 | TriggerScenePresenceUpdated(); |
4759 | } | ||
4747 | } | 4760 | } |
4761 | */ | ||
4748 | } | 4762 | } |
4749 | 4763 | ||
4750 | /// <summary> | 4764 | /// <summary> |
@@ -4767,6 +4781,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4767 | // Appearance.SetHeight(); | 4781 | // Appearance.SetHeight(); |
4768 | Appearance.SetSize(new Vector3(0.45f,0.6f,1.9f)); | 4782 | Appearance.SetSize(new Vector3(0.45f,0.6f,1.9f)); |
4769 | 4783 | ||
4784 | // lock(m_forceToApplyLock) | ||
4785 | // m_forceToApplyValid = false; | ||
4786 | |||
4770 | PhysicsScene scene = m_scene.PhysicsScene; | 4787 | PhysicsScene scene = m_scene.PhysicsScene; |
4771 | Vector3 pVec = AbsolutePosition; | 4788 | Vector3 pVec = AbsolutePosition; |
4772 | 4789 | ||
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index d8928ee..37b91d3 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs | |||
@@ -178,8 +178,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
178 | if (part.Shape.ProjectionTextureUUID != UUID.Zero) | 178 | if (part.Shape.ProjectionTextureUUID != UUID.Zero) |
179 | GatheredUuids[part.Shape.ProjectionTextureUUID] = (sbyte)AssetType.Texture; | 179 | GatheredUuids[part.Shape.ProjectionTextureUUID] = (sbyte)AssetType.Texture; |
180 | 180 | ||
181 | if (part.CollisionSound != UUID.Zero) | 181 | UUID collisionSound = part.CollisionSound; |
182 | GatheredUuids[part.CollisionSound] = (sbyte)AssetType.Sound; | 182 | if ( collisionSound != UUID.Zero && |
183 | collisionSound != part.invalidCollisionSoundUUID) | ||
184 | GatheredUuids[collisionSound] = (sbyte)AssetType.Sound; | ||
183 | 185 | ||
184 | if (part.ParticleSystem.Length > 0) | 186 | if (part.ParticleSystem.Length > 0) |
185 | { | 187 | { |