Another take related to the previous commit.
parent
3b2d9a9939
commit
8acac3d07f
|
@ -1435,22 +1435,26 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
|
|
||||||
static Quaternion ReadQuaternion(XmlTextReader reader, string name)
|
static Quaternion ReadQuaternion(XmlTextReader reader, string name)
|
||||||
{
|
{
|
||||||
Quaternion quat;
|
Quaternion quat = new Quaternion();
|
||||||
|
|
||||||
reader.ReadStartElement(name);
|
reader.ReadStartElement(name);
|
||||||
if (reader.Name == "X") // assume X, Y, Z, W order
|
while (reader.NodeType != XmlNodeType.EndElement)
|
||||||
{
|
{
|
||||||
quat.X = reader.ReadElementContentAsFloat("X", String.Empty);
|
switch (reader.Name.ToLower())
|
||||||
quat.Y = reader.ReadElementContentAsFloat("Y", String.Empty);
|
{
|
||||||
quat.Z = reader.ReadElementContentAsFloat("Z", String.Empty);
|
case "x":
|
||||||
quat.W = reader.ReadElementContentAsFloat("W", String.Empty);
|
quat.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty);
|
||||||
|
break;
|
||||||
|
case "y":
|
||||||
|
quat.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty);
|
||||||
|
break;
|
||||||
|
case "z":
|
||||||
|
quat.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty);
|
||||||
|
break;
|
||||||
|
case "w":
|
||||||
|
quat.W = reader.ReadElementContentAsFloat(reader.Name, String.Empty);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
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();
|
reader.ReadEndElement();
|
||||||
|
|
Loading…
Reference in New Issue