diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 107 |
1 files changed, 70 insertions, 37 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 261e958..59a453a 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 | ||
@@ -383,8 +390,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
383 | 390 | ||
384 | private SOPVehicle m_vehicleParams = null; | 391 | private SOPVehicle m_vehicleParams = null; |
385 | 392 | ||
386 | private KeyframeMotion m_keyframeMotion = null; | ||
387 | |||
388 | public KeyframeMotion KeyframeMotion | 393 | public KeyframeMotion KeyframeMotion |
389 | { | 394 | { |
390 | get; set; | 395 | get; set; |
@@ -536,7 +541,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
536 | CreatorID = uuid; | 541 | CreatorID = uuid; |
537 | } | 542 | } |
538 | if (parts.Length >= 2) | 543 | if (parts.Length >= 2) |
544 | { | ||
539 | CreatorData = parts[1]; | 545 | CreatorData = parts[1]; |
546 | if (!CreatorData.EndsWith("/")) | ||
547 | CreatorData += "/"; | ||
548 | } | ||
540 | if (parts.Length >= 3) | 549 | if (parts.Length >= 3) |
541 | name = parts[2]; | 550 | name = parts[2]; |
542 | 551 | ||
@@ -815,7 +824,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
815 | } | 824 | } |
816 | 825 | ||
817 | // Tell the physics engines that this prim changed. | 826 | // Tell the physics engines that this prim changed. |
818 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | 827 | if (ParentGroup != null && ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null) |
828 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | ||
819 | } | 829 | } |
820 | catch (Exception e) | 830 | catch (Exception e) |
821 | { | 831 | { |
@@ -933,7 +943,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
933 | //m_log.Info("[PART]: RO2:" + actor.Orientation.ToString()); | 943 | //m_log.Info("[PART]: RO2:" + actor.Orientation.ToString()); |
934 | } | 944 | } |
935 | 945 | ||
936 | if (ParentGroup != null) | 946 | if (ParentGroup != null && ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null) |
937 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | 947 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); |
938 | //} | 948 | //} |
939 | } | 949 | } |
@@ -1218,23 +1228,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1218 | // the mappings more consistant. | 1228 | // the mappings more consistant. |
1219 | public Vector3 SitTargetPositionLL | 1229 | public Vector3 SitTargetPositionLL |
1220 | { | 1230 | { |
1221 | get { return new Vector3(m_sitTargetPosition.X, m_sitTargetPosition.Y,m_sitTargetPosition.Z); } | 1231 | get { return m_sitTargetPosition; } |
1222 | set { m_sitTargetPosition = value; } | 1232 | set { m_sitTargetPosition = value; } |
1223 | } | 1233 | } |
1224 | 1234 | ||
1225 | public Quaternion SitTargetOrientationLL | 1235 | public Quaternion SitTargetOrientationLL |
1226 | { | 1236 | { |
1227 | get | 1237 | get { return m_sitTargetOrientation; } |
1228 | { | 1238 | 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 | } | 1239 | } |
1239 | 1240 | ||
1240 | public bool Stopped | 1241 | public bool Stopped |
@@ -4350,30 +4351,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
4350 | } | 4351 | } |
4351 | } | 4352 | } |
4352 | 4353 | ||
4353 | public void UpdateGroupPosition(Vector3 pos) | 4354 | public void UpdateGroupPosition(Vector3 newPos) |
4354 | { | 4355 | { |
4355 | if ((pos.X != GroupPosition.X) || | 4356 | Vector3 oldPos = GroupPosition; |
4356 | (pos.Y != GroupPosition.Y) || | 4357 | |
4357 | (pos.Z != GroupPosition.Z)) | 4358 | if ((newPos.X != oldPos.X) || |
4359 | (newPos.Y != oldPos.Y) || | ||
4360 | (newPos.Z != oldPos.Z)) | ||
4358 | { | 4361 | { |
4359 | Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); | ||
4360 | GroupPosition = newPos; | 4362 | GroupPosition = newPos; |
4361 | ScheduleTerseUpdate(); | 4363 | ScheduleTerseUpdate(); |
4362 | } | 4364 | } |
4363 | } | 4365 | } |
4364 | 4366 | ||
4365 | /// <summary> | 4367 | /// <summary> |
4366 | /// | 4368 | /// Update this part's offset position. |
4367 | /// </summary> | 4369 | /// </summary> |
4368 | /// <param name="pos"></param> | 4370 | /// <param name="pos"></param> |
4369 | public void UpdateOffSet(Vector3 pos) | 4371 | public void UpdateOffSet(Vector3 newPos) |
4370 | { | 4372 | { |
4371 | if ((pos.X != OffsetPosition.X) || | 4373 | 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 | 4374 | ||
4375 | if ((newPos.X != oldPos.X) || | ||
4376 | (newPos.Y != oldPos.Y) || | ||
4377 | (newPos.Z != oldPos.Z)) | ||
4378 | { | ||
4377 | if (ParentGroup.RootPart.GetStatusSandbox()) | 4379 | if (ParentGroup.RootPart.GetStatusSandbox()) |
4378 | { | 4380 | { |
4379 | if (Util.GetDistanceTo(ParentGroup.RootPart.StatusSandboxPos, newPos) > 10) | 4381 | if (Util.GetDistanceTo(ParentGroup.RootPart.StatusSandboxPos, newPos) > 10) |
@@ -4642,6 +4644,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
4642 | } | 4644 | } |
4643 | } | 4645 | } |
4644 | */ | 4646 | */ |
4647 | if (pa != null) | ||
4648 | { | ||
4649 | pa.SetMaterial(Material); | ||
4650 | DoPhysicsPropertyUpdate(UsePhysics, true); | ||
4651 | } | ||
4645 | } | 4652 | } |
4646 | else // it already has a physical representation | 4653 | else // it already has a physical representation |
4647 | { | 4654 | { |
@@ -5014,6 +5021,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
5014 | oldTex.DefaultTexture = fallbackOldFace; | 5021 | oldTex.DefaultTexture = fallbackOldFace; |
5015 | } | 5022 | } |
5016 | 5023 | ||
5024 | // Materials capable viewers can send a ObjectImage packet | ||
5025 | // when nothing in TE has changed. MaterialID should be updated | ||
5026 | // by the RenderMaterials CAP handler, so updating it here may cause a | ||
5027 | // race condtion. Therefore, if no non-materials TE fields have changed, | ||
5028 | // we should ignore any changes and not update Shape.TextureEntry | ||
5029 | |||
5030 | bool otherFieldsChanged = false; | ||
5031 | |||
5017 | for (int i = 0 ; i < GetNumberOfSides(); i++) | 5032 | for (int i = 0 ; i < GetNumberOfSides(); i++) |
5018 | { | 5033 | { |
5019 | 5034 | ||
@@ -5040,18 +5055,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
5040 | // Max change, skip the rest of testing | 5055 | // Max change, skip the rest of testing |
5041 | if (changeFlags == (Changed.TEXTURE | Changed.COLOR)) | 5056 | if (changeFlags == (Changed.TEXTURE | Changed.COLOR)) |
5042 | break; | 5057 | break; |
5058 | |||
5059 | if (!otherFieldsChanged) | ||
5060 | { | ||
5061 | if (oldFace.Bump != newFace.Bump) otherFieldsChanged = true; | ||
5062 | if (oldFace.Fullbright != newFace.Fullbright) otherFieldsChanged = true; | ||
5063 | if (oldFace.Glow != newFace.Glow) otherFieldsChanged = true; | ||
5064 | if (oldFace.MediaFlags != newFace.MediaFlags) otherFieldsChanged = true; | ||
5065 | if (oldFace.OffsetU != newFace.OffsetU) otherFieldsChanged = true; | ||
5066 | if (oldFace.OffsetV != newFace.OffsetV) otherFieldsChanged = true; | ||
5067 | if (oldFace.RepeatU != newFace.RepeatU) otherFieldsChanged = true; | ||
5068 | if (oldFace.RepeatV != newFace.RepeatV) otherFieldsChanged = true; | ||
5069 | if (oldFace.Rotation != newFace.Rotation) otherFieldsChanged = true; | ||
5070 | if (oldFace.Shiny != newFace.Shiny) otherFieldsChanged = true; | ||
5071 | if (oldFace.TexMapType != newFace.TexMapType) otherFieldsChanged = true; | ||
5072 | } | ||
5043 | } | 5073 | } |
5044 | 5074 | ||
5045 | m_shape.TextureEntry = newTex.GetBytes(); | 5075 | if (changeFlags != 0 || otherFieldsChanged) |
5046 | if (changeFlags != 0) | 5076 | { |
5047 | TriggerScriptChangedEvent(changeFlags); | 5077 | m_shape.TextureEntry = newTex.GetBytes(); |
5048 | UpdateFlag = UpdateRequired.FULL; | 5078 | if (changeFlags != 0) |
5049 | ParentGroup.HasGroupChanged = true; | 5079 | TriggerScriptChangedEvent(changeFlags); |
5080 | UpdateFlag = UpdateRequired.FULL; | ||
5081 | ParentGroup.HasGroupChanged = true; | ||
5050 | 5082 | ||
5051 | //This is madness.. | 5083 | //This is madness.. |
5052 | //ParentGroup.ScheduleGroupForFullUpdate(); | 5084 | //ParentGroup.ScheduleGroupForFullUpdate(); |
5053 | //This is sparta | 5085 | //This is sparta |
5054 | ScheduleFullUpdate(); | 5086 | ScheduleFullUpdate(); |
5087 | } | ||
5055 | } | 5088 | } |
5056 | 5089 | ||
5057 | 5090 | ||