Add Camera Offsets to serialization

avinationmerge
Melanie 2012-08-21 16:41:08 +02:00
parent f71ed7eb79
commit f2ac1b9e8a
1 changed files with 14 additions and 0 deletions

View File

@ -386,6 +386,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
m_SOPXmlProcessors.Add("Friction", ProcessFriction); m_SOPXmlProcessors.Add("Friction", ProcessFriction);
m_SOPXmlProcessors.Add("Bounce", ProcessBounce); m_SOPXmlProcessors.Add("Bounce", ProcessBounce);
m_SOPXmlProcessors.Add("GravityModifier", ProcessGravityModifier); m_SOPXmlProcessors.Add("GravityModifier", ProcessGravityModifier);
m_SOPXmlProcessors.Add("CameraEyeOffset", ProcessCameraEyeOffset);
m_SOPXmlProcessors.Add("CameraAtOffset", ProcessCameraAtOffset);
#endregion #endregion
@ -639,6 +641,16 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
obj.GravityModifier = reader.ReadElementContentAsFloat("GravityModifier", String.Empty); 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) private static void ProcessVehicle(SceneObjectPart obj, XmlTextReader reader)
{ {
SOPVehicle vehicle = SOPVehicle.FromXml2(reader); SOPVehicle vehicle = SOPVehicle.FromXml2(reader);
@ -1355,6 +1367,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteElementString("Bounce", sop.Bounciness.ToString().ToLower()); writer.WriteElementString("Bounce", sop.Bounciness.ToString().ToLower());
if (sop.GravityModifier != 1.0f) if (sop.GravityModifier != 1.0f)
writer.WriteElementString("GravityModifier", sop.GravityModifier.ToString().ToLower()); writer.WriteElementString("GravityModifier", sop.GravityModifier.ToString().ToLower());
WriteVector(writer, "CameraEyeOffset", sop.GetCameraEyeOffset());
WriteVector(writer, "CameraAtOffset", sop.GetCameraAtOffset());
writer.WriteEndElement(); writer.WriteEndElement();
} }