aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/KeyframeMotion.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs26
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs8
6 files changed, 50 insertions, 25 deletions
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
index bf18f4d..b7b0d27 100644
--- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
+++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
@@ -406,5 +406,17 @@ namespace OpenSim.Region.Framework.Scenes
406 m_group = tmp; 406 m_group = tmp;
407 return ms.ToArray(); 407 return ms.ToArray();
408 } 408 }
409
410 public void CrossingFailure()
411 {
412 // The serialization has stopped the timer, so let's wait a moment
413 // then retry the crossing. We'll get back here if it fails.
414 Util.FireAndForget(delegate (object x)
415 {
416 Thread.Sleep(60000);
417 if (m_running)
418 m_timer.Start();
419 });
420 }
409 } 421 }
410} 422}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index c20da4b..11a41aa 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2421,8 +2421,8 @@ namespace OpenSim.Region.Framework.Scenes
2421 2421
2422 if (newPosition != Vector3.Zero) 2422 if (newPosition != Vector3.Zero)
2423 newObject.RootPart.GroupPosition = newPosition; 2423 newObject.RootPart.GroupPosition = newPosition;
2424 if (newObject.KeyframeMotion != null) 2424 if (newObject.RootPart.KeyframeMotion != null)
2425 newObject.KeyframeMotion.UpdateSceneObject(newObject); 2425 newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject);
2426 2426
2427 if (!AddSceneObject(newObject)) 2427 if (!AddSceneObject(newObject))
2428 { 2428 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 5a7f124..a3206015 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1731,6 +1731,12 @@ namespace OpenSim.Region.Framework.Scenes
1731 /// <param name="childPrims"></param> 1731 /// <param name="childPrims"></param>
1732 protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children) 1732 protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children)
1733 { 1733 {
1734 if (root.KeyframeMotion != null)
1735 {
1736 root.KeyframeMotion.Stop();
1737 root.KeyframeMotion = null;
1738 }
1739
1734 SceneObjectGroup parentGroup = root.ParentGroup; 1740 SceneObjectGroup parentGroup = root.ParentGroup;
1735 if (parentGroup == null) return; 1741 if (parentGroup == null) return;
1736 1742
@@ -1823,6 +1829,11 @@ namespace OpenSim.Region.Framework.Scenes
1823 { 1829 {
1824 if (part != null) 1830 if (part != null)
1825 { 1831 {
1832 if (part.KeyframeMotion != null)
1833 {
1834 part.KeyframeMotion.Stop();
1835 part.KeyframeMotion = null;
1836 }
1826 if (part.ParentGroup.PrimCount != 1) // Skip single 1837 if (part.ParentGroup.PrimCount != 1) // Skip single
1827 { 1838 {
1828 if (part.LinkNum < 2) // Root 1839 if (part.LinkNum < 2) // Root
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e509d4e..fefae9d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -114,12 +114,6 @@ namespace OpenSim.Region.Framework.Scenes
114 private Random m_rand; 114 private Random m_rand;
115 private bool m_suspendUpdates; 115 private bool m_suspendUpdates;
116 private List<ScenePresence> m_linkedAvatars = new List<ScenePresence>(); 116 private List<ScenePresence> m_linkedAvatars = new List<ScenePresence>();
117 private KeyframeMotion m_keyframeMotion = null;
118
119 public KeyframeMotion KeyframeMotion
120 {
121 get; set;
122 }
123 117
124 public bool areUpdatesSuspended 118 public bool areUpdatesSuspended
125 { 119 {
@@ -726,8 +720,8 @@ namespace OpenSim.Region.Framework.Scenes
726 child.PhysActor.Selected = value; 720 child.PhysActor.Selected = value;
727 } 721 }
728 } 722 }
729 if (KeyframeMotion != null) 723 if (RootPart.KeyframeMotion != null)
730 KeyframeMotion.Selected = value; 724 RootPart.KeyframeMotion.Selected = value;
731 } 725 }
732 } 726 }
733 727
@@ -1829,11 +1823,6 @@ namespace OpenSim.Region.Framework.Scenes
1829// Name, UUID, m_scene.RegionInfo.RegionName); 1823// Name, UUID, m_scene.RegionInfo.RegionName);
1830 1824
1831 SceneObjectGroup backup_group = Copy(false); 1825 SceneObjectGroup backup_group = Copy(false);
1832 if (KeyframeMotion != null)
1833 {
1834 backup_group.KeyframeMotion = KeyframeMotion.FromData(backup_group, KeyframeMotion.Serialize());
1835 KeyframeMotion.UpdateSceneObject(this);
1836 }
1837 backup_group.RootPart.Velocity = RootPart.Velocity; 1826 backup_group.RootPart.Velocity = RootPart.Velocity;
1838 backup_group.RootPart.Acceleration = RootPart.Acceleration; 1827 backup_group.RootPart.Acceleration = RootPart.Acceleration;
1839 backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity; 1828 backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
@@ -1846,6 +1835,11 @@ namespace OpenSim.Region.Framework.Scenes
1846 1835
1847 backup_group.ForEachPart(delegate(SceneObjectPart part) 1836 backup_group.ForEachPart(delegate(SceneObjectPart part)
1848 { 1837 {
1838 if (part.KeyframeMotion != null)
1839 {
1840 part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize());
1841 part.KeyframeMotion.UpdateSceneObject(this);
1842 }
1849 part.Inventory.ProcessInventoryBackup(datastore); 1843 part.Inventory.ProcessInventoryBackup(datastore);
1850 }); 1844 });
1851 1845
@@ -2001,9 +1995,9 @@ namespace OpenSim.Region.Framework.Scenes
2001 { 1995 {
2002 if (usePhysics) 1996 if (usePhysics)
2003 { 1997 {
2004 if (KeyframeMotion != null) 1998 if (RootPart.KeyframeMotion != null)
2005 KeyframeMotion.Stop(); 1999 RootPart.KeyframeMotion.Stop();
2006 KeyframeMotion = null; 2000 RootPart.KeyframeMotion = null;
2007 } 2001 }
2008 UpdatePrimFlags(RootPart.LocalId, usePhysics, IsTemporary, IsPhantom, IsVolumeDetect); 2002 UpdatePrimFlags(RootPart.LocalId, usePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
2009 } 2003 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 0728042..ea3d716 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -315,6 +315,14 @@ namespace OpenSim.Region.Framework.Scenes
315 315
316 private SOPVehicle m_vehicle = null; 316 private SOPVehicle m_vehicle = null;
317 317
318 private KeyframeMotion m_keyframeMotion = null;
319
320 public KeyframeMotion KeyframeMotion
321 {
322 get; set;
323 }
324
325
318 #endregion Fields 326 #endregion Fields
319 327
320// ~SceneObjectPart() 328// ~SceneObjectPart()
@@ -1924,9 +1932,9 @@ namespace OpenSim.Region.Framework.Scenes
1924 { 1932 {
1925 if (UsePhysics) 1933 if (UsePhysics)
1926 { 1934 {
1927 if (ParentGroup.KeyframeMotion != null) 1935 if (ParentGroup.RootPart.KeyframeMotion != null)
1928 ParentGroup.KeyframeMotion.Stop(); 1936 ParentGroup.RootPart.KeyframeMotion.Stop();
1929 ParentGroup.KeyframeMotion = null; 1937 ParentGroup.RootPart.KeyframeMotion = null;
1930 ParentGroup.Scene.AddPhysicalPrim(1); 1938 ParentGroup.Scene.AddPhysicalPrim(1);
1931 1939
1932 PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; 1940 PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate;
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 118a63a..51a3320 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -246,9 +246,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
246 246
247 XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion"); 247 XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion");
248 if (keymotion.Count > 0) 248 if (keymotion.Count > 0)
249 sceneObject.KeyframeMotion = KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(keymotion[0].InnerText)); 249 sceneObject.RootPart.KeyframeMotion = KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(keymotion[0].InnerText));
250 else 250 else
251 sceneObject.KeyframeMotion = null; 251 sceneObject.RootPart.KeyframeMotion = null;
252 252
253 // Script state may, or may not, exist. Not having any, is NOT 253 // Script state may, or may not, exist. Not having any, is NOT
254 // ever a problem. 254 // ever a problem.
@@ -1174,9 +1174,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1174 1174
1175 writer.WriteEndElement(); 1175 writer.WriteEndElement();
1176 1176
1177 if (sog.KeyframeMotion != null) 1177 if (sog.RootPart.KeyframeMotion != null)
1178 { 1178 {
1179 Byte[] data = sog.KeyframeMotion.Serialize(); 1179 Byte[] data = sog.RootPart.KeyframeMotion.Serialize();
1180 1180
1181 writer.WriteStartElement(String.Empty, "KeyframeMotion", String.Empty); 1181 writer.WriteStartElement(String.Empty, "KeyframeMotion", String.Empty);
1182 writer.WriteBase64(data, 0, data.Length); 1182 writer.WriteBase64(data, 0, data.Length);