aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs96
1 files changed, 61 insertions, 35 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 261e958..f13f7ab 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -231,6 +231,13 @@ namespace OpenSim.Region.Framework.Scenes
231 231
232 public double SoundRadius; 232 public double SoundRadius;
233 233
234 /// <summary>
235 /// Should sounds played from this prim be queued?
236 /// </summary>
237 /// <remarks>
238 /// This should only be changed by sound modules. It is up to sound modules as to how they interpret this setting.
239 /// </remarks>
240 public bool SoundQueueing { get; set; }
234 241
235 public uint TimeStampFull; 242 public uint TimeStampFull;
236 243
@@ -815,7 +822,8 @@ namespace OpenSim.Region.Framework.Scenes
815 } 822 }
816 823
817 // Tell the physics engines that this prim changed. 824 // Tell the physics engines that this prim changed.
818 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); 825 if (ParentGroup != null && ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null)
826 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
819 } 827 }
820 catch (Exception e) 828 catch (Exception e)
821 { 829 {
@@ -933,7 +941,7 @@ namespace OpenSim.Region.Framework.Scenes
933 //m_log.Info("[PART]: RO2:" + actor.Orientation.ToString()); 941 //m_log.Info("[PART]: RO2:" + actor.Orientation.ToString());
934 } 942 }
935 943
936 if (ParentGroup != null) 944 if (ParentGroup != null && ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null)
937 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); 945 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
938 //} 946 //}
939 } 947 }
@@ -1218,23 +1226,14 @@ namespace OpenSim.Region.Framework.Scenes
1218 // the mappings more consistant. 1226 // the mappings more consistant.
1219 public Vector3 SitTargetPositionLL 1227 public Vector3 SitTargetPositionLL
1220 { 1228 {
1221 get { return new Vector3(m_sitTargetPosition.X, m_sitTargetPosition.Y,m_sitTargetPosition.Z); } 1229 get { return m_sitTargetPosition; }
1222 set { m_sitTargetPosition = value; } 1230 set { m_sitTargetPosition = value; }
1223 } 1231 }
1224 1232
1225 public Quaternion SitTargetOrientationLL 1233 public Quaternion SitTargetOrientationLL
1226 { 1234 {
1227 get 1235 get { return m_sitTargetOrientation; }
1228 { 1236 set { m_sitTargetOrientation = value; }
1229 return new Quaternion(
1230 m_sitTargetOrientation.X,
1231 m_sitTargetOrientation.Y,
1232 m_sitTargetOrientation.Z,
1233 m_sitTargetOrientation.W
1234 );
1235 }
1236
1237 set { m_sitTargetOrientation = new Quaternion(value.X, value.Y, value.Z, value.W); }
1238 } 1237 }
1239 1238
1240 public bool Stopped 1239 public bool Stopped
@@ -4350,30 +4349,31 @@ namespace OpenSim.Region.Framework.Scenes
4350 } 4349 }
4351 } 4350 }
4352 4351
4353 public void UpdateGroupPosition(Vector3 pos) 4352 public void UpdateGroupPosition(Vector3 newPos)
4354 { 4353 {
4355 if ((pos.X != GroupPosition.X) || 4354 Vector3 oldPos = GroupPosition;
4356 (pos.Y != GroupPosition.Y) || 4355
4357 (pos.Z != GroupPosition.Z)) 4356 if ((newPos.X != oldPos.X) ||
4357 (newPos.Y != oldPos.Y) ||
4358 (newPos.Z != oldPos.Z))
4358 { 4359 {
4359 Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
4360 GroupPosition = newPos; 4360 GroupPosition = newPos;
4361 ScheduleTerseUpdate(); 4361 ScheduleTerseUpdate();
4362 } 4362 }
4363 } 4363 }
4364 4364
4365 /// <summary> 4365 /// <summary>
4366 /// 4366 /// Update this part's offset position.
4367 /// </summary> 4367 /// </summary>
4368 /// <param name="pos"></param> 4368 /// <param name="pos"></param>
4369 public void UpdateOffSet(Vector3 pos) 4369 public void UpdateOffSet(Vector3 newPos)
4370 { 4370 {
4371 if ((pos.X != OffsetPosition.X) || 4371 Vector3 oldPos = OffsetPosition;
4372 (pos.Y != OffsetPosition.Y) ||
4373 (pos.Z != OffsetPosition.Z))
4374 {
4375 Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
4376 4372
4373 if ((newPos.X != oldPos.X) ||
4374 (newPos.Y != oldPos.Y) ||
4375 (newPos.Z != oldPos.Z))
4376 {
4377 if (ParentGroup.RootPart.GetStatusSandbox()) 4377 if (ParentGroup.RootPart.GetStatusSandbox())
4378 { 4378 {
4379 if (Util.GetDistanceTo(ParentGroup.RootPart.StatusSandboxPos, newPos) > 10) 4379 if (Util.GetDistanceTo(ParentGroup.RootPart.StatusSandboxPos, newPos) > 10)
@@ -5014,6 +5014,14 @@ namespace OpenSim.Region.Framework.Scenes
5014 oldTex.DefaultTexture = fallbackOldFace; 5014 oldTex.DefaultTexture = fallbackOldFace;
5015 } 5015 }
5016 5016
5017 // Materials capable viewers can send a ObjectImage packet
5018 // when nothing in TE has changed. MaterialID should be updated
5019 // by the RenderMaterials CAP handler, so updating it here may cause a
5020 // race condtion. Therefore, if no non-materials TE fields have changed,
5021 // we should ignore any changes and not update Shape.TextureEntry
5022
5023 bool otherFieldsChanged = false;
5024
5017 for (int i = 0 ; i < GetNumberOfSides(); i++) 5025 for (int i = 0 ; i < GetNumberOfSides(); i++)
5018 { 5026 {
5019 5027
@@ -5040,18 +5048,36 @@ namespace OpenSim.Region.Framework.Scenes
5040 // Max change, skip the rest of testing 5048 // Max change, skip the rest of testing
5041 if (changeFlags == (Changed.TEXTURE | Changed.COLOR)) 5049 if (changeFlags == (Changed.TEXTURE | Changed.COLOR))
5042 break; 5050 break;
5051
5052 if (!otherFieldsChanged)
5053 {
5054 if (oldFace.Bump != newFace.Bump) otherFieldsChanged = true;
5055 if (oldFace.Fullbright != newFace.Fullbright) otherFieldsChanged = true;
5056 if (oldFace.Glow != newFace.Glow) otherFieldsChanged = true;
5057 if (oldFace.MediaFlags != newFace.MediaFlags) otherFieldsChanged = true;
5058 if (oldFace.OffsetU != newFace.OffsetU) otherFieldsChanged = true;
5059 if (oldFace.OffsetV != newFace.OffsetV) otherFieldsChanged = true;
5060 if (oldFace.RepeatU != newFace.RepeatU) otherFieldsChanged = true;
5061 if (oldFace.RepeatV != newFace.RepeatV) otherFieldsChanged = true;
5062 if (oldFace.Rotation != newFace.Rotation) otherFieldsChanged = true;
5063 if (oldFace.Shiny != newFace.Shiny) otherFieldsChanged = true;
5064 if (oldFace.TexMapType != newFace.TexMapType) otherFieldsChanged = true;
5065 }
5043 } 5066 }
5044 5067
5045 m_shape.TextureEntry = newTex.GetBytes(); 5068 if (changeFlags != 0 || otherFieldsChanged)
5046 if (changeFlags != 0) 5069 {
5047 TriggerScriptChangedEvent(changeFlags); 5070 m_shape.TextureEntry = newTex.GetBytes();
5048 UpdateFlag = UpdateRequired.FULL; 5071 if (changeFlags != 0)
5049 ParentGroup.HasGroupChanged = true; 5072 TriggerScriptChangedEvent(changeFlags);
5073 UpdateFlag = UpdateRequired.FULL;
5074 ParentGroup.HasGroupChanged = true;
5050 5075
5051 //This is madness.. 5076 //This is madness..
5052 //ParentGroup.ScheduleGroupForFullUpdate(); 5077 //ParentGroup.ScheduleGroupForFullUpdate();
5053 //This is sparta 5078 //This is sparta
5054 ScheduleFullUpdate(); 5079 ScheduleFullUpdate();
5080 }
5055 } 5081 }
5056 5082
5057 5083