From 577d07aa44b5ba7ed4fc3a56a81eeec6c141543a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 13 Mar 2012 19:51:41 +0000 Subject: missed commit of extraphysics parameters serialization.. --- .../Scenes/Serialization/SceneObjectSerializer.cs | 52 +++++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 51a3320..dfa24e5 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -359,9 +359,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization m_SOPXmlProcessors.Add("Torque", ProcessTorque); m_SOPXmlProcessors.Add("VolumeDetectActive", ProcessVolumeDetectActive); - //Ubit comented until proper testing - m_SOPXmlProcessors.Add("Vehicle", ProcessVehicle); + m_SOPXmlProcessors.Add("Vehicle", ProcessVehicle); + + m_SOPXmlProcessors.Add("PhysicsShapeType", ProcessPhysicsShapeType); + m_SOPXmlProcessors.Add("Density", ProcessDensity); + m_SOPXmlProcessors.Add("Friction", ProcessFriction); + m_SOPXmlProcessors.Add("Bounce", ProcessBounce); + m_SOPXmlProcessors.Add("GravityModifier", ProcessGravityModifier); #endregion @@ -390,7 +395,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization m_TaskInventoryXmlProcessors.Add("PermsMask", ProcessTIPermsMask); m_TaskInventoryXmlProcessors.Add("Type", ProcessTIType); m_TaskInventoryXmlProcessors.Add("OwnerChanged", ProcessTIOwnerChanged); - + #endregion #region ShapeXmlProcessors initialization @@ -585,6 +590,31 @@ namespace OpenSim.Region.Framework.Scenes.Serialization obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty); } + private static void ProcessPhysicsShapeType(SceneObjectPart obj, XmlTextReader reader) + { + obj.PhysicsShapeType = (byte)reader.ReadElementContentAsInt("PhysicsShapeType", String.Empty); + } + + private static void ProcessDensity(SceneObjectPart obj, XmlTextReader reader) + { + obj.Density = (byte)reader.ReadElementContentAsInt("Density", String.Empty); + } + + private static void ProcessFriction(SceneObjectPart obj, XmlTextReader reader) + { + obj.Friction = (byte)reader.ReadElementContentAsInt("Friction", String.Empty); + } + + private static void ProcessBounce(SceneObjectPart obj, XmlTextReader reader) + { + obj.Bounciness = (byte)reader.ReadElementContentAsInt("Bounce", String.Empty); + } + + private static void ProcessGravityModifier(SceneObjectPart obj, XmlTextReader reader) + { + obj.GravityModifier = (byte)reader.ReadElementContentAsInt("GravityModifier", String.Empty); + } + private static void ProcessVehicle(SceneObjectPart obj, XmlTextReader reader) { bool errors = false; @@ -1288,9 +1318,19 @@ namespace OpenSim.Region.Framework.Scenes.Serialization writer.WriteElementString("VolumeDetectActive", sop.VolumeDetectActive.ToString().ToLower()); - //Ubit comented until proper testing - if (sop.sopVehicle != null) - sop.sopVehicle.ToXml2(writer); + if (sop.sopVehicle != null) + sop.sopVehicle.ToXml2(writer); + + if(sop.PhysicsShapeType != (byte)PhysShapeType.prim) + writer.WriteElementString("PhysicsShapeType", sop.PhysicsShapeType.ToString().ToLower()); + if (sop.Density != 1000.0f) + writer.WriteElementString("Density", sop.Density.ToString().ToLower()); + if (sop.Friction != 0.6f) + writer.WriteElementString("Friction", sop.Friction.ToString().ToLower()); + if (sop.Bounciness != 0.5f) + writer.WriteElementString("Bounce", sop.Bounciness.ToString().ToLower()); + if (sop.GravityModifier != 1.0f) + writer.WriteElementString("GravityModifier", sop.GravityModifier.ToString().ToLower()); writer.WriteEndElement(); } -- cgit v1.1