diff options
author | Melanie | 2013-02-06 08:03:04 +0000 |
---|---|---|
committer | Melanie | 2013-02-06 08:03:04 +0000 |
commit | e5beb480eaf23fa7454728724de80b2a67ded1e8 (patch) | |
tree | 232bfd14074cc3730ab02bdefa339b99a587f1dc /OpenSim/Region/Framework/Scenes/Serialization | |
parent | minor: Add explanation of MaptileStaticUUID setting in Regions.ini.example (diff) | |
download | opensim-SC_OLD-e5beb480eaf23fa7454728724de80b2a67ded1e8.zip opensim-SC_OLD-e5beb480eaf23fa7454728724de80b2a67ded1e8.tar.gz opensim-SC_OLD-e5beb480eaf23fa7454728724de80b2a67ded1e8.tar.bz2 opensim-SC_OLD-e5beb480eaf23fa7454728724de80b2a67ded1e8.tar.xz |
Partial port of Avination's support for the new physics parameters.
Implements the parameters as properties, the serialization and
database storage (MySQL only). Implements llSetPrimitiveParams for
prim physics shape and the other 4 extra params. Only the prim shape type
"None" is currently functional. No support for the Viewer UI (yet), that
will be ported in due course. Lots more to port, this is a large-ish changeset.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 4a2a47e..78229fe 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -367,6 +367,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
367 | m_SOPXmlProcessors.Add("PayPrice2", ProcessPayPrice2); | 367 | m_SOPXmlProcessors.Add("PayPrice2", ProcessPayPrice2); |
368 | m_SOPXmlProcessors.Add("PayPrice3", ProcessPayPrice3); | 368 | m_SOPXmlProcessors.Add("PayPrice3", ProcessPayPrice3); |
369 | m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4); | 369 | m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4); |
370 | |||
371 | m_SOPXmlProcessors.Add("PhysicsShapeType", ProcessPhysicsShapeType); | ||
372 | m_SOPXmlProcessors.Add("Density", ProcessDensity); | ||
373 | m_SOPXmlProcessors.Add("Friction", ProcessFriction); | ||
374 | m_SOPXmlProcessors.Add("Bounce", ProcessBounce); | ||
375 | m_SOPXmlProcessors.Add("GravityModifier", ProcessGravityModifier); | ||
376 | |||
370 | #endregion | 377 | #endregion |
371 | 378 | ||
372 | #region TaskInventoryXmlProcessors initialization | 379 | #region TaskInventoryXmlProcessors initialization |
@@ -594,6 +601,31 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
594 | obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty); | 601 | obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty); |
595 | } | 602 | } |
596 | 603 | ||
604 | private static void ProcessPhysicsShapeType(SceneObjectPart obj, XmlTextReader reader) | ||
605 | { | ||
606 | obj.PhysicsShapeType = (byte)reader.ReadElementContentAsInt("PhysicsShapeType", String.Empty); | ||
607 | } | ||
608 | |||
609 | private static void ProcessDensity(SceneObjectPart obj, XmlTextReader reader) | ||
610 | { | ||
611 | obj.Density = reader.ReadElementContentAsFloat("Density", String.Empty); | ||
612 | } | ||
613 | |||
614 | private static void ProcessFriction(SceneObjectPart obj, XmlTextReader reader) | ||
615 | { | ||
616 | obj.Friction = reader.ReadElementContentAsFloat("Friction", String.Empty); | ||
617 | } | ||
618 | |||
619 | private static void ProcessBounce(SceneObjectPart obj, XmlTextReader reader) | ||
620 | { | ||
621 | obj.Bounciness = reader.ReadElementContentAsFloat("Bounce", String.Empty); | ||
622 | } | ||
623 | |||
624 | private static void ProcessGravityModifier(SceneObjectPart obj, XmlTextReader reader) | ||
625 | { | ||
626 | obj.GravityModifier = reader.ReadElementContentAsFloat("GravityModifier", String.Empty); | ||
627 | } | ||
628 | |||
597 | private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) | 629 | private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) |
598 | { | 630 | { |
599 | List<string> errorNodeNames; | 631 | List<string> errorNodeNames; |
@@ -1257,6 +1289,17 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1257 | writer.WriteElementString("PayPrice3", sop.PayPrice[3].ToString()); | 1289 | writer.WriteElementString("PayPrice3", sop.PayPrice[3].ToString()); |
1258 | writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString()); | 1290 | writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString()); |
1259 | 1291 | ||
1292 | if(sop.PhysicsShapeType != sop.DefaultPhysicsShapeType()) | ||
1293 | writer.WriteElementString("PhysicsShapeType", sop.PhysicsShapeType.ToString().ToLower()); | ||
1294 | if (sop.Density != 1000.0f) | ||
1295 | writer.WriteElementString("Density", sop.Density.ToString().ToLower()); | ||
1296 | if (sop.Friction != 0.6f) | ||
1297 | writer.WriteElementString("Friction", sop.Friction.ToString().ToLower()); | ||
1298 | if (sop.Bounciness != 0.5f) | ||
1299 | writer.WriteElementString("Bounce", sop.Bounciness.ToString().ToLower()); | ||
1300 | if (sop.GravityModifier != 1.0f) | ||
1301 | writer.WriteElementString("GravityModifier", sop.GravityModifier.ToString().ToLower()); | ||
1302 | |||
1260 | writer.WriteEndElement(); | 1303 | writer.WriteEndElement(); |
1261 | } | 1304 | } |
1262 | 1305 | ||