diff options
author | lbsa71 | 2007-12-28 13:11:49 +0000 |
---|---|---|
committer | lbsa71 | 2007-12-28 13:11:49 +0000 |
commit | 5b720b4b3952e182203490961d99e46b8744775e (patch) | |
tree | c4f7b0f68217e063e8c47bb3977c7386781877f4 /OpenSim | |
parent | * redid the AddNewPrim refactoring as that got lost in r2855 (diff) | |
download | opensim-SC_OLD-5b720b4b3952e182203490961d99e46b8744775e.zip opensim-SC_OLD-5b720b4b3952e182203490961d99e46b8744775e.tar.gz opensim-SC_OLD-5b720b4b3952e182203490961d99e46b8744775e.tar.bz2 opensim-SC_OLD-5b720b4b3952e182203490961d99e46b8744775e.tar.xz |
* Made a copy of parts before updating to avoid dictionary updated exceptions on big updates
* The part now uses the byte[] TextureEntry instead of the object
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 94b6797..d3f5454 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -677,26 +677,32 @@ namespace OpenSim.Region.Environment.Scenes | |||
677 | /// </summary> | 677 | /// </summary> |
678 | public override void Update() | 678 | public override void Update() |
679 | { | 679 | { |
680 | List<SceneObjectPart> parts = new List<SceneObjectPart>(m_parts.Values); | ||
681 | |||
680 | if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) | 682 | if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) |
681 | { | 683 | { |
682 | foreach (SceneObjectPart part in m_parts.Values) | 684 | foreach (SceneObjectPart part in parts) |
683 | { | 685 | { |
684 | if (part.UpdateFlag == 0) part.UpdateFlag = 1; | 686 | if (part.UpdateFlag == 0) part.UpdateFlag = 1; |
685 | } | 687 | } |
688 | |||
686 | lastPhysGroupPos = AbsolutePosition; | 689 | lastPhysGroupPos = AbsolutePosition; |
687 | } | 690 | } |
691 | |||
688 | if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) | 692 | if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) |
689 | || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) | 693 | || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) |
690 | || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1) | 694 | || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1) |
691 | || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1)) | 695 | || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1)) |
692 | { | 696 | { |
693 | foreach (SceneObjectPart part in m_parts.Values) | 697 | foreach (SceneObjectPart part in parts) |
694 | { | 698 | { |
695 | if (part.UpdateFlag == 0) part.UpdateFlag = 1; | 699 | if (part.UpdateFlag == 0) part.UpdateFlag = 1; |
696 | } | 700 | } |
701 | |||
697 | lastPhysGroupRot = GroupRotation; | 702 | lastPhysGroupRot = GroupRotation; |
698 | } | 703 | } |
699 | foreach (SceneObjectPart part in m_parts.Values) | 704 | |
705 | foreach (SceneObjectPart part in parts) | ||
700 | { | 706 | { |
701 | part.SendScheduledUpdates(); | 707 | part.SendScheduledUpdates(); |
702 | } | 708 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index dad8812..d35cb76 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -1327,7 +1327,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1327 | /// <param name="textureEntry"></param> | 1327 | /// <param name="textureEntry"></param> |
1328 | public void UpdateTextureEntry(byte[] textureEntry) | 1328 | public void UpdateTextureEntry(byte[] textureEntry) |
1329 | { | 1329 | { |
1330 | m_shape.Textures = new LLObject.TextureEntry(textureEntry, 0, textureEntry.Length); | 1330 | m_shape.TextureEntry = textureEntry; |
1331 | ScheduleFullUpdate(); | 1331 | ScheduleFullUpdate(); |
1332 | } | 1332 | } |
1333 | 1333 | ||