diff options
author | UbitUmarov | 2017-04-01 17:49:17 +0100 |
---|---|---|
committer | UbitUmarov | 2017-04-01 17:49:17 +0100 |
commit | 443fc60cdf399a49832e787ca58c2644bef7e457 (patch) | |
tree | 103b547e95ced12fbc22109b82ac692f92068002 /OpenSim/Region/Framework/Scenes/Serialization | |
parent | add missing file. Changes of inertia data of objects running does not (diff) | |
download | opensim-SC-443fc60cdf399a49832e787ca58c2644bef7e457.zip opensim-SC-443fc60cdf399a49832e787ca58c2644bef7e457.tar.gz opensim-SC-443fc60cdf399a49832e787ca58c2644bef7e457.tar.bz2 opensim-SC-443fc60cdf399a49832e787ca58c2644bef7e457.tar.xz |
store the physics inertia override in Mysql and add it to serializer. run prebuild is required
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index a12a401..87d1ace 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -453,9 +453,10 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
453 | m_SOPXmlProcessors.Add("Torque", ProcessTorque); | 453 | m_SOPXmlProcessors.Add("Torque", ProcessTorque); |
454 | m_SOPXmlProcessors.Add("VolumeDetectActive", ProcessVolumeDetectActive); | 454 | m_SOPXmlProcessors.Add("VolumeDetectActive", ProcessVolumeDetectActive); |
455 | 455 | ||
456 | |||
457 | m_SOPXmlProcessors.Add("Vehicle", ProcessVehicle); | 456 | m_SOPXmlProcessors.Add("Vehicle", ProcessVehicle); |
458 | 457 | ||
458 | m_SOPXmlProcessors.Add("PhysicsInertia", ProcessPhysicsInertia); | ||
459 | |||
459 | m_SOPXmlProcessors.Add("RotationAxisLocks", ProcessRotationAxisLocks); | 460 | m_SOPXmlProcessors.Add("RotationAxisLocks", ProcessRotationAxisLocks); |
460 | m_SOPXmlProcessors.Add("PhysicsShapeType", ProcessPhysicsShapeType); | 461 | m_SOPXmlProcessors.Add("PhysicsShapeType", ProcessPhysicsShapeType); |
461 | m_SOPXmlProcessors.Add("Density", ProcessDensity); | 462 | m_SOPXmlProcessors.Add("Density", ProcessDensity); |
@@ -781,6 +782,23 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
781 | } | 782 | } |
782 | } | 783 | } |
783 | 784 | ||
785 | private static void ProcessPhysicsInertia(SceneObjectPart obj, XmlReader reader) | ||
786 | { | ||
787 | PhysicsInertiaData pdata = PhysicsInertiaData.FromXml2(reader); | ||
788 | |||
789 | if (pdata == null) | ||
790 | { | ||
791 | obj.PhysicsInertia = null; | ||
792 | m_log.DebugFormat( | ||
793 | "[SceneObjectSerializer]: Parsing PhysicsInertiaData for object part {0} {1} encountered errors. Please see earlier log entries.", | ||
794 | obj.Name, obj.UUID); | ||
795 | } | ||
796 | else | ||
797 | { | ||
798 | obj.PhysicsInertia = pdata; | ||
799 | } | ||
800 | } | ||
801 | |||
784 | private static void ProcessShape(SceneObjectPart obj, XmlReader reader) | 802 | private static void ProcessShape(SceneObjectPart obj, XmlReader reader) |
785 | { | 803 | { |
786 | List<string> errorNodeNames; | 804 | List<string> errorNodeNames; |
@@ -1498,6 +1516,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1498 | if (sop.VehicleParams != null) | 1516 | if (sop.VehicleParams != null) |
1499 | sop.VehicleParams.ToXml2(writer); | 1517 | sop.VehicleParams.ToXml2(writer); |
1500 | 1518 | ||
1519 | if (sop.PhysicsInertia != null) | ||
1520 | sop.PhysicsInertia.ToXml2(writer); | ||
1521 | |||
1501 | if(sop.RotationAxisLocks != 0) | 1522 | if(sop.RotationAxisLocks != 0) |
1502 | writer.WriteElementString("RotationAxisLocks", sop.RotationAxisLocks.ToString().ToLower()); | 1523 | writer.WriteElementString("RotationAxisLocks", sop.RotationAxisLocks.ToString().ToLower()); |
1503 | writer.WriteElementString("PhysicsShapeType", sop.PhysicsShapeType.ToString().ToLower()); | 1524 | writer.WriteElementString("PhysicsShapeType", sop.PhysicsShapeType.ToString().ToLower()); |