Added code to quaternion deserialization to try to cope with an exception seen in Wright Plaza related to SitTargetOrientation.

17:23:05 - [SceneObjectSerializer]: exception while parsing SitTargetOrientation: System.Xml.XmlException: Expecting X tag from namespace , got w and  instead  Line 1, position 30064.
viewer-2-initial-appearance
Diva Canto 2010-10-19 14:37:03 -07:00
parent 684449f783
commit 3b2d9a9939
1 changed files with 15 additions and 4 deletions

View File

@ -1438,10 +1438,21 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
Quaternion quat;
reader.ReadStartElement(name);
if (reader.Name == "X") // assume X, Y, Z, W order
{
quat.X = reader.ReadElementContentAsFloat("X", String.Empty);
quat.Y = reader.ReadElementContentAsFloat("Y", String.Empty);
quat.Z = reader.ReadElementContentAsFloat("Z", String.Empty);
quat.W = reader.ReadElementContentAsFloat("W", String.Empty);
}
else // assume w, x, y, z
{
quat.W = reader.ReadElementContentAsFloat("w", String.Empty);
quat.X = reader.ReadElementContentAsFloat("x", String.Empty);
quat.Y = reader.ReadElementContentAsFloat("y", String.Empty);
quat.Z = reader.ReadElementContentAsFloat("z", String.Empty);
}
reader.ReadEndElement();
return quat;