From f2ac1b9e8aa80a250cba46fec1aa7cf97c6caaf8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 21 Aug 2012 16:41:08 +0200 Subject: [PATCH] Add Camera Offsets to serialization --- .../Scenes/Serialization/SceneObjectSerializer.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 0d292e7d95..134bd9dca9 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -386,6 +386,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization m_SOPXmlProcessors.Add("Friction", ProcessFriction); m_SOPXmlProcessors.Add("Bounce", ProcessBounce); m_SOPXmlProcessors.Add("GravityModifier", ProcessGravityModifier); + m_SOPXmlProcessors.Add("CameraEyeOffset", ProcessCameraEyeOffset); + m_SOPXmlProcessors.Add("CameraAtOffset", ProcessCameraAtOffset); #endregion @@ -639,6 +641,16 @@ namespace OpenSim.Region.Framework.Scenes.Serialization obj.GravityModifier = reader.ReadElementContentAsFloat("GravityModifier", String.Empty); } + private static void ProcessCameraEyeOffset(SceneObjectPart obj, XmlTextReader reader) + { + obj.SetCameraEyeOffset(Util.ReadVector(reader, "CameraEyeOffset")); + } + + private static void ProcessCameraAtOffset(SceneObjectPart obj, XmlTextReader reader) + { + obj.SetCameraAtOffset(Util.ReadVector(reader, "CameraAtOffset")); + } + private static void ProcessVehicle(SceneObjectPart obj, XmlTextReader reader) { SOPVehicle vehicle = SOPVehicle.FromXml2(reader); @@ -1355,6 +1367,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization writer.WriteElementString("Bounce", sop.Bounciness.ToString().ToLower()); if (sop.GravityModifier != 1.0f) writer.WriteElementString("GravityModifier", sop.GravityModifier.ToString().ToLower()); + WriteVector(writer, "CameraEyeOffset", sop.GetCameraEyeOffset()); + WriteVector(writer, "CameraAtOffset", sop.GetCameraAtOffset()); writer.WriteEndElement(); }