mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 08:06:27 +08:00
store the physics inertia override in Mysql and add it to serializer. run prebuild is required
This commit is contained in:
@@ -453,9 +453,10 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
m_SOPXmlProcessors.Add("Torque", ProcessTorque);
|
||||
m_SOPXmlProcessors.Add("VolumeDetectActive", ProcessVolumeDetectActive);
|
||||
|
||||
|
||||
m_SOPXmlProcessors.Add("Vehicle", ProcessVehicle);
|
||||
|
||||
m_SOPXmlProcessors.Add("PhysicsInertia", ProcessPhysicsInertia);
|
||||
|
||||
m_SOPXmlProcessors.Add("RotationAxisLocks", ProcessRotationAxisLocks);
|
||||
m_SOPXmlProcessors.Add("PhysicsShapeType", ProcessPhysicsShapeType);
|
||||
m_SOPXmlProcessors.Add("Density", ProcessDensity);
|
||||
@@ -781,6 +782,23 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
}
|
||||
}
|
||||
|
||||
private static void ProcessPhysicsInertia(SceneObjectPart obj, XmlReader reader)
|
||||
{
|
||||
PhysicsInertiaData pdata = PhysicsInertiaData.FromXml2(reader);
|
||||
|
||||
if (pdata == null)
|
||||
{
|
||||
obj.PhysicsInertia = null;
|
||||
m_log.DebugFormat(
|
||||
"[SceneObjectSerializer]: Parsing PhysicsInertiaData for object part {0} {1} encountered errors. Please see earlier log entries.",
|
||||
obj.Name, obj.UUID);
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.PhysicsInertia = pdata;
|
||||
}
|
||||
}
|
||||
|
||||
private static void ProcessShape(SceneObjectPart obj, XmlReader reader)
|
||||
{
|
||||
List<string> errorNodeNames;
|
||||
@@ -1498,6 +1516,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
if (sop.VehicleParams != null)
|
||||
sop.VehicleParams.ToXml2(writer);
|
||||
|
||||
if (sop.PhysicsInertia != null)
|
||||
sop.PhysicsInertia.ToXml2(writer);
|
||||
|
||||
if(sop.RotationAxisLocks != 0)
|
||||
writer.WriteElementString("RotationAxisLocks", sop.RotationAxisLocks.ToString().ToLower());
|
||||
writer.WriteElementString("PhysicsShapeType", sop.PhysicsShapeType.ToString().ToLower());
|
||||
|
||||
Reference in New Issue
Block a user